1*d291ea28SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*d291ea28SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*d291ea28SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*d291ea28SAndrew Rist  * distributed with this work for additional information
6*d291ea28SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*d291ea28SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*d291ea28SAndrew Rist  * "License"); you may not use this file except in compliance
9*d291ea28SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*d291ea28SAndrew Rist  *
11*d291ea28SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*d291ea28SAndrew Rist  *
13*d291ea28SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*d291ea28SAndrew Rist  * software distributed under the License is distributed on an
15*d291ea28SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d291ea28SAndrew Rist  * KIND, either express or implied.  See the License for the
17*d291ea28SAndrew Rist  * specific language governing permissions and limitations
18*d291ea28SAndrew Rist  * under the License.
19*d291ea28SAndrew Rist  *
20*d291ea28SAndrew Rist  *************************************************************/
21cdf0e10cSrcweir 
22cdf0e10cSrcweir #include <precomp.h>
23cdf0e10cSrcweir #include "hfi_enum.hxx"
24cdf0e10cSrcweir 
25cdf0e10cSrcweir 
26cdf0e10cSrcweir // NOT FULLY DEFINED SERVICES
27cdf0e10cSrcweir #include <ary/idl/i_ce.hxx>
28cdf0e10cSrcweir #include <ary/idl/ik_enum.hxx>
29cdf0e10cSrcweir #include <toolkit/hf_linachain.hxx>
30cdf0e10cSrcweir #include <toolkit/hf_navi_sub.hxx>
31cdf0e10cSrcweir #include <toolkit/hf_title.hxx>
32cdf0e10cSrcweir #include "hfi_navibar.hxx"
33cdf0e10cSrcweir #include "hfi_property.hxx"
34cdf0e10cSrcweir #include "hi_linkhelper.hxx"
35cdf0e10cSrcweir 
36cdf0e10cSrcweir 
37cdf0e10cSrcweir extern const String
38cdf0e10cSrcweir     C_sCePrefix_Enum("enum");
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace
41cdf0e10cSrcweir {
42cdf0e10cSrcweir 
43cdf0e10cSrcweir const String
44cdf0e10cSrcweir     C_sList_Values("Values");
45cdf0e10cSrcweir const String
46cdf0e10cSrcweir     C_sList_Values_Label("Values");
47cdf0e10cSrcweir const String
48cdf0e10cSrcweir     C_sList_ValueDetails("Values' Details");
49cdf0e10cSrcweir const String
50cdf0e10cSrcweir     C_sList_ValueDetails_Label("ValueDetails");
51cdf0e10cSrcweir 
52cdf0e10cSrcweir enum E_SubListIndices
53cdf0e10cSrcweir {
54cdf0e10cSrcweir     sli_ValuesSummary = 0,
55cdf0e10cSrcweir     sli_ValueDetails = 1
56cdf0e10cSrcweir };
57cdf0e10cSrcweir 
58cdf0e10cSrcweir }   // anonymous namespace
59cdf0e10cSrcweir 
HF_IdlEnum(Environment & io_rEnv,Xml::Element & o_rOut)60cdf0e10cSrcweir HF_IdlEnum::HF_IdlEnum( Environment &       io_rEnv,
61cdf0e10cSrcweir                         Xml::Element &      o_rOut )
62cdf0e10cSrcweir     :   HtmlFactory_Idl(io_rEnv, &o_rOut)
63cdf0e10cSrcweir {
64cdf0e10cSrcweir }
65cdf0e10cSrcweir 
~HF_IdlEnum()66cdf0e10cSrcweir HF_IdlEnum::~HF_IdlEnum()
67cdf0e10cSrcweir {
68cdf0e10cSrcweir }
69cdf0e10cSrcweir 
70cdf0e10cSrcweir void
Produce_byData(const client & i_ce) const71cdf0e10cSrcweir HF_IdlEnum::Produce_byData( const client & i_ce ) const
72cdf0e10cSrcweir {
73cdf0e10cSrcweir     Dyn<HF_NaviSubRow>
74cdf0e10cSrcweir         pNaviSubRow( &make_Navibar(i_ce) );
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     HF_TitleTable
77cdf0e10cSrcweir         aTitle(CurOut());
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     HF_LinkedNameChain
80cdf0e10cSrcweir         aNameChain(aTitle.Add_Row());
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     aNameChain.Produce_CompleteChain(Env().CurPosition(), nameChainLinker);
83cdf0e10cSrcweir     produce_Title(aTitle, C_sCePrefix_Enum, i_ce);
84cdf0e10cSrcweir 
85cdf0e10cSrcweir     write_Docu(aTitle.Add_Row(), i_ce);
86cdf0e10cSrcweir     CurOut() << new Html::HorizontalLine();
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     dyn_ce_list
89cdf0e10cSrcweir         dpValues;
90cdf0e10cSrcweir     ary::idl::ifc_enum::attr::Get_Values(dpValues, i_ce);
91cdf0e10cSrcweir     if ( (*dpValues).operator bool() )
92cdf0e10cSrcweir     {
93cdf0e10cSrcweir         produce_Members( *dpValues,
94cdf0e10cSrcweir                          C_sList_Values,
95cdf0e10cSrcweir                          C_sList_Values_Label,
96cdf0e10cSrcweir                          C_sList_ValueDetails,
97cdf0e10cSrcweir                          C_sList_ValueDetails_Label );
98cdf0e10cSrcweir         pNaviSubRow->SwitchOn(sli_ValuesSummary);
99cdf0e10cSrcweir         pNaviSubRow->SwitchOn(sli_ValueDetails);
100cdf0e10cSrcweir     }
101cdf0e10cSrcweir     pNaviSubRow->Produce_Row();
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir HF_NaviSubRow &
make_Navibar(const client & i_ce) const105cdf0e10cSrcweir HF_IdlEnum::make_Navibar( const client & i_ce ) const
106cdf0e10cSrcweir {
107cdf0e10cSrcweir     HF_IdlNavigationBar
108cdf0e10cSrcweir         aNaviBar(Env(), CurOut());
109cdf0e10cSrcweir     aNaviBar.Produce_CeMainRow(i_ce);
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     DYN HF_NaviSubRow &
112cdf0e10cSrcweir         ret = aNaviBar.Add_SubRow();
113cdf0e10cSrcweir     ret.AddItem(C_sList_Values, C_sList_Values_Label, false);
114cdf0e10cSrcweir     ret.AddItem(C_sList_ValueDetails, C_sList_ValueDetails_Label, false);
115cdf0e10cSrcweir 
116cdf0e10cSrcweir     CurOut() << new Html::HorizontalLine();
117cdf0e10cSrcweir     return ret;
118cdf0e10cSrcweir }
119cdf0e10cSrcweir 
120cdf0e10cSrcweir void
produce_MemberDetails(HF_SubTitleTable & o_table,const client & i_ce) const121cdf0e10cSrcweir HF_IdlEnum::produce_MemberDetails( HF_SubTitleTable &  o_table,
122cdf0e10cSrcweir                                    const client &      i_ce) const
123cdf0e10cSrcweir {
124cdf0e10cSrcweir     HF_IdlEnumValue
125cdf0e10cSrcweir         aElement( Env(), o_table );
126cdf0e10cSrcweir     aElement.Produce_byData(i_ce);
127cdf0e10cSrcweir }
128