fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / autodoc / source / display / idl / hfi_struct.cxx
blobeb7bf90bbf9cd61f94cb9a2f048cffa7ae066857
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include <precomp.h>
21 #include "hfi_struct.hxx"
24 // NOT FULLY DEFINED SERVICES
25 #include <ary/idl/i_ce.hxx>
26 #include <ary/idl/i_struct.hxx>
27 #include <ary/idl/ik_exception.hxx>
28 #include <ary/idl/ik_struct.hxx>
29 #include <toolkit/hf_docentry.hxx>
30 #include <toolkit/hf_linachain.hxx>
31 #include <toolkit/hf_navi_sub.hxx>
32 #include <toolkit/hf_title.hxx>
33 #include "hfi_navibar.hxx"
34 #include "hfi_property.hxx"
35 #include "hfi_typetext.hxx"
36 #include "hi_linkhelper.hxx"
39 extern const String
40 C_sCePrefix_Struct("struct");
41 extern const String
42 C_sCePrefix_Exception("exception");
45 namespace
48 const String
49 C_sBaseStruct("Base Hierarchy");
50 const String
51 C_sBaseException("Base Hierarchy");
53 const String
54 C_sList_Elements("Elements' Summary");
55 const String
56 C_sList_Elements_Label("Elements");
58 const String
59 C_sList_ElementDetails("Elements' Details");
60 const String
61 C_sList_ElementDetails_Label("ElementDetails");
63 enum E_SubListIndices
65 sli_ElementsSummary = 0,
66 sli_ElementsDetails = 1
69 } // anonymous namespace
73 HF_IdlStruct::HF_IdlStruct( Environment & io_rEnv,
74 Xml::Element & o_rOut,
75 bool i_bIsException )
76 : HtmlFactory_Idl(io_rEnv, &o_rOut),
77 bIsException(i_bIsException)
81 HF_IdlStruct::~HF_IdlStruct()
85 void
86 HF_IdlStruct::Produce_byData( const client & i_ce ) const
88 const ary::idl::Struct *
89 pStruct =
90 bIsException
91 ? 0
92 : static_cast< const ary::idl::Struct* >(&i_ce);
93 bool bIsTemplate =
94 pStruct != 0
95 ? pStruct->TemplateParameterType().IsValid()
96 : false;
98 Dyn<HF_NaviSubRow>
99 pNaviSubRow( &make_Navibar(i_ce) );
101 HF_TitleTable
102 aTitle(CurOut());
103 HF_LinkedNameChain
104 aNameChain(aTitle.Add_Row());
106 aNameChain.Produce_CompleteChain(Env().CurPosition(), nameChainLinker);
108 // Title:
109 StreamLock
110 slAnnotations(200);
111 get_Annotations(slAnnotations(), i_ce);
113 StreamLock rTitle(200);
114 if (bIsTemplate)
115 rTitle() << "template ";
116 rTitle()
117 << (bIsException
118 ? C_sCePrefix_Exception
119 : C_sCePrefix_Struct)
120 << " "
121 << i_ce.LocalName();
122 if (bIsTemplate)
124 csv_assert(pStruct != 0);
125 rTitle()
126 << "<"
127 << pStruct->TemplateParameter()
128 << ">";
130 aTitle.Produce_Title(slAnnotations().c_str(), rTitle().c_str());
132 // Bases:
133 produce_Bases( aTitle.Add_Row(),
134 i_ce,
135 bIsException
136 ? C_sBaseException
137 : C_sBaseStruct );
139 // Docu:
140 write_Docu(aTitle.Add_Row(), i_ce);
141 CurOut() << new Html::HorizontalLine();
143 // Elements:
144 dyn_ce_list
145 dpElements;
146 if (bIsException)
147 ary::idl::ifc_exception::attr::Get_Elements(dpElements, i_ce);
148 else
149 ary::idl::ifc_struct::attr::Get_Elements(dpElements, i_ce);
151 if ( (*dpElements).operator bool() )
153 produce_Members( *dpElements,
154 C_sList_Elements,
155 C_sList_Elements_Label,
156 C_sList_ElementDetails,
157 C_sList_ElementDetails_Label );
158 pNaviSubRow->SwitchOn(sli_ElementsSummary);
159 pNaviSubRow->SwitchOn(sli_ElementsDetails);
161 pNaviSubRow->Produce_Row();
164 HtmlFactory_Idl::type_id
165 HF_IdlStruct::inq_BaseOf( const client & i_ce ) const
167 return bIsException
168 ? ary::idl::ifc_exception::attr::Base(i_ce)
169 : ary::idl::ifc_struct::attr::Base(i_ce);
172 HF_NaviSubRow &
173 HF_IdlStruct::make_Navibar( const client & i_ce ) const
175 HF_IdlNavigationBar
176 aNaviBar(Env(), CurOut());
177 aNaviBar.Produce_CeMainRow(i_ce);
179 DYN HF_NaviSubRow &
180 ret = aNaviBar.Add_SubRow();
181 ret.AddItem(C_sList_Elements, C_sList_Elements_Label, false);
182 ret.AddItem(C_sList_ElementDetails, C_sList_ElementDetails_Label, false);
184 CurOut() << new Html::HorizontalLine();
185 return ret;
188 void
189 HF_IdlStruct::produce_MemberDetails( HF_SubTitleTable & o_table,
190 const client & i_ce) const
192 HF_IdlStructElement
193 aElement( Env(), o_table );
194 aElement.Produce_byData(i_ce);
197 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */