1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #include <precomp.h>
29*cdf0e10cSrcweir #include "pagemake.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir // NOT FULLY DEFINED SERVICES
33*cdf0e10cSrcweir #include <ary/cpp/c_gate.hxx>
34*cdf0e10cSrcweir #include <ary/cpp/c_namesp.hxx>
35*cdf0e10cSrcweir #include <ary/cpp/c_class.hxx>
36*cdf0e10cSrcweir #include <ary/cpp/c_enum.hxx>
37*cdf0e10cSrcweir #include <ary/cpp/c_tydef.hxx>
38*cdf0e10cSrcweir #include <ary/cpp/cp_ce.hxx>
39*cdf0e10cSrcweir #include <ary/loc/loc_file.hxx>
40*cdf0e10cSrcweir #include <display/corframe.hxx>
41*cdf0e10cSrcweir #include "hd_chlst.hxx"
42*cdf0e10cSrcweir #include "hd_docu.hxx"
43*cdf0e10cSrcweir #include "hdimpl.hxx"
44*cdf0e10cSrcweir #include "html_kit.hxx"
45*cdf0e10cSrcweir #include "navibar.hxx"
46*cdf0e10cSrcweir #include "opageenv.hxx"
47*cdf0e10cSrcweir #include "outfile.hxx"
48*cdf0e10cSrcweir #include "pm_aldef.hxx"
49*cdf0e10cSrcweir #include "pm_class.hxx"
50*cdf0e10cSrcweir #include "pm_help.hxx"
51*cdf0e10cSrcweir #include "pm_index.hxx"
52*cdf0e10cSrcweir #include "pm_namsp.hxx"
53*cdf0e10cSrcweir #include "pm_start.hxx"
54*cdf0e10cSrcweir #include "strconst.hxx"
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir using namespace csi;
58*cdf0e10cSrcweir using csi::html::Link;
59*cdf0e10cSrcweir using csi::html::HorizontalLine;
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir const int C_nNrOfIndexLetters = 27;
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir template <class SPECIAL_MAKER>
66*cdf0e10cSrcweir inline void
67*cdf0e10cSrcweir Make_SpecialPage( DYN SPECIAL_MAKER * let_dpMaker )
68*cdf0e10cSrcweir {
69*cdf0e10cSrcweir     Dyn< SPECIAL_MAKER > pMaker( let_dpMaker );
70*cdf0e10cSrcweir     pMaker->MakePage();
71*cdf0e10cSrcweir     pMaker = 0;
72*cdf0e10cSrcweir }
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir PageDisplay::PageDisplay( OuputPage_Environment & io_rEnv )
76*cdf0e10cSrcweir     :   HtmlDisplay_Impl( io_rEnv ),
77*cdf0e10cSrcweir         pMyFile( new HtmlDocuFile )
78*cdf0e10cSrcweir {
79*cdf0e10cSrcweir }
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir PageDisplay::~PageDisplay()
82*cdf0e10cSrcweir {
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir }
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir void
87*cdf0e10cSrcweir PageDisplay::Create_OverviewFile()
88*cdf0e10cSrcweir {
89*cdf0e10cSrcweir     Env().SetFile_Overview();
90*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), 0 );
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir     SetupFileOnCurEnv( C_sHFTitle_Overview );
93*cdf0e10cSrcweir     Make_SpecialPage( new PageMaker_Overview(*this) );
94*cdf0e10cSrcweir     Create_File();
95*cdf0e10cSrcweir }
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir void
98*cdf0e10cSrcweir PageDisplay::Create_AllDefsFile()
99*cdf0e10cSrcweir {
100*cdf0e10cSrcweir     // This method is a provisorium, because later this will
101*cdf0e10cSrcweir     //   be spreaded over the files.
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir     Env().MoveDir_2Root();
104*cdf0e10cSrcweir     Env().SetFile_AllDefs();
105*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), 0 );
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir     SetupFileOnCurEnv( "Defines and Macros" );
108*cdf0e10cSrcweir     Make_SpecialPage( new PageMaker_AllDefs(*this) );
109*cdf0e10cSrcweir     Create_File();
110*cdf0e10cSrcweir }
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir void
113*cdf0e10cSrcweir PageDisplay::Create_IndexFiles()
114*cdf0e10cSrcweir {
115*cdf0e10cSrcweir     Env().MoveDir_2Index();
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir     for ( int i = 0; i < C_nNrOfIndexLetters; ++i )
118*cdf0e10cSrcweir         Create_IndexFile(i);
119*cdf0e10cSrcweir }
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir void
122*cdf0e10cSrcweir PageDisplay::Create_HelpFile()
123*cdf0e10cSrcweir {
124*cdf0e10cSrcweir     Env().SetFile_Help();
125*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), 0 );
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     SetupFileOnCurEnv( C_sHFTitle_Help );
128*cdf0e10cSrcweir     Make_SpecialPage( new PageMaker_Help(*this) );
129*cdf0e10cSrcweir     Create_File();
130*cdf0e10cSrcweir }
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir void
133*cdf0e10cSrcweir PageDisplay::Create_NamespaceFile()
134*cdf0e10cSrcweir {
135*cdf0e10cSrcweir     csv_assert( Env().CurNamespace() != 0 );
136*cdf0e10cSrcweir     Env().SetFile_CurNamespace();
137*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), Env().Depth() );
138*cdf0e10cSrcweir     if (Env().CurNamespace()->Owner().IsValid())
139*cdf0e10cSrcweir     {
140*cdf0e10cSrcweir         StreamLock sNsp(100);
141*cdf0e10cSrcweir         SetupFileOnCurEnv( sNsp() << C_sHFTypeTitle_Namespace
142*cdf0e10cSrcweir                                   << " "
143*cdf0e10cSrcweir                                   << Env().CurNamespace()->LocalName()
144*cdf0e10cSrcweir                                   << c_str );
145*cdf0e10cSrcweir     }
146*cdf0e10cSrcweir     else
147*cdf0e10cSrcweir     {
148*cdf0e10cSrcweir         SetupFileOnCurEnv( C_sHFTitle_GlobalNamespaceCpp );
149*cdf0e10cSrcweir     }
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir     Make_SpecialPage( new PageMaker_Namespace(*this) );
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir     Create_File();
154*cdf0e10cSrcweir }
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir void
157*cdf0e10cSrcweir PageDisplay::Setup_OperationsFile_for( const ary::loc::File & i_rFile )
158*cdf0e10cSrcweir {
159*cdf0e10cSrcweir     csv_assert( Env().CurNamespace() != 0 );
160*cdf0e10cSrcweir     Env().SetFile_Operations(&i_rFile);
161*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), Env().Depth() );
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir     StreamLock sOpFile(100);
164*cdf0e10cSrcweir     SetupFileOnCurEnv( sOpFile() << "Global Functions in Namespace "
165*cdf0e10cSrcweir                                  << Env().CurNamespace()->LocalName()
166*cdf0e10cSrcweir                                  << " in Sourcefile "
167*cdf0e10cSrcweir                                  << i_rFile.LocalName()
168*cdf0e10cSrcweir                                  << c_str );
169*cdf0e10cSrcweir     NavigationBar
170*cdf0e10cSrcweir             aNavi( Env(),
171*cdf0e10cSrcweir                    NavigationBar::CEGT_operations );
172*cdf0e10cSrcweir     aNavi.Write( CurOut() );
173*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir     adcdisp::PageTitle_Std fTitle;
176*cdf0e10cSrcweir     csi::xml::Element & rTitle = fTitle( CurOut() );
177*cdf0e10cSrcweir     if (Env().CurNamespace()->Owner().IsValid())
178*cdf0e10cSrcweir     {
179*cdf0e10cSrcweir      	rTitle << "Global Functions in Namespace "
180*cdf0e10cSrcweir                << Env().CurNamespace()->LocalName();
181*cdf0e10cSrcweir     }
182*cdf0e10cSrcweir     else
183*cdf0e10cSrcweir     {
184*cdf0e10cSrcweir         rTitle << "Global Functions in Global Namespace C++";
185*cdf0e10cSrcweir     }
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir     rTitle << new html::LineBreak
188*cdf0e10cSrcweir            << "in Sourcefile "
189*cdf0e10cSrcweir            << i_rFile.LocalName();
190*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
191*cdf0e10cSrcweir }
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir void
194*cdf0e10cSrcweir PageDisplay::Setup_OperationsFile_for( const ary::cpp::Class & i_rClass )
195*cdf0e10cSrcweir {
196*cdf0e10cSrcweir     csv_assert( Env().CurNamespace() != 0 );
197*cdf0e10cSrcweir     Env().SetFile_Operations(0);
198*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), Env().Depth() );
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir     StreamLock sOpFile(100);
201*cdf0e10cSrcweir     SetupFileOnCurEnv( sOpFile() << "Methods of Class "
202*cdf0e10cSrcweir                                  << i_rClass.LocalName()
203*cdf0e10cSrcweir                                  << c_str );
204*cdf0e10cSrcweir     NavigationBar
205*cdf0e10cSrcweir             aNavi( Env(),
206*cdf0e10cSrcweir                    NavigationBar::CEGT_operations );
207*cdf0e10cSrcweir     aNavi.Write( CurOut() );
208*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir     adcdisp::PageTitle_Std fTitle;
211*cdf0e10cSrcweir     fTitle( CurOut(), "Methods of Class", i_rClass.LocalName() );
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
214*cdf0e10cSrcweir }
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir void
217*cdf0e10cSrcweir PageDisplay::Setup_DataFile_for( const ary::loc::File & i_rFile )
218*cdf0e10cSrcweir {
219*cdf0e10cSrcweir     csv_assert( Env().CurNamespace() != 0 );
220*cdf0e10cSrcweir     Env().SetFile_Data(&i_rFile);
221*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), Env().Depth() );
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir     StreamLock sDataFile(100);
224*cdf0e10cSrcweir     SetupFileOnCurEnv( sDataFile() << "Global Data in Namespace "
225*cdf0e10cSrcweir                                    << Env().CurNamespace()->LocalName()
226*cdf0e10cSrcweir                                    << " in Sourcefile "
227*cdf0e10cSrcweir                                    << i_rFile.LocalName()
228*cdf0e10cSrcweir                                    << c_str );
229*cdf0e10cSrcweir     NavigationBar
230*cdf0e10cSrcweir             aNavi( Env(),
231*cdf0e10cSrcweir                    NavigationBar::CEGT_data );
232*cdf0e10cSrcweir     aNavi.Write( CurOut() );
233*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir     adcdisp::PageTitle_Std fTitle;
236*cdf0e10cSrcweir     csi::xml::Element & rTitle = fTitle( CurOut() );
237*cdf0e10cSrcweir     if ( Env().CurNamespace()->Owner().IsValid() )
238*cdf0e10cSrcweir     {
239*cdf0e10cSrcweir      	rTitle << "Global Data in Namespace "
240*cdf0e10cSrcweir                << Env().CurNamespace()->LocalName();
241*cdf0e10cSrcweir     }
242*cdf0e10cSrcweir     else
243*cdf0e10cSrcweir     {
244*cdf0e10cSrcweir         rTitle << "Global Data in Global Namespace C++";
245*cdf0e10cSrcweir     }
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir     rTitle
248*cdf0e10cSrcweir         << new html::LineBreak
249*cdf0e10cSrcweir         << "in Sourcefile "
250*cdf0e10cSrcweir         << i_rFile.LocalName();
251*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
252*cdf0e10cSrcweir }
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir void
255*cdf0e10cSrcweir PageDisplay::Setup_DataFile_for( const ary::cpp::Class & i_rClass )
256*cdf0e10cSrcweir {
257*cdf0e10cSrcweir     csv_assert( Env().CurNamespace() != 0 );
258*cdf0e10cSrcweir     Env().SetFile_Data(0);
259*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), Env().Depth() );
260*cdf0e10cSrcweir 
261*cdf0e10cSrcweir     StreamLock sDataFile(100);
262*cdf0e10cSrcweir     SetupFileOnCurEnv( sDataFile() << "Data of Class "
263*cdf0e10cSrcweir                                    << i_rClass.LocalName()
264*cdf0e10cSrcweir                                    << c_str );
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir     NavigationBar
267*cdf0e10cSrcweir             aNavi( Env(),
268*cdf0e10cSrcweir                    NavigationBar::CEGT_data );
269*cdf0e10cSrcweir     aNavi.Write( CurOut() );
270*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir     adcdisp::PageTitle_Std fTitle;
273*cdf0e10cSrcweir     fTitle( CurOut(), "Data of Class", i_rClass.LocalName() );
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
276*cdf0e10cSrcweir }
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir void
279*cdf0e10cSrcweir PageDisplay::Create_File()
280*cdf0e10cSrcweir {
281*cdf0e10cSrcweir     Easy().Leave();
282*cdf0e10cSrcweir     File().CreateFile();
283*cdf0e10cSrcweir }
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir void
286*cdf0e10cSrcweir PageDisplay::do_Process(const ary::cpp::Class & i_rData)
287*cdf0e10cSrcweir {
288*cdf0e10cSrcweir     Env().SetFile_Class(i_rData);
289*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), Env().Depth() );
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir     const char *
292*cdf0e10cSrcweir             sTypeTitle = i_rData.ClassKey() == ary::cpp::CK_class
293*cdf0e10cSrcweir                             ?   C_sHFTypeTitle_Class
294*cdf0e10cSrcweir                             :   i_rData.ClassKey() == ary::cpp::CK_struct
295*cdf0e10cSrcweir                                     ?   C_sHFTypeTitle_Struct
296*cdf0e10cSrcweir                                     :   C_sHFTypeTitle_Union;
297*cdf0e10cSrcweir     StreamLock sClassFile(60);
298*cdf0e10cSrcweir     SetupFileOnCurEnv( sClassFile() << sTypeTitle
299*cdf0e10cSrcweir                                     << " "
300*cdf0e10cSrcweir                                     << i_rData.LocalName()
301*cdf0e10cSrcweir                                     << c_str );
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir     Make_SpecialPage( new PageMaker_Class(*this, i_rData) );
304*cdf0e10cSrcweir 
305*cdf0e10cSrcweir     Create_File();
306*cdf0e10cSrcweir }
307*cdf0e10cSrcweir 
308*cdf0e10cSrcweir void
309*cdf0e10cSrcweir PageDisplay::do_Process(const ary::cpp::Enum & i_rData)
310*cdf0e10cSrcweir {
311*cdf0e10cSrcweir     if ( Ce_IsInternal(i_rData) )
312*cdf0e10cSrcweir         return;
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir     Env().SetFile_Enum(i_rData);
315*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), Env().Depth() );
316*cdf0e10cSrcweir 
317*cdf0e10cSrcweir     StreamLock sEnumFile(100);
318*cdf0e10cSrcweir     SetupFileOnCurEnv( sEnumFile() << C_sHFTypeTitle_Enum
319*cdf0e10cSrcweir                                    << " "
320*cdf0e10cSrcweir                                    << i_rData.LocalName()
321*cdf0e10cSrcweir                                    << c_str );
322*cdf0e10cSrcweir     Write_NavBar_Enum(i_rData);
323*cdf0e10cSrcweir     Write_TopArea_Enum(i_rData);
324*cdf0e10cSrcweir     Write_DocuArea_Enum(i_rData);
325*cdf0e10cSrcweir     Write_ChildList_Enum(i_rData);
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir     Create_File();
328*cdf0e10cSrcweir }
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir void
331*cdf0e10cSrcweir PageDisplay::do_Process(const ary::cpp::Typedef & i_rData)
332*cdf0e10cSrcweir {
333*cdf0e10cSrcweir     if ( Ce_IsInternal(i_rData) )
334*cdf0e10cSrcweir         return;
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir     Env().SetFile_Typedef(i_rData);
337*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), Env().Depth() );
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir     StreamLock sTypedefFile(100);
340*cdf0e10cSrcweir     SetupFileOnCurEnv( sTypedefFile() << C_sHFTypeTitle_Typedef
341*cdf0e10cSrcweir                                       << " "
342*cdf0e10cSrcweir                                       << i_rData.LocalName()
343*cdf0e10cSrcweir                                       << c_str );
344*cdf0e10cSrcweir     Write_NavBar_Typedef(i_rData);
345*cdf0e10cSrcweir     Write_TopArea_Typedef(i_rData);
346*cdf0e10cSrcweir     Write_DocuArea_Typedef(i_rData);
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir 
349*cdf0e10cSrcweir     Create_File();
350*cdf0e10cSrcweir }
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir void
353*cdf0e10cSrcweir PageDisplay::Write_NameChainWithLinks( const ary::cpp::CodeEntity & i_rCe )
354*cdf0e10cSrcweir {
355*cdf0e10cSrcweir     if ( Env().CurNamespace()->Id() != i_rCe.Id() )
356*cdf0e10cSrcweir     {
357*cdf0e10cSrcweir         RecursiveWrite_NamespaceLink( Env().CurNamespace() );
358*cdf0e10cSrcweir         if ( Env().CurClass() != 0 )
359*cdf0e10cSrcweir         {
360*cdf0e10cSrcweir             CurOut() << new html::Sbr;
361*cdf0e10cSrcweir             RecursiveWrite_ClassLink( Env().CurClass(), 1 );
362*cdf0e10cSrcweir         }
363*cdf0e10cSrcweir     }
364*cdf0e10cSrcweir     else
365*cdf0e10cSrcweir     {
366*cdf0e10cSrcweir         RecursiveWrite_NamespaceLink( Env().CurNamespace()->Parent() );
367*cdf0e10cSrcweir     }
368*cdf0e10cSrcweir }
369*cdf0e10cSrcweir 
370*cdf0e10cSrcweir const ary::cpp::Gate *
371*cdf0e10cSrcweir PageDisplay::inq_Get_ReFinder() const
372*cdf0e10cSrcweir {
373*cdf0e10cSrcweir  	return &Env().Gate();
374*cdf0e10cSrcweir }
375*cdf0e10cSrcweir 
376*cdf0e10cSrcweir void
377*cdf0e10cSrcweir PageDisplay::RecursiveWrite_NamespaceLink( const ary::cpp::Namespace * i_pNamespace )
378*cdf0e10cSrcweir {
379*cdf0e10cSrcweir     if ( i_pNamespace == 0 )
380*cdf0e10cSrcweir     {
381*cdf0e10cSrcweir         return;
382*cdf0e10cSrcweir     }
383*cdf0e10cSrcweir     else if (NOT i_pNamespace->Owner().IsValid())
384*cdf0e10cSrcweir     {   // Global namespace:
385*cdf0e10cSrcweir         StreamLock sNspDir(50);
386*cdf0e10cSrcweir         CurOut()
387*cdf0e10cSrcweir             >> *new Link( PathPerRoot(Env(),
388*cdf0e10cSrcweir                                       sNspDir() << C_sDIR_NamespacesCpp
389*cdf0e10cSrcweir                                                 << "/"
390*cdf0e10cSrcweir                                                 << C_sHFN_Namespace
391*cdf0e10cSrcweir                                                 << c_str) )
392*cdf0e10cSrcweir                     << new xml::AnAttribute( "alt", C_sHFTitle_GlobalNamespaceCpp )
393*cdf0e10cSrcweir                     >> *new html::Font
394*cdf0e10cSrcweir                             << new html::SizeAttr("+1")
395*cdf0e10cSrcweir                             >> *new html::Bold
396*cdf0e10cSrcweir                                     << "::";
397*cdf0e10cSrcweir         CurOut()
398*cdf0e10cSrcweir             << " ";
399*cdf0e10cSrcweir         return;
400*cdf0e10cSrcweir     }
401*cdf0e10cSrcweir     else
402*cdf0e10cSrcweir     {
403*cdf0e10cSrcweir         RecursiveWrite_NamespaceLink( i_pNamespace->Parent() );
404*cdf0e10cSrcweir     }
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir     uintt nLevelDistance = Env().Depth() - ( i_pNamespace->Depth() + 1 );
407*cdf0e10cSrcweir     csv_assert( nLevelDistance < 100 );
408*cdf0e10cSrcweir     CurOut()
409*cdf0e10cSrcweir         >> *new Link( PathPerLevelsUp(nLevelDistance, C_sHFN_Namespace) )
410*cdf0e10cSrcweir                 << new xml::AnAttribute( "alt", C_sHFTypeTitle_Namespace)
411*cdf0e10cSrcweir                 >> *new html::Font
412*cdf0e10cSrcweir                         << new html::SizeAttr("+1")
413*cdf0e10cSrcweir                         >> *new html::Bold
414*cdf0e10cSrcweir                                 << i_pNamespace->LocalName();
415*cdf0e10cSrcweir     CurOut()
416*cdf0e10cSrcweir         >> *new html::Font
417*cdf0e10cSrcweir                 << new html::SizeAttr("+1")
418*cdf0e10cSrcweir                 << " :: ";
419*cdf0e10cSrcweir }
420*cdf0e10cSrcweir 
421*cdf0e10cSrcweir void
422*cdf0e10cSrcweir PageDisplay::RecursiveWrite_ClassLink( const ary::cpp::Class * i_pClass,
423*cdf0e10cSrcweir                                        uintt                   i_nLevelDistance )
424*cdf0e10cSrcweir {
425*cdf0e10cSrcweir  	if ( i_pClass == 0 )
426*cdf0e10cSrcweir         return;
427*cdf0e10cSrcweir 
428*cdf0e10cSrcweir     if ( i_pClass->Protection() != ary::cpp::PROTECT_global )
429*cdf0e10cSrcweir     {
430*cdf0e10cSrcweir      	RecursiveWrite_ClassLink(
431*cdf0e10cSrcweir             dynamic_cast< const ary::cpp::Class* >(
432*cdf0e10cSrcweir                 Env().Gate().Ces().Search_Ce(i_pClass->Owner())),
433*cdf0e10cSrcweir             i_nLevelDistance + 1 );
434*cdf0e10cSrcweir     }
435*cdf0e10cSrcweir 
436*cdf0e10cSrcweir     CurOut()
437*cdf0e10cSrcweir         >> *new Link( Path2Class(i_nLevelDistance, i_pClass->LocalName()) )
438*cdf0e10cSrcweir             << new html::ClassAttr("nqclass")
439*cdf0e10cSrcweir             << i_pClass->LocalName()
440*cdf0e10cSrcweir             << " :: ";
441*cdf0e10cSrcweir }
442*cdf0e10cSrcweir 
443*cdf0e10cSrcweir void
444*cdf0e10cSrcweir PageDisplay::SetupFileOnCurEnv( const char * i_sTitle )
445*cdf0e10cSrcweir {
446*cdf0e10cSrcweir     File().SetLocation( Env().CurPath(), Env().Depth() );
447*cdf0e10cSrcweir     File().SetTitle( i_sTitle );
448*cdf0e10cSrcweir     File().SetCopyright( Env().Layout().CopyrightText() );
449*cdf0e10cSrcweir     File().EmptyBody();
450*cdf0e10cSrcweir 
451*cdf0e10cSrcweir     // This sets CurOut() to the contents of <body></body>
452*cdf0e10cSrcweir     //   in File() :
453*cdf0e10cSrcweir     Easy().Enter( File().Body() );
454*cdf0e10cSrcweir }
455*cdf0e10cSrcweir 
456*cdf0e10cSrcweir void
457*cdf0e10cSrcweir PageDisplay::Write_NavBar_Enum( const ary::cpp::Enum & i_rData )
458*cdf0e10cSrcweir {
459*cdf0e10cSrcweir     NavigationBar   aNavi( Env(), i_rData );
460*cdf0e10cSrcweir     aNavi.MakeSubRow("List of");
461*cdf0e10cSrcweir     aNavi.AddItem( C_sTitle_EnumValues, C_sLabel_EnumValues, true );
462*cdf0e10cSrcweir     aNavi.Write( CurOut(), true );
463*cdf0e10cSrcweir 
464*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
465*cdf0e10cSrcweir }
466*cdf0e10cSrcweir 
467*cdf0e10cSrcweir void
468*cdf0e10cSrcweir PageDisplay::Write_TopArea_Enum( const ary::cpp::Enum & i_rData )
469*cdf0e10cSrcweir {
470*cdf0e10cSrcweir     Write_NameChainWithLinks( i_rData );
471*cdf0e10cSrcweir 
472*cdf0e10cSrcweir     adcdisp::PageTitle_Std fTitle;
473*cdf0e10cSrcweir     fTitle( CurOut(), C_sHFTypeTitle_Enum, i_rData.LocalName() );
474*cdf0e10cSrcweir 
475*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
476*cdf0e10cSrcweir }
477*cdf0e10cSrcweir 
478*cdf0e10cSrcweir void
479*cdf0e10cSrcweir PageDisplay::Write_DocuArea_Enum( const ary::cpp::Enum & i_rData )
480*cdf0e10cSrcweir {
481*cdf0e10cSrcweir     Docu_Display aDocuShow( Env() );
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir     aDocuShow.Assign_Out(CurOut());
484*cdf0e10cSrcweir     aDocuShow.Process(i_rData.Docu());
485*cdf0e10cSrcweir     aDocuShow.Unassign_Out();
486*cdf0e10cSrcweir 
487*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
488*cdf0e10cSrcweir }
489*cdf0e10cSrcweir 
490*cdf0e10cSrcweir void
491*cdf0e10cSrcweir PageDisplay::Write_ChildList_Enum( const ary::cpp::Enum & i_rData )
492*cdf0e10cSrcweir {
493*cdf0e10cSrcweir     bool    bChildrenExist = false;
494*cdf0e10cSrcweir     ChildList_Display::Area_Result
495*cdf0e10cSrcweir             aResult( bChildrenExist, CurOut() );
496*cdf0e10cSrcweir 
497*cdf0e10cSrcweir     ChildList_Display aDisplay(Env(), i_rData);
498*cdf0e10cSrcweir     aDisplay.Run_Simple( aResult,
499*cdf0e10cSrcweir                          ary::cpp::Enum::SLOT_Values,
500*cdf0e10cSrcweir                          C_sLabel_EnumValues,
501*cdf0e10cSrcweir                          C_sTitle_EnumValues );
502*cdf0e10cSrcweir 
503*cdf0e10cSrcweir     if (NOT bChildrenExist)
504*cdf0e10cSrcweir         CurOut() >> *new html::Headline(4) << "This enum has no values.";
505*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
506*cdf0e10cSrcweir }
507*cdf0e10cSrcweir 
508*cdf0e10cSrcweir void
509*cdf0e10cSrcweir PageDisplay::Write_NavBar_Typedef( const ary::cpp::Typedef & i_rData )
510*cdf0e10cSrcweir {
511*cdf0e10cSrcweir     NavigationBar   aNavi( Env(), i_rData );
512*cdf0e10cSrcweir     aNavi.Write( CurOut(), true );
513*cdf0e10cSrcweir 
514*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
515*cdf0e10cSrcweir }
516*cdf0e10cSrcweir 
517*cdf0e10cSrcweir void
518*cdf0e10cSrcweir PageDisplay::Write_TopArea_Typedef( const ary::cpp::Typedef & i_rData )
519*cdf0e10cSrcweir {
520*cdf0e10cSrcweir     Write_NameChainWithLinks( i_rData );
521*cdf0e10cSrcweir 
522*cdf0e10cSrcweir     adcdisp::PageTitle_Std fTitle;
523*cdf0e10cSrcweir     fTitle( CurOut(), C_sHFTypeTitle_Typedef, i_rData.LocalName() );
524*cdf0e10cSrcweir 
525*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
526*cdf0e10cSrcweir }
527*cdf0e10cSrcweir 
528*cdf0e10cSrcweir void
529*cdf0e10cSrcweir PageDisplay::Write_DocuArea_Typedef( const ary::cpp::Typedef & i_rData )
530*cdf0e10cSrcweir {
531*cdf0e10cSrcweir     adcdisp::ExplanationList aDef( CurOut() );
532*cdf0e10cSrcweir     aDef.AddEntry("Definition:");
533*cdf0e10cSrcweir     xml::Element & rDef = aDef.Def();
534*cdf0e10cSrcweir 
535*cdf0e10cSrcweir     ary::cpp::Type_id
536*cdf0e10cSrcweir         nDefiningType = i_rData.DescribingType();
537*cdf0e10cSrcweir 
538*cdf0e10cSrcweir     const ary::cpp::CodeEntity *
539*cdf0e10cSrcweir         pRelatedCe = Env().Gate().Search_RelatedCe(nDefiningType);
540*cdf0e10cSrcweir     if ( pRelatedCe != 0 )
541*cdf0e10cSrcweir     {
542*cdf0e10cSrcweir         const char * sTypeKey = Get_TypeKey(*pRelatedCe);
543*cdf0e10cSrcweir         if ( NOT csv::no_str(sTypeKey) )
544*cdf0e10cSrcweir             rDef << sTypeKey << " ";
545*cdf0e10cSrcweir     }
546*cdf0e10cSrcweir 
547*cdf0e10cSrcweir     dshelp::Get_LinkedTypeText( rDef, Env(), nDefiningType );
548*cdf0e10cSrcweir 
549*cdf0e10cSrcweir     Docu_Display aDocuShow( Env() );
550*cdf0e10cSrcweir 
551*cdf0e10cSrcweir     aDocuShow.Assign_Out(CurOut());
552*cdf0e10cSrcweir     aDocuShow.Process(i_rData.Docu());
553*cdf0e10cSrcweir     aDocuShow.Unassign_Out();
554*cdf0e10cSrcweir 
555*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
556*cdf0e10cSrcweir }
557*cdf0e10cSrcweir 
558*cdf0e10cSrcweir void
559*cdf0e10cSrcweir PageDisplay::Create_IndexFile( int i_nLetter )
560*cdf0e10cSrcweir {
561*cdf0e10cSrcweir     static char aLetters[C_nNrOfIndexLetters+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
562*cdf0e10cSrcweir     csv_assert( 0 <= i_nLetter AND i_nLetter < C_nNrOfIndexLetters );
563*cdf0e10cSrcweir 
564*cdf0e10cSrcweir     char cCurLetter = aLetters[i_nLetter];
565*cdf0e10cSrcweir     Env().SetFile_Index( cCurLetter );
566*cdf0e10cSrcweir 
567*cdf0e10cSrcweir     static char sIndexFileTitle[] = "Global Index X";
568*cdf0e10cSrcweir     const int nPositionOfLetterInTitle = 13;
569*cdf0e10cSrcweir     sIndexFileTitle[nPositionOfLetterInTitle] = cCurLetter;
570*cdf0e10cSrcweir     SetupFileOnCurEnv( sIndexFileTitle );
571*cdf0e10cSrcweir 
572*cdf0e10cSrcweir     Make_SpecialPage( new PageMaker_Index(*this, cCurLetter ) );
573*cdf0e10cSrcweir 
574*cdf0e10cSrcweir     Create_File();
575*cdf0e10cSrcweir }
576*cdf0e10cSrcweir 
577