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_singleton.hxx"
24 
25 
26 // NOT FULLY DEFINED SERVICES
27 #include <ary/idl/i_ce.hxx>
28 #include <ary/idl/ik_singleton.hxx>
29 #include <ary/idl/ik_sisingleton.hxx>
30 #include <toolkit/hf_docentry.hxx>
31 #include <toolkit/hf_linachain.hxx>
32 #include <toolkit/hf_title.hxx>
33 #include "hfi_navibar.hxx"
34 #include "hfi_typetext.hxx"
35 #include "hi_linkhelper.hxx"
36 
37 
38 
39 extern const String
40     C_sCePrefix_Singleton("singleton");
41 
42 const String
43     C_sAssociatedService("Associated Service");
44 const String
45     C_sImplementedInterface("Supported Interface");
46 
47 
48 
HF_IdlSingleton(Environment & io_rEnv,Xml::Element & o_rOut)49 HF_IdlSingleton::HF_IdlSingleton( Environment &         io_rEnv,
50                                   Xml::Element &        o_rOut )
51     :   HtmlFactory_Idl(io_rEnv, &o_rOut)
52 {
53 }
54 
~HF_IdlSingleton()55 HF_IdlSingleton::~HF_IdlSingleton()
56 {
57 
58 }
59 
60 typedef ::ary::idl::ifc_singleton::attr         SingletonAttr;
61 typedef ::ary::idl::ifc_sglifcsingleton::attr   SglIfcSingletonAttr;
62 
63 void
Produce_byData_ServiceBased(const client & i_ce) const64 HF_IdlSingleton::Produce_byData_ServiceBased( const client & i_ce ) const
65 {
66     make_Navibar(i_ce);
67 
68     HF_TitleTable
69         aTitle(CurOut());
70 
71     HF_LinkedNameChain
72         aNameChain(aTitle.Add_Row());
73 
74     aNameChain.Produce_CompleteChain(Env().CurPosition(), nameChainLinker);
75     produce_Title(aTitle, C_sCePrefix_Singleton, i_ce);
76 
77     HF_DocEntryList
78         aTopList( aTitle.Add_Row() );
79     aTopList.Produce_Term(C_sAssociatedService);
80 
81     HF_IdlTypeText
82         aAssociatedService( Env(), aTopList.Produce_Definition(), true );
83     aAssociatedService.Produce_byData( SingletonAttr::AssociatedService(i_ce) );
84 
85     CurOut() << new Html::HorizontalLine;
86 
87     write_Docu(aTitle.Add_Row(), i_ce);
88     CurOut() << new Html::HorizontalLine();
89 }
90 
91 void
Produce_byData_InterfaceBased(const client & i_ce) const92 HF_IdlSingleton::Produce_byData_InterfaceBased( const client & i_ce ) const
93 {
94     make_Navibar(i_ce);
95 
96     HF_TitleTable
97         aTitle(CurOut());
98 
99     HF_LinkedNameChain
100         aNameChain(aTitle.Add_Row());
101 
102     aNameChain.Produce_CompleteChain(Env().CurPosition(), nameChainLinker);
103     produce_Title(aTitle, C_sCePrefix_Singleton, i_ce);
104 
105     HF_DocEntryList
106         aTopList( aTitle.Add_Row() );
107     aTopList.Produce_Term(C_sImplementedInterface);
108 
109     HF_IdlTypeText
110         aImplementedInterface( Env(), aTopList.Produce_Definition(), true );
111     aImplementedInterface.Produce_byData( SglIfcSingletonAttr::BaseInterface(i_ce) );
112 
113     CurOut() << new Html::HorizontalLine;
114 
115     write_Docu(aTitle.Add_Row(), i_ce);
116     CurOut() << new Html::HorizontalLine();
117 }
118 
119 void
make_Navibar(const client & i_ce) const120 HF_IdlSingleton::make_Navibar( const client & i_ce ) const
121 {
122     HF_IdlNavigationBar
123         aNaviBar(Env(), CurOut());
124     aNaviBar.Produce_CeMainRow(i_ce,true);  // true := avoid link to Use-page.
125 
126     CurOut() << new Html::HorizontalLine();
127 }
128