1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 #include "hfi_module.hxx"
33 // NOT FULLY DEFINED SERVICES
34 #include <ary/idl/i_ce.hxx>
35 #include <ary/idl/i_module.hxx>
36 #include <ary/idl/ik_module.hxx>
37 #include <ary/doc/d_oldidldocu.hxx>
38 #include <ary/getncast.hxx>
39 #include <toolkit/hf_docentry.hxx>
40 #include <toolkit/hf_linachain.hxx>
41 #include <toolkit/hf_navi_sub.hxx>
42 #include <toolkit/hf_title.hxx>
43 #include "hfi_doc.hxx"
44 #include "hfi_navibar.hxx"
45 #include "hfi_tag.hxx"
46 #include "hfi_typetext.hxx"
47 #include "hi_linkhelper.hxx"
51 C_sCePrefix_Module("module");
57 C_sList_NestedModules("Nested Modules");
59 C_sList_NestedModules_Label("NestedModules");
61 C_sList_Services("Services");
63 C_sList_Singletons("Singletons");
65 C_sList_Interfaces("Interfaces");
67 C_sList_Structs("Structs");
69 C_sList_Exceptions("Exceptions");
71 C_sList_Enums("Enums");
73 C_sList_Typedefs("Typedefs");
75 C_sList_ConstGroups("Constant Groups");
77 C_sList_ConstGroups_Label("ConstantGroups");
81 { // In case of changes, also adapt make_Navibar() !!
82 sli_NestedModules
= 0,
93 } //anonymous namespace
96 HF_IdlModule::HF_IdlModule( Environment
& io_rEnv
,
97 Xml::Element
& o_rOut
)
98 : HtmlFactory_Idl(io_rEnv
, &o_rOut
)
102 HF_IdlModule::~HF_IdlModule()
106 typedef ary::idl::ifc_module::attr ModuleAttr
;
110 HF_IdlModule::Produce_byData( const client
& i_ce
) const
113 pNaviSubRow( &make_Navibar(i_ce
) );
118 aNameChain(aTitle
.Add_Row());
120 if ( Env().CurPosition().Depth() > 0 )
122 aNameChain
.Produce_CompleteChain_forModule(Env().CurPosition(), nameChainLinker
);
126 aTitle
.Produce_Title( sl()
127 << C_sCePrefix_Module
134 aTitle
.Produce_Title( "Global Module" );
137 write_Docu(aTitle
.Add_Row(), i_ce
);
138 CurOut() << new Html::HorizontalLine();
141 // Write children lists:
142 ce_ptr_list aNestedModules
;
143 ce_ptr_list aServices
;
144 ce_ptr_list aInterfaces
;
145 ce_ptr_list aStructs
;
146 ce_ptr_list aExceptions
;
148 ce_ptr_list aTypedefs
;
149 ce_ptr_list aConstantGroups
;
150 ce_ptr_list aSingletons
;
152 ModuleAttr::Get_AllChildrenSeparated(
165 // Has this to be in the order of enum E_SubListIndices ???
166 if (produce_ChildList(C_sList_NestedModules
, C_sList_NestedModules_Label
, aNestedModules
))
167 pNaviSubRow
->SwitchOn(sli_NestedModules
);
168 if (produce_ChildList(C_sList_Services
, C_sList_Services
, aServices
))
169 pNaviSubRow
->SwitchOn(sli_Services
);
170 if (produce_ChildList(C_sList_Singletons
, C_sList_Singletons
, aSingletons
))
171 pNaviSubRow
->SwitchOn(sli_Singletons
);
172 if (produce_ChildList(C_sList_Interfaces
, C_sList_Interfaces
, aInterfaces
))
173 pNaviSubRow
->SwitchOn(sli_Interfaces
);
174 if (produce_ChildList(C_sList_Structs
, C_sList_Structs
, aStructs
))
175 pNaviSubRow
->SwitchOn(sli_Structs
);
176 if (produce_ChildList(C_sList_Exceptions
, C_sList_Exceptions
, aExceptions
))
177 pNaviSubRow
->SwitchOn(sli_Exceptions
);
178 if (produce_ChildList(C_sList_Enums
, C_sList_Enums
, aEnums
))
179 pNaviSubRow
->SwitchOn(sli_Enums
);
180 if (produce_ChildList(C_sList_Typedefs
, C_sList_Typedefs
, aTypedefs
))
181 pNaviSubRow
->SwitchOn(sli_Typedefs
);
182 if (produce_ChildList(C_sList_ConstGroups
, C_sList_ConstGroups_Label
, aConstantGroups
))
183 pNaviSubRow
->SwitchOn(sli_ConstGroups
);
184 pNaviSubRow
->Produce_Row();
188 HF_IdlModule::make_Navibar( const client
& i_ce
) const
191 aNaviBar(Env(), CurOut());
192 aNaviBar
.Produce_ModuleMainRow(i_ce
);
195 ret
= aNaviBar
.Add_SubRow();
197 // Has to be in the order of E_SubListIndices:
198 ret
.AddItem(C_sList_NestedModules
, C_sList_NestedModules_Label
, false);
199 ret
.AddItem(C_sList_Services
, C_sList_Services
, false);
200 ret
.AddItem(C_sList_Singletons
, C_sList_Singletons
, false);
201 ret
.AddItem(C_sList_Interfaces
, C_sList_Interfaces
, false);
202 ret
.AddItem(C_sList_Structs
, C_sList_Structs
, false);
203 ret
.AddItem(C_sList_Exceptions
, C_sList_Exceptions
, false);
204 ret
.AddItem(C_sList_Enums
, C_sList_Enums
, false);
205 ret
.AddItem(C_sList_Typedefs
, C_sList_Typedefs
, false);
206 ret
.AddItem(C_sList_ConstGroups
, C_sList_ConstGroups_Label
, false);
208 CurOut() << new Html::HorizontalLine();
213 HF_IdlModule::produce_ChildList( const String
& i_sName
,
214 const String
& i_sLabel
,
215 const ce_ptr_list
& i_list
) const
217 if ( i_list
.empty() )
226 ce_ptr_list::const_iterator
227 itEnd
= i_list
.end();
228 for ( ce_ptr_list::const_iterator it
= i_list
.begin();
233 rRow
= aTable
.Add_Row();
234 produce_Link(rRow
, *it
);
235 produce_LinkDoc(rRow
, *it
);
242 HF_IdlModule::produce_Link( Xml::Element
& o_row
,
243 const client
* i_ce
) const
245 csv_assert(i_ce
!= 0);
248 >> *new Html::TableCell
249 << new Html::ClassAttr(C_sCellStyle_SummaryLeft
);
251 if ( NOT
ary::is_type
<ary::idl::Module
>(*i_ce
) )
254 aText(Env(), rCell
, true);
255 aText
.Produce_byData(i_ce
->CeId());
259 StreamLock
slBuf(100);
261 >> *new Html::Link( slBuf() << i_ce
->LocalName()
264 << i_ce
->LocalName();
269 HF_IdlModule::produce_LinkDoc( Xml::Element
& o_row
,
270 const client
* i_ce
) const
272 csv_assert(i_ce
!= 0);
274 // We need the cell in any case, because, the rendering may be hurt else.
277 >> *new Html::TableCell
278 << new Html::ClassAttr(C_sCellStyle_SummaryRight
);
283 pShort
= Get_IdlDocu(rCe
.Docu());
288 if (pShort
->IsDeprecated())
290 rCell
<< "[ DEPRECATED ]" << new Html::LineBreak
;
292 if (pShort
->IsOptional())
294 rCell
<< "[ OPTIONAL ]" << new Html::LineBreak
;
297 HF_IdlDocuTextDisplay
298 aShortDisplay(Env(), &rCell
, *i_ce
);
299 pShort
->Short().DisplayAt(aShortDisplay
);
302 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */