1*0841af79SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*0841af79SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*0841af79SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*0841af79SAndrew Rist * distributed with this work for additional information
6*0841af79SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*0841af79SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*0841af79SAndrew Rist * "License"); you may not use this file except in compliance
9*0841af79SAndrew Rist * with the License. You may obtain a copy of the License at
10*0841af79SAndrew Rist *
11*0841af79SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*0841af79SAndrew Rist *
13*0841af79SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*0841af79SAndrew Rist * software distributed under the License is distributed on an
15*0841af79SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*0841af79SAndrew Rist * KIND, either express or implied. See the License for the
17*0841af79SAndrew Rist * specific language governing permissions and limitations
18*0841af79SAndrew Rist * under the License.
19*0841af79SAndrew Rist *
20*0841af79SAndrew Rist *************************************************************/
21cdf0e10cSrcweir
22cdf0e10cSrcweir #include <precomp.h>
23cdf0e10cSrcweir #include <toolkit/hf_linachain.hxx>
24cdf0e10cSrcweir
25cdf0e10cSrcweir
26cdf0e10cSrcweir // NOT FULLY DEFINED SERVICES
27cdf0e10cSrcweir #include <toolkit/out_position.hxx>
28cdf0e10cSrcweir
29cdf0e10cSrcweir
30cdf0e10cSrcweir
HF_LinkedNameChain(Xml::Element & o_rOut)31cdf0e10cSrcweir HF_LinkedNameChain::HF_LinkedNameChain( Xml::Element & o_rOut )
32cdf0e10cSrcweir : HtmlMaker( o_rOut
33cdf0e10cSrcweir >> *new Html::Paragraph
34cdf0e10cSrcweir << new Html::ClassAttr("namechain") )
35cdf0e10cSrcweir {
36cdf0e10cSrcweir }
37cdf0e10cSrcweir
~HF_LinkedNameChain()38cdf0e10cSrcweir HF_LinkedNameChain::~HF_LinkedNameChain()
39cdf0e10cSrcweir {
40cdf0e10cSrcweir }
41cdf0e10cSrcweir
42cdf0e10cSrcweir void
Produce_CompleteChain(const output::Position & i_curPosition,F_LinkMaker i_linkMaker) const43cdf0e10cSrcweir HF_LinkedNameChain::Produce_CompleteChain( const output::Position & i_curPosition,
44cdf0e10cSrcweir F_LinkMaker i_linkMaker ) const
45cdf0e10cSrcweir {
46cdf0e10cSrcweir produce_Level(i_curPosition.RelatedNode(), i_curPosition, i_linkMaker);
47cdf0e10cSrcweir }
48cdf0e10cSrcweir
49cdf0e10cSrcweir void
Produce_CompleteChain_forModule(const output::Position & i_curPosition,F_LinkMaker i_linkMaker) const50cdf0e10cSrcweir HF_LinkedNameChain::Produce_CompleteChain_forModule( const output::Position & i_curPosition,
51cdf0e10cSrcweir F_LinkMaker i_linkMaker ) const
52cdf0e10cSrcweir {
53cdf0e10cSrcweir if (i_curPosition.Depth() == 0)
54cdf0e10cSrcweir return;
55cdf0e10cSrcweir produce_Level(*i_curPosition.RelatedNode().Parent(), i_curPosition, i_linkMaker);
56cdf0e10cSrcweir }
57cdf0e10cSrcweir
58cdf0e10cSrcweir
59cdf0e10cSrcweir
60cdf0e10cSrcweir namespace
61cdf0e10cSrcweir {
62cdf0e10cSrcweir
63cdf0e10cSrcweir StreamStr aLinkBuf(200);
64cdf0e10cSrcweir
65cdf0e10cSrcweir }
66cdf0e10cSrcweir
67cdf0e10cSrcweir void
produce_Level(output::Node & i_levelNode,const output::Position & i_startPosition,F_LinkMaker i_linkMaker) const68cdf0e10cSrcweir HF_LinkedNameChain::produce_Level( output::Node & i_levelNode,
69cdf0e10cSrcweir const output::Position & i_startPosition,
70cdf0e10cSrcweir F_LinkMaker i_linkMaker ) const
71cdf0e10cSrcweir {
72cdf0e10cSrcweir if ( i_levelNode.Depth() > 0 )
73cdf0e10cSrcweir {
74cdf0e10cSrcweir produce_Level( *i_levelNode.Parent(),
75cdf0e10cSrcweir i_startPosition,
76cdf0e10cSrcweir i_linkMaker );
77cdf0e10cSrcweir }
78cdf0e10cSrcweir
79cdf0e10cSrcweir aLinkBuf.reset();
80cdf0e10cSrcweir
81cdf0e10cSrcweir String
82cdf0e10cSrcweir sFileName = (*i_linkMaker)(i_levelNode.Name());
83cdf0e10cSrcweir output::Position
84cdf0e10cSrcweir aLevelPos(i_levelNode, sFileName);
85cdf0e10cSrcweir
86cdf0e10cSrcweir i_startPosition.Get_LinkTo(aLinkBuf, aLevelPos);
87cdf0e10cSrcweir
88cdf0e10cSrcweir if ( i_levelNode.Depth() > 0 )
89cdf0e10cSrcweir {
90cdf0e10cSrcweir CurOut()
91cdf0e10cSrcweir >> *new Html::Link(aLinkBuf.c_str())
92cdf0e10cSrcweir << new Html::ClassAttr("namechain")
93cdf0e10cSrcweir << i_levelNode.Name();
94cdf0e10cSrcweir CurOut() << " :: ";
95cdf0e10cSrcweir }
96cdf0e10cSrcweir else
97cdf0e10cSrcweir {
98cdf0e10cSrcweir CurOut()
99cdf0e10cSrcweir >> *new Html::Link(aLinkBuf.c_str())
100cdf0e10cSrcweir << new Html::ClassAttr("namechain")
101cdf0e10cSrcweir << "::";
102cdf0e10cSrcweir CurOut() << " ";
103cdf0e10cSrcweir }
104cdf0e10cSrcweir }
105