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_siservice.hxx"
24
25
26 // NOT FULLY DEFINED SERVICES
27 #include <ary/idl/i_ce.hxx>
28 #include <ary/idl/ik_function.hxx>
29 #include <ary/idl/ik_siservice.hxx>
30 #include <ary/doc/d_oldidldocu.hxx>
31 #include <toolkit/hf_docentry.hxx>
32 #include <toolkit/hf_linachain.hxx>
33 #include <toolkit/hf_navi_sub.hxx>
34 #include <toolkit/hf_title.hxx>
35 #include "hfi_doc.hxx"
36 #include "hfi_method.hxx"
37 #include "hfi_navibar.hxx"
38 #include "hfi_typetext.hxx"
39 #include "hi_env.hxx"
40 #include "hi_linkhelper.hxx"
41
42
43
44 namespace
45 {
46
47 const String
48 C_sImplementedInterface("Supported Interface");
49
50 const String
51 C_sList_Constructors("Constructors' Summary");
52 const String
53 C_sList_Constructors_Label("ConstructorsSummary");
54 const String
55 C_sDetails_Constructors("Constructors' Details");
56 const String
57 C_sDetails_Constructors_Label("ConstructorsDetails");
58
59
60 enum E_SubListIndices
61 {
62 sli_ConstructorsSummary = 0,
63 sli_ConstructorsDetails = 1
64 };
65
66 } //anonymous namespace
67
68
HF_IdlSglIfcService(Environment & io_rEnv,Xml::Element & o_rOut)69 HF_IdlSglIfcService::HF_IdlSglIfcService( Environment & io_rEnv,
70 Xml::Element & o_rOut )
71 : HtmlFactory_Idl(io_rEnv, &o_rOut)
72 {
73 }
74
~HF_IdlSglIfcService()75 HF_IdlSglIfcService::~HF_IdlSglIfcService()
76 {
77 }
78
79 typedef ::ary::idl::ifc_sglifcservice::attr SglIfcServiceAttr;
80
81 void
Produce_byData(const client & i_ce) const82 HF_IdlSglIfcService::Produce_byData( const client & i_ce ) const
83 {
84 Dyn<HF_NaviSubRow>
85 pNaviSubRow( &make_Navibar(i_ce) );
86
87 HF_TitleTable
88 aTitle(CurOut());
89 HF_LinkedNameChain
90 aNameChain(aTitle.Add_Row());
91
92 aNameChain.Produce_CompleteChain(Env().CurPosition(), nameChainLinker);
93 produce_Title(aTitle, C_sCePrefix_Service, i_ce);
94
95 HF_DocEntryList
96 aTopList( aTitle.Add_Row() );
97 aTopList.Produce_Term(C_sImplementedInterface);
98
99 HF_IdlTypeText
100 aImplementedInterface( Env(), aTopList.Produce_Definition(), true, &i_ce);
101 aImplementedInterface.Produce_byData( SglIfcServiceAttr::BaseInterface(i_ce) );
102
103 CurOut() << new Html::HorizontalLine;
104
105 write_Docu(aTitle.Add_Row(), i_ce);
106 CurOut() << new Html::HorizontalLine();
107
108 dyn_ce_list
109 dpConstructors;
110 SglIfcServiceAttr::Get_Constructors(dpConstructors, i_ce);
111 if ( (*dpConstructors).operator bool() )
112 {
113 produce_Members( *dpConstructors,
114 C_sList_Constructors,
115 C_sList_Constructors_Label,
116 C_sDetails_Constructors,
117 C_sDetails_Constructors_Label );
118 pNaviSubRow->SwitchOn(sli_ConstructorsSummary);
119 pNaviSubRow->SwitchOn(sli_ConstructorsDetails);
120 }
121
122 pNaviSubRow->Produce_Row();
123 CurOut() << new Xml::XmlCode("<br> ");
124 }
125
126 DYN HF_NaviSubRow &
make_Navibar(const client & i_ce) const127 HF_IdlSglIfcService::make_Navibar( const client & i_ce ) const
128 {
129 HF_IdlNavigationBar
130 aNaviBar(Env(), CurOut());
131 aNaviBar.Produce_CeMainRow(i_ce, true);
132
133 DYN HF_NaviSubRow &
134 ret = aNaviBar.Add_SubRow();
135 ret.AddItem(C_sList_Constructors, C_sList_Constructors_Label, false);
136 ret.AddItem(C_sDetails_Constructors, C_sDetails_Constructors_Label, false);
137
138 CurOut() << new Html::HorizontalLine();
139 return ret;
140 }
141
142 typedef ary::idl::ifc_function::attr funcAttr;
143
144 void
produce_MemberDetails(HF_SubTitleTable & o_table,const client & i_ce) const145 HF_IdlSglIfcService::produce_MemberDetails( HF_SubTitleTable & o_table,
146 const client & i_ce ) const
147 {
148 HF_IdlMethod
149 aConstructor( Env(),
150 o_table.Add_Row()
151 >> *new Html::TableCell
152 << new Html::ClassAttr(C_sCellStyle_MDetail) );
153
154 ary::Dyn_StdConstIterator<ary::idl::Parameter>
155 pParameters;
156 funcAttr::Get_Parameters(pParameters, i_ce);
157
158 ary::Dyn_StdConstIterator<ary::idl::Type_id>
159 pExceptions;
160 funcAttr::Get_Exceptions(pExceptions, i_ce);
161
162 aConstructor.Produce_byData( i_ce.LocalName(),
163 funcAttr::ReturnType(i_ce),
164 *pParameters,
165 *pExceptions,
166 funcAttr::IsOneway(i_ce),
167 funcAttr::HasEllipse(i_ce),
168 i_ce );
169 }
170