merge the formfield patch from ooo-build
[ooovba.git] / autodoc / source / display / idl / hfi_enum.cxx
blobe1faab5037c800d1789a3799e487dbb6dcf545ef
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hfi_enum.cxx,v $
10 * $Revision: 1.8 $
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 ************************************************************************/
31 #include <precomp.h>
32 #include "hfi_enum.hxx"
35 // NOT FULLY DEFINED SERVICES
36 #include <ary/idl/i_ce.hxx>
37 #include <ary/idl/ik_enum.hxx>
38 #include <toolkit/hf_linachain.hxx>
39 #include <toolkit/hf_navi_sub.hxx>
40 #include <toolkit/hf_title.hxx>
41 #include "hfi_navibar.hxx"
42 #include "hfi_property.hxx"
43 #include "hi_linkhelper.hxx"
46 extern const String
47 C_sCePrefix_Enum("enum");
49 namespace
52 const String
53 C_sList_Values("Values");
54 const String
55 C_sList_Values_Label("Values");
56 const String
57 C_sList_ValueDetails("Values' Details");
58 const String
59 C_sList_ValueDetails_Label("ValueDetails");
61 enum E_SubListIndices
63 sli_ValuesSummary = 0,
64 sli_ValueDetails = 1
67 } // anonymous namespace
69 HF_IdlEnum::HF_IdlEnum( Environment & io_rEnv,
70 Xml::Element & o_rOut )
71 : HtmlFactory_Idl(io_rEnv, &o_rOut)
75 HF_IdlEnum::~HF_IdlEnum()
79 void
80 HF_IdlEnum::Produce_byData( const client & i_ce ) const
82 Dyn<HF_NaviSubRow>
83 pNaviSubRow( &make_Navibar(i_ce) );
85 HF_TitleTable
86 aTitle(CurOut());
88 HF_LinkedNameChain
89 aNameChain(aTitle.Add_Row());
91 aNameChain.Produce_CompleteChain(Env().CurPosition(), nameChainLinker);
92 produce_Title(aTitle, C_sCePrefix_Enum, i_ce);
94 write_Docu(aTitle.Add_Row(), i_ce);
95 CurOut() << new Html::HorizontalLine();
97 dyn_ce_list
98 dpValues;
99 ary::idl::ifc_enum::attr::Get_Values(dpValues, i_ce);
100 if ( (*dpValues).operator bool() )
102 produce_Members( *dpValues,
103 C_sList_Values,
104 C_sList_Values_Label,
105 C_sList_ValueDetails,
106 C_sList_ValueDetails_Label );
107 pNaviSubRow->SwitchOn(sli_ValuesSummary);
108 pNaviSubRow->SwitchOn(sli_ValueDetails);
110 pNaviSubRow->Produce_Row();
113 HF_NaviSubRow &
114 HF_IdlEnum::make_Navibar( const client & i_ce ) const
116 HF_IdlNavigationBar
117 aNaviBar(Env(), CurOut());
118 aNaviBar.Produce_CeMainRow(i_ce);
120 DYN HF_NaviSubRow &
121 ret = aNaviBar.Add_SubRow();
122 ret.AddItem(C_sList_Values, C_sList_Values_Label, false);
123 ret.AddItem(C_sList_ValueDetails, C_sList_ValueDetails_Label, false);
125 CurOut() << new Html::HorizontalLine();
126 return ret;
129 void
130 HF_IdlEnum::produce_MemberDetails( HF_SubTitleTable & o_table,
131 const client & i_ce) const
133 HF_IdlEnumValue
134 aElement( Env(), o_table );
135 aElement.Produce_byData(i_ce);