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