1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "hfi_module.hxx"
24 // NOT FULLY DEFINED SERVICES
25 #include <ary/idl/i_ce.hxx>
26 #include <ary/idl/i_module.hxx>
27 #include <ary/idl/ik_module.hxx>
28 #include <ary/doc/d_oldidldocu.hxx>
29 #include <ary/getncast.hxx>
30 #include <toolkit/hf_docentry.hxx>
31 #include <toolkit/hf_linachain.hxx>
32 #include <toolkit/hf_navi_sub.hxx>
33 #include <toolkit/hf_title.hxx>
34 #include "hfi_doc.hxx"
35 #include "hfi_navibar.hxx"
36 #include "hfi_tag.hxx"
37 #include "hfi_typetext.hxx"
38 #include "hi_linkhelper.hxx"
42 C_sCePrefix_Module("module");
48 C_sList_NestedModules("Nested Modules");
50 C_sList_NestedModules_Label("NestedModules");
52 C_sList_Services("Services");
54 C_sList_Singletons("Singletons");
56 C_sList_Interfaces("Interfaces");
58 C_sList_Structs("Structs");
60 C_sList_Exceptions("Exceptions");
62 C_sList_Enums("Enums");
64 C_sList_Typedefs("Typedefs");
66 C_sList_ConstGroups("Constant Groups");
68 C_sList_ConstGroups_Label("ConstantGroups");
72 { // In case of changes, also adapt make_Navibar() !!
73 sli_NestedModules
= 0,
84 } //anonymous namespace
87 HF_IdlModule::HF_IdlModule( Environment
& io_rEnv
,
88 Xml::Element
& o_rOut
)
89 : HtmlFactory_Idl(io_rEnv
, &o_rOut
)
93 HF_IdlModule::~HF_IdlModule()
97 typedef ary::idl::ifc_module::attr ModuleAttr
;
101 HF_IdlModule::Produce_byData( const client
& i_ce
) const
104 pNaviSubRow( &make_Navibar(i_ce
) );
109 aNameChain(aTitle
.Add_Row());
111 if ( Env().CurPosition().Depth() > 0 )
113 aNameChain
.Produce_CompleteChain_forModule(Env().CurPosition(), nameChainLinker
);
117 aTitle
.Produce_Title( sl()
118 << C_sCePrefix_Module
125 aTitle
.Produce_Title( "Global Module" );
128 write_Docu(aTitle
.Add_Row(), i_ce
);
129 CurOut() << new Html::HorizontalLine();
132 // Write children lists:
133 ce_ptr_list aNestedModules
;
134 ce_ptr_list aServices
;
135 ce_ptr_list aInterfaces
;
136 ce_ptr_list aStructs
;
137 ce_ptr_list aExceptions
;
139 ce_ptr_list aTypedefs
;
140 ce_ptr_list aConstantGroups
;
141 ce_ptr_list aSingletons
;
143 ModuleAttr::Get_AllChildrenSeparated(
156 // Has this to be in the order of enum E_SubListIndices ???
157 if (produce_ChildList(C_sList_NestedModules
, C_sList_NestedModules_Label
, aNestedModules
))
158 pNaviSubRow
->SwitchOn(sli_NestedModules
);
159 if (produce_ChildList(C_sList_Services
, C_sList_Services
, aServices
))
160 pNaviSubRow
->SwitchOn(sli_Services
);
161 if (produce_ChildList(C_sList_Singletons
, C_sList_Singletons
, aSingletons
))
162 pNaviSubRow
->SwitchOn(sli_Singletons
);
163 if (produce_ChildList(C_sList_Interfaces
, C_sList_Interfaces
, aInterfaces
))
164 pNaviSubRow
->SwitchOn(sli_Interfaces
);
165 if (produce_ChildList(C_sList_Structs
, C_sList_Structs
, aStructs
))
166 pNaviSubRow
->SwitchOn(sli_Structs
);
167 if (produce_ChildList(C_sList_Exceptions
, C_sList_Exceptions
, aExceptions
))
168 pNaviSubRow
->SwitchOn(sli_Exceptions
);
169 if (produce_ChildList(C_sList_Enums
, C_sList_Enums
, aEnums
))
170 pNaviSubRow
->SwitchOn(sli_Enums
);
171 if (produce_ChildList(C_sList_Typedefs
, C_sList_Typedefs
, aTypedefs
))
172 pNaviSubRow
->SwitchOn(sli_Typedefs
);
173 if (produce_ChildList(C_sList_ConstGroups
, C_sList_ConstGroups_Label
, aConstantGroups
))
174 pNaviSubRow
->SwitchOn(sli_ConstGroups
);
175 pNaviSubRow
->Produce_Row();
179 HF_IdlModule::make_Navibar( const client
& i_ce
) const
182 aNaviBar(Env(), CurOut());
183 aNaviBar
.Produce_ModuleMainRow(i_ce
);
186 ret
= aNaviBar
.Add_SubRow();
188 // Has to be in the order of E_SubListIndices:
189 ret
.AddItem(C_sList_NestedModules
, C_sList_NestedModules_Label
, false);
190 ret
.AddItem(C_sList_Services
, C_sList_Services
, false);
191 ret
.AddItem(C_sList_Singletons
, C_sList_Singletons
, false);
192 ret
.AddItem(C_sList_Interfaces
, C_sList_Interfaces
, false);
193 ret
.AddItem(C_sList_Structs
, C_sList_Structs
, false);
194 ret
.AddItem(C_sList_Exceptions
, C_sList_Exceptions
, false);
195 ret
.AddItem(C_sList_Enums
, C_sList_Enums
, false);
196 ret
.AddItem(C_sList_Typedefs
, C_sList_Typedefs
, false);
197 ret
.AddItem(C_sList_ConstGroups
, C_sList_ConstGroups_Label
, false);
199 CurOut() << new Html::HorizontalLine();
204 HF_IdlModule::produce_ChildList( const String
& i_sName
,
205 const String
& i_sLabel
,
206 const ce_ptr_list
& i_list
) const
208 if ( i_list
.empty() )
217 ce_ptr_list::const_iterator
218 itEnd
= i_list
.end();
219 for ( ce_ptr_list::const_iterator it
= i_list
.begin();
224 rRow
= aTable
.Add_Row();
225 produce_Link(rRow
, *it
);
226 produce_LinkDoc(rRow
, *it
);
233 HF_IdlModule::produce_Link( Xml::Element
& o_row
,
234 const client
* i_ce
) const
236 csv_assert(i_ce
!= 0);
239 >> *new Html::TableCell
240 << new Html::ClassAttr(C_sCellStyle_SummaryLeft
);
242 if ( NOT
ary::is_type
<ary::idl::Module
>(*i_ce
) )
246 aText
.Produce_byData(i_ce
->CeId());
250 StreamLock
slBuf(100);
252 >> *new Html::Link( slBuf() << i_ce
->LocalName()
255 << i_ce
->LocalName();
260 HF_IdlModule::produce_LinkDoc( Xml::Element
& o_row
,
261 const client
* i_ce
) const
263 csv_assert(i_ce
!= 0);
265 // We need the cell in any case, because, the rendering may be hurt else.
268 >> *new Html::TableCell
269 << new Html::ClassAttr(C_sCellStyle_SummaryRight
);
274 pShort
= Get_IdlDocu(rCe
.Docu());
279 if (pShort
->IsDeprecated())
281 rCell
<< "[ DEPRECATED ]" << new Html::LineBreak
;
283 if (pShort
->IsOptional())
285 rCell
<< "[ OPTIONAL ]" << new Html::LineBreak
;
288 HF_IdlDocuTextDisplay
289 aShortDisplay(Env(), &rCell
, *i_ce
);
290 pShort
->Short().DisplayAt(aShortDisplay
);
293 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */