1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hfi_module.cxx,v $
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 ************************************************************************/
32 #include "hfi_module.hxx"
35 // NOT FULLY DEFINED SERVICES
36 #include <ary/idl/i_ce.hxx>
37 #include <ary/idl/i_module.hxx>
38 #include <ary/idl/ik_module.hxx>
39 #include <ary/doc/d_oldidldocu.hxx>
40 #include <ary/getncast.hxx>
41 #include <toolkit/hf_docentry.hxx>
42 #include <toolkit/hf_linachain.hxx>
43 #include <toolkit/hf_navi_sub.hxx>
44 #include <toolkit/hf_title.hxx>
45 #include "hfi_doc.hxx"
46 #include "hfi_navibar.hxx"
47 #include "hfi_tag.hxx"
48 #include "hfi_typetext.hxx"
49 #include "hi_linkhelper.hxx"
53 C_sCePrefix_Module("module");
59 C_sList_NestedModules("Nested Modules");
61 C_sList_NestedModules_Label("NestedModules");
63 C_sList_Services("Services");
65 C_sList_Singletons("Singletons");
67 C_sList_Interfaces("Interfaces");
69 C_sList_Structs("Structs");
71 C_sList_Exceptions("Exceptions");
73 C_sList_Enums("Enums");
75 C_sList_Typedefs("Typedefs");
77 C_sList_ConstGroups("Constant Groups");
79 C_sList_ConstGroups_Label("ConstantGroups");
83 { // In case of changes, also adapt make_Navibar() !!
84 sli_NestedModules
= 0,
95 } //anonymous namespace
98 HF_IdlModule::HF_IdlModule( Environment
& io_rEnv
,
99 Xml::Element
& o_rOut
)
100 : HtmlFactory_Idl(io_rEnv
, &o_rOut
)
104 HF_IdlModule::~HF_IdlModule()
108 typedef ary::idl::ifc_module::attr ModuleAttr
;
112 HF_IdlModule::Produce_byData( const client
& i_ce
) const
115 pNaviSubRow( &make_Navibar(i_ce
) );
120 aNameChain(aTitle
.Add_Row());
122 if ( Env().CurPosition().Depth() > 0 )
124 aNameChain
.Produce_CompleteChain_forModule(Env().CurPosition(), nameChainLinker
);
128 aTitle
.Produce_Title( sl()
129 << C_sCePrefix_Module
136 aTitle
.Produce_Title( "Global Module" );
139 write_Docu(aTitle
.Add_Row(), i_ce
);
140 CurOut() << new Html::HorizontalLine();
143 // Write children lists:
144 ce_ptr_list aNestedModules
;
145 ce_ptr_list aServices
;
146 ce_ptr_list aInterfaces
;
147 ce_ptr_list aStructs
;
148 ce_ptr_list aExceptions
;
150 ce_ptr_list aTypedefs
;
151 ce_ptr_list aConstantGroups
;
152 ce_ptr_list aSingletons
;
154 ModuleAttr::Get_AllChildrenSeparated(
167 // Has this to be in the order of enum E_SubListIndices ???
168 if (produce_ChildList(C_sList_NestedModules
, C_sList_NestedModules_Label
, aNestedModules
))
169 pNaviSubRow
->SwitchOn(sli_NestedModules
);
170 if (produce_ChildList(C_sList_Services
, C_sList_Services
, aServices
))
171 pNaviSubRow
->SwitchOn(sli_Services
);
172 if (produce_ChildList(C_sList_Singletons
, C_sList_Singletons
, aSingletons
))
173 pNaviSubRow
->SwitchOn(sli_Singletons
);
174 if (produce_ChildList(C_sList_Interfaces
, C_sList_Interfaces
, aInterfaces
))
175 pNaviSubRow
->SwitchOn(sli_Interfaces
);
176 if (produce_ChildList(C_sList_Structs
, C_sList_Structs
, aStructs
))
177 pNaviSubRow
->SwitchOn(sli_Structs
);
178 if (produce_ChildList(C_sList_Exceptions
, C_sList_Exceptions
, aExceptions
))
179 pNaviSubRow
->SwitchOn(sli_Exceptions
);
180 if (produce_ChildList(C_sList_Enums
, C_sList_Enums
, aEnums
))
181 pNaviSubRow
->SwitchOn(sli_Enums
);
182 if (produce_ChildList(C_sList_Typedefs
, C_sList_Typedefs
, aTypedefs
))
183 pNaviSubRow
->SwitchOn(sli_Typedefs
);
184 if (produce_ChildList(C_sList_ConstGroups
, C_sList_ConstGroups_Label
, aConstantGroups
))
185 pNaviSubRow
->SwitchOn(sli_ConstGroups
);
186 pNaviSubRow
->Produce_Row();
190 HF_IdlModule::make_Navibar( const client
& i_ce
) const
193 aNaviBar(Env(), CurOut());
194 aNaviBar
.Produce_ModuleMainRow(i_ce
);
197 ret
= aNaviBar
.Add_SubRow();
199 // Has to be in the order of E_SubListIndices:
200 ret
.AddItem(C_sList_NestedModules
, C_sList_NestedModules_Label
, false);
201 ret
.AddItem(C_sList_Services
, C_sList_Services
, false);
202 ret
.AddItem(C_sList_Singletons
, C_sList_Singletons
, false);
203 ret
.AddItem(C_sList_Interfaces
, C_sList_Interfaces
, false);
204 ret
.AddItem(C_sList_Structs
, C_sList_Structs
, false);
205 ret
.AddItem(C_sList_Exceptions
, C_sList_Exceptions
, false);
206 ret
.AddItem(C_sList_Enums
, C_sList_Enums
, false);
207 ret
.AddItem(C_sList_Typedefs
, C_sList_Typedefs
, false);
208 ret
.AddItem(C_sList_ConstGroups
, C_sList_ConstGroups_Label
, false);
210 CurOut() << new Html::HorizontalLine();
215 HF_IdlModule::produce_ChildList( const String
& i_sName
,
216 const String
& i_sLabel
,
217 const ce_ptr_list
& i_list
) const
219 if ( i_list
.size() == 0 )
228 ce_ptr_list::const_iterator
229 itEnd
= i_list
.end();
230 for ( ce_ptr_list::const_iterator it
= i_list
.begin();
235 rRow
= aTable
.Add_Row();
236 produce_Link(rRow
, *it
);
237 produce_LinkDoc(rRow
, *it
);
244 HF_IdlModule::produce_Link( Xml::Element
& o_row
,
245 const client
* i_ce
) const
247 csv_assert(i_ce
!= 0);
250 >> *new Html::TableCell
251 << new Html::ClassAttr(C_sCellStyle_SummaryLeft
);
253 if ( NOT
ary::is_type
<ary::idl::Module
>(*i_ce
) )
256 aText(Env(), rCell
, true);
257 aText
.Produce_byData(i_ce
->CeId());
261 StreamLock
slBuf(100);
263 >> *new Html::Link( slBuf() << i_ce
->LocalName()
266 << i_ce
->LocalName();
271 HF_IdlModule::produce_LinkDoc( Xml::Element
& o_row
,
272 const client
* i_ce
) const
274 csv_assert(i_ce
!= 0);
276 // We need the cell in any case, because, the rendering may be hurt else.
279 >> *new Html::TableCell
280 << new Html::ClassAttr(C_sCellStyle_SummaryRight
);
285 pShort
= Get_IdlDocu(rCe
.Docu());
290 if (pShort
->IsDeprecated())
292 rCell
<< "[ DEPRECATED ]" << new Html::LineBreak
;
294 if (pShort
->IsOptional())
296 rCell
<< "[ OPTIONAL ]" << new Html::LineBreak
;
299 HF_IdlDocuTextDisplay
300 aShortDisplay(Env(), &rCell
, *i_ce
);
301 pShort
->Short().DisplayAt(aShortDisplay
);