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_struct.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_struct.hxx"
35 // NOT FULLY DEFINED SERVICES
36 #include <ary/idl/i_ce.hxx>
37 #include <ary/idl/i_struct.hxx>
38 #include <ary/idl/ik_exception.hxx>
39 #include <ary/idl/ik_struct.hxx>
40 #include <toolkit/hf_docentry.hxx>
41 #include <toolkit/hf_linachain.hxx>
42 #include <toolkit/hf_navi_sub.hxx>
43 #include <toolkit/hf_title.hxx>
44 #include "hfi_navibar.hxx"
45 #include "hfi_property.hxx"
46 #include "hfi_typetext.hxx"
47 #include "hi_linkhelper.hxx"
51 C_sCePrefix_Struct("struct");
53 C_sCePrefix_Exception("exception");
60 C_sBaseStruct("Base Hierarchy");
62 C_sBaseException("Base Hierarchy");
65 C_sList_Elements("Elements' Summary");
67 C_sList_Elements_Label("Elements");
70 C_sList_ElementDetails("Elements' Details");
72 C_sList_ElementDetails_Label("ElementDetails");
76 sli_ElementsSummary
= 0,
77 sli_ElementsDetails
= 1
80 } // anonymous namespace
84 HF_IdlStruct::HF_IdlStruct( Environment
& io_rEnv
,
85 Xml::Element
& o_rOut
,
87 : HtmlFactory_Idl(io_rEnv
, &o_rOut
),
88 bIsException(i_bIsException
)
92 HF_IdlStruct::~HF_IdlStruct()
97 HF_IdlStruct::Produce_byData( const client
& i_ce
) const
99 const ary::idl::Struct
*
103 : static_cast< const ary::idl::Struct
* >(&i_ce
);
106 ? pStruct
->TemplateParameterType().IsValid()
110 pNaviSubRow( &make_Navibar(i_ce
) );
115 aNameChain(aTitle
.Add_Row());
117 aNameChain
.Produce_CompleteChain(Env().CurPosition(), nameChainLinker
);
122 get_Annotations(slAnnotations(), i_ce
);
124 StreamLock
rTitle(200);
126 rTitle() << "template ";
129 ? C_sCePrefix_Exception
130 : C_sCePrefix_Struct
)
135 csv_assert(pStruct
!= 0);
138 << pStruct
->TemplateParameter()
141 aTitle
.Produce_Title(slAnnotations().c_str(), rTitle().c_str());
144 produce_Bases( aTitle
.Add_Row(),
151 write_Docu(aTitle
.Add_Row(), i_ce
);
152 CurOut() << new Html::HorizontalLine();
158 ary::idl::ifc_exception::attr::Get_Elements(dpElements
, i_ce
);
160 ary::idl::ifc_struct::attr::Get_Elements(dpElements
, i_ce
);
162 if ( (*dpElements
).operator bool() )
164 produce_Members( *dpElements
,
166 C_sList_Elements_Label
,
167 C_sList_ElementDetails
,
168 C_sList_ElementDetails_Label
);
169 pNaviSubRow
->SwitchOn(sli_ElementsSummary
);
170 pNaviSubRow
->SwitchOn(sli_ElementsDetails
);
172 pNaviSubRow
->Produce_Row();
175 HtmlFactory_Idl::type_id
176 HF_IdlStruct::inq_BaseOf( const client
& i_ce
) const
179 ? ary::idl::ifc_exception::attr::Base(i_ce
)
180 : ary::idl::ifc_struct::attr::Base(i_ce
);
184 HF_IdlStruct::make_Navibar( const client
& i_ce
) const
187 aNaviBar(Env(), CurOut());
188 aNaviBar
.Produce_CeMainRow(i_ce
);
191 ret
= aNaviBar
.Add_SubRow();
192 ret
.AddItem(C_sList_Elements
, C_sList_Elements_Label
, false);
193 ret
.AddItem(C_sList_ElementDetails
, C_sList_ElementDetails_Label
, false);
195 CurOut() << new Html::HorizontalLine();
200 HF_IdlStruct::produce_MemberDetails( HF_SubTitleTable
& o_table
,
201 const client
& i_ce
) const
204 aElement( Env(), o_table
);
205 aElement
.Produce_byData(i_ce
);