Update ooo320-m1
[ooovba.git] / autodoc / source / display / html / pm_namsp.cxx
blob4f4fc09fbf5b05cb03333d86587c5694eb856c57
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pm_namsp.cxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <precomp.h>
32 #include "pm_namsp.hxx"
35 // NOT FULLY DEFINED SERVICES
36 #include "hd_chlst.hxx"
37 #include "hd_docu.hxx"
38 #include "html_kit.hxx"
39 #include "navibar.hxx"
40 #include "opageenv.hxx"
41 #include "pagemake.hxx"
42 #include "strconst.hxx"
45 using namespace csi;
46 using csi::html::HorizontalLine;
47 using csi::html::Link;
48 using csi::html::Table;
49 using csi::html::TableRow;
50 using csi::html::TableCell;
54 PageMaker_Namespace::PageMaker_Namespace( PageDisplay & io_rPage )
55 : SpecializedPageMaker(io_rPage),
56 pMe( io_rPage.Env().CurNamespace() ),
57 pChildDisplay( new ChildList_Display(io_rPage.Env()) ),
58 pNavi(0)
60 csv_assert( pMe != 0 );
63 PageMaker_Namespace::~PageMaker_Namespace()
67 void
68 PageMaker_Namespace::MakePage()
70 pNavi = new NavigationBar( Env(), Me() );
72 Write_NavBar();
73 Write_TopArea();
74 Write_DocuArea();
76 pNavi->MakeSubRow("");
77 Write_ChildList( ary::cpp::Namespace::SLOT_SubNamespaces, C_sTitle_SubNamespaces, C_sLabel_SubNamespaces );
79 Write_ChildLists_forClasses( C_sTitle_Classes,
80 C_sLabel_Classes,
81 ary::cpp::CK_class );
82 Write_ChildLists_forClasses( C_sTitle_Structs,
83 C_sLabel_Structs,
84 ary::cpp::CK_struct );
85 Write_ChildLists_forClasses( C_sTitle_Unions,
86 C_sLabel_Unions,
87 ary::cpp::CK_union );
89 Write_ChildList( ary::cpp::Namespace::SLOT_Enums, C_sTitle_Enums, C_sLabel_Enums );
90 Write_ChildList( ary::cpp::Namespace::SLOT_Typedefs, C_sTitle_Typedefs, C_sLabel_Typedefs );
91 Write_ChildList( ary::cpp::Namespace::SLOT_Operations, C_sTitle_Operations, C_sLabel_Operations );
92 Write_ChildList( ary::cpp::Namespace::SLOT_Constants, C_sTitle_Constants, C_sLabel_Constants );
93 Write_ChildList( ary::cpp::Namespace::SLOT_Variables, C_sTitle_Variables, C_sLabel_Variables );
95 pNavi->Write_SubRows();
98 void
99 PageMaker_Namespace::Write_NavBar()
101 pNavi->Write( CurOut() );
102 CurOut() << new HorizontalLine;
105 void
106 PageMaker_Namespace::Write_TopArea()
108 Page().Write_NameChainWithLinks( Me() );
110 adcdisp::PageTitle_Std fTitle;
111 xml::Element & rH3 = fTitle( CurOut() );
112 if ( Env().CurNamespace()->Owner().IsValid() )
114 rH3 << C_sHFTypeTitle_Namespace
115 << " "
116 << Env().CurNamespace()->LocalName();
118 else
120 rH3 << C_sHFTitle_GlobalNamespaceCpp;
122 CurOut() << new HorizontalLine;
125 void
126 PageMaker_Namespace::Write_DocuArea()
128 Docu_Display aDocuShow( Env() );
130 aDocuShow.Assign_Out(CurOut());
131 aDocuShow.Process(Me().Docu());
132 aDocuShow.Unassign_Out();
134 CurOut() << new HorizontalLine;
137 void
138 PageMaker_Namespace::Write_ChildList( ary::SlotAccessId i_nSlot,
139 const char * i_sListTitle,
140 const char * i_sLabel )
143 bool bChildrenExist = false;
144 ChildList_Display::Area_Result
145 aResult( bChildrenExist, CurOut() );
147 pChildDisplay->Run_Simple( aResult,
148 i_nSlot,
149 i_sLabel,
150 i_sListTitle );
152 pNavi->AddItem(i_sListTitle, i_sLabel, bChildrenExist);
153 if (bChildrenExist)
154 CurOut() << new HorizontalLine;
157 void
158 PageMaker_Namespace::Write_ChildLists_forClasses( const char * i_sListTitle,
159 const char * i_sLabel,
160 ary::cpp::E_ClassKey i_eFilter )
163 bool bChildrenExist = false;
164 ChildList_Display::Area_Result
165 aResult( bChildrenExist, CurOut() );
167 pChildDisplay->Run_GlobalClasses( aResult,
168 ary::cpp::Namespace::SLOT_Classes,
169 i_sLabel,
170 i_sListTitle,
171 i_eFilter );
173 pNavi->AddItem(i_sListTitle, i_sLabel, bChildrenExist);
174 if ( bChildrenExist )
175 CurOut() << new HorizontalLine;