xref: /AOO41X/main/autodoc/source/display/html/pm_namsp.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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 "pm_namsp.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir // NOT FULLY DEFINED SERVICES
33*cdf0e10cSrcweir #include "hd_chlst.hxx"
34*cdf0e10cSrcweir #include "hd_docu.hxx"
35*cdf0e10cSrcweir #include "html_kit.hxx"
36*cdf0e10cSrcweir #include "navibar.hxx"
37*cdf0e10cSrcweir #include "opageenv.hxx"
38*cdf0e10cSrcweir #include "pagemake.hxx"
39*cdf0e10cSrcweir #include "strconst.hxx"
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir using namespace csi;
43*cdf0e10cSrcweir using csi::html::HorizontalLine;
44*cdf0e10cSrcweir using csi::html::Link;
45*cdf0e10cSrcweir using csi::html::Table;
46*cdf0e10cSrcweir using csi::html::TableRow;
47*cdf0e10cSrcweir using csi::html::TableCell;
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir PageMaker_Namespace::PageMaker_Namespace( PageDisplay & io_rPage )
52*cdf0e10cSrcweir     :   SpecializedPageMaker(io_rPage),
53*cdf0e10cSrcweir         pMe( io_rPage.Env().CurNamespace() ),
54*cdf0e10cSrcweir         pChildDisplay( new ChildList_Display(io_rPage.Env()) ),
55*cdf0e10cSrcweir         pNavi(0)
56*cdf0e10cSrcweir {
57*cdf0e10cSrcweir     csv_assert( pMe != 0 );
58*cdf0e10cSrcweir }
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir PageMaker_Namespace::~PageMaker_Namespace()
61*cdf0e10cSrcweir {
62*cdf0e10cSrcweir }
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir void
65*cdf0e10cSrcweir PageMaker_Namespace::MakePage()
66*cdf0e10cSrcweir {
67*cdf0e10cSrcweir     pNavi = new NavigationBar( Env(), Me() );
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir     Write_NavBar();
70*cdf0e10cSrcweir     Write_TopArea();
71*cdf0e10cSrcweir     Write_DocuArea();
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir     pNavi->MakeSubRow("");
74*cdf0e10cSrcweir     Write_ChildList( ary::cpp::Namespace::SLOT_SubNamespaces, C_sTitle_SubNamespaces, C_sLabel_SubNamespaces );
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir     Write_ChildLists_forClasses( C_sTitle_Classes,
77*cdf0e10cSrcweir                                  C_sLabel_Classes,
78*cdf0e10cSrcweir                                  ary::cpp::CK_class );
79*cdf0e10cSrcweir     Write_ChildLists_forClasses( C_sTitle_Structs,
80*cdf0e10cSrcweir                                  C_sLabel_Structs,
81*cdf0e10cSrcweir                                  ary::cpp::CK_struct );
82*cdf0e10cSrcweir     Write_ChildLists_forClasses( C_sTitle_Unions,
83*cdf0e10cSrcweir                                  C_sLabel_Unions,
84*cdf0e10cSrcweir                                  ary::cpp::CK_union );
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir     Write_ChildList( ary::cpp::Namespace::SLOT_Enums, C_sTitle_Enums, C_sLabel_Enums  );
87*cdf0e10cSrcweir     Write_ChildList( ary::cpp::Namespace::SLOT_Typedefs, C_sTitle_Typedefs, C_sLabel_Typedefs  );
88*cdf0e10cSrcweir     Write_ChildList( ary::cpp::Namespace::SLOT_Operations, C_sTitle_Operations, C_sLabel_Operations  );
89*cdf0e10cSrcweir     Write_ChildList( ary::cpp::Namespace::SLOT_Constants, C_sTitle_Constants, C_sLabel_Constants  );
90*cdf0e10cSrcweir     Write_ChildList( ary::cpp::Namespace::SLOT_Variables, C_sTitle_Variables, C_sLabel_Variables  );
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir     pNavi->Write_SubRows();
93*cdf0e10cSrcweir }
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir void
96*cdf0e10cSrcweir PageMaker_Namespace::Write_NavBar()
97*cdf0e10cSrcweir {
98*cdf0e10cSrcweir     pNavi->Write( CurOut() );
99*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
100*cdf0e10cSrcweir }
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir void
103*cdf0e10cSrcweir PageMaker_Namespace::Write_TopArea()
104*cdf0e10cSrcweir {
105*cdf0e10cSrcweir     Page().Write_NameChainWithLinks( Me() );
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir     adcdisp::PageTitle_Std fTitle;
108*cdf0e10cSrcweir     xml::Element & rH3 = fTitle( CurOut() );
109*cdf0e10cSrcweir     if ( Env().CurNamespace()->Owner().IsValid() )
110*cdf0e10cSrcweir     {
111*cdf0e10cSrcweir         rH3 << C_sHFTypeTitle_Namespace
112*cdf0e10cSrcweir             << " "
113*cdf0e10cSrcweir             << Env().CurNamespace()->LocalName();
114*cdf0e10cSrcweir     }
115*cdf0e10cSrcweir     else
116*cdf0e10cSrcweir     {
117*cdf0e10cSrcweir         rH3 << C_sHFTitle_GlobalNamespaceCpp;
118*cdf0e10cSrcweir     }
119*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
120*cdf0e10cSrcweir }
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir void
123*cdf0e10cSrcweir PageMaker_Namespace::Write_DocuArea()
124*cdf0e10cSrcweir {
125*cdf0e10cSrcweir     Docu_Display aDocuShow( Env() );
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     aDocuShow.Assign_Out(CurOut());
128*cdf0e10cSrcweir     aDocuShow.Process(Me().Docu());
129*cdf0e10cSrcweir     aDocuShow.Unassign_Out();
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir     CurOut() << new HorizontalLine;
132*cdf0e10cSrcweir }
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir void
135*cdf0e10cSrcweir PageMaker_Namespace::Write_ChildList( ary::SlotAccessId   i_nSlot,
136*cdf0e10cSrcweir                                       const char *        i_sListTitle,
137*cdf0e10cSrcweir                                       const char *        i_sLabel )
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir {
140*cdf0e10cSrcweir     bool    bChildrenExist = false;
141*cdf0e10cSrcweir     ChildList_Display::Area_Result
142*cdf0e10cSrcweir             aResult( bChildrenExist, CurOut() );
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir     pChildDisplay->Run_Simple( aResult,
145*cdf0e10cSrcweir                                i_nSlot,
146*cdf0e10cSrcweir                                i_sLabel,
147*cdf0e10cSrcweir                                i_sListTitle );
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir     pNavi->AddItem(i_sListTitle, i_sLabel, bChildrenExist);
150*cdf0e10cSrcweir     if (bChildrenExist)
151*cdf0e10cSrcweir         CurOut() << new HorizontalLine;
152*cdf0e10cSrcweir }
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir void
155*cdf0e10cSrcweir PageMaker_Namespace::Write_ChildLists_forClasses( const char *         i_sListTitle,
156*cdf0e10cSrcweir                                                   const char *         i_sLabel,
157*cdf0e10cSrcweir                                                   ary::cpp::E_ClassKey i_eFilter )
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir {
160*cdf0e10cSrcweir     bool    bChildrenExist = false;
161*cdf0e10cSrcweir     ChildList_Display::Area_Result
162*cdf0e10cSrcweir             aResult( bChildrenExist, CurOut() );
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir     pChildDisplay->Run_GlobalClasses( aResult,
165*cdf0e10cSrcweir                                       ary::cpp::Namespace::SLOT_Classes,
166*cdf0e10cSrcweir                                       i_sLabel,
167*cdf0e10cSrcweir                                       i_sListTitle,
168*cdf0e10cSrcweir                                       i_eFilter );
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir     pNavi->AddItem(i_sListTitle, i_sLabel, bChildrenExist);
171*cdf0e10cSrcweir     if ( bChildrenExist )
172*cdf0e10cSrcweir         CurOut() << new HorizontalLine;
173*cdf0e10cSrcweir }
174