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 
23 
24 #ifndef ADC_DISPLAY_HTML_KIT_HXX
25 #define ADC_DISPLAY_HTML_KIT_HXX
26 
27 // BASE CLASSES
28 #include <udm/xml/xmlitem.hxx>
29 #include <udm/html/htmlitem.hxx>
30 // USED SERVICES
31 #include <ary/cpp/c_types4cpp.hxx>
32 
33 namespace ary
34 {
35     namespace cpp
36     {
37         struct S_TplParam;
38         class OperationSignature;
39         class Gate;
40     }
41 }
42 
43 
44 
45 
46 namespace adcdisp
47 {
48 
49 typedef csi::xml::Element XmlElement;
50 
51 class PageTitle_Left
52 {
53   public:
54     void                operator()(
55                             XmlElement &        o_rOwner,
56                             const char *        i_sTypeTitle,
57                             const String  &     i_sLocalName );
58 };
59 
60 class PageTitle_Std
61 {
62   public:
63     void                operator()(
64                             XmlElement &        o_rOwner,
65                             const char *        i_sTypeTitle,
66                             const String  &     i_sLocalName );
67     XmlElement &        operator()(
68                             XmlElement &        o_rOwner );
69 };
70 
71 class OperationTitle
72 {
73   public:
74     void                operator()(
75                             XmlElement &        o_rOwner,
76                             const char *        i_sItemName,
77                             ary::cpp::Ce_id     i_nId,
78                             const ::ary::cpp::Gate &
79                                                 i_gate );
80 };
81 
82 
83 class TemplateClause
84 {
85   public:
86     typedef std::vector< ary::cpp::S_TplParam> List_TplParams;
87 
88     void                operator()(
89                             XmlElement &        o_rOwner,
90                             const List_TplParams &
91                                                 i_rTplParams );
92 };
93 
94 
95 class ExplanationList
96 {
97   public:
98                         ExplanationList(
99                             XmlElement &        o_rOwner,
100                             bool                i_bMemberStyle = false );
101 
102     void                AddEntry(
103                             const char *        i_sTerm = 0,
104                             const char *        i_sDifferentClass = 0 );
105     void                AddEntry_NoTerm();
106 
Term()107     XmlElement &        Term()                  { return *pTerm; }
Def()108     XmlElement &        Def()                   { return *pDefinition; }
109 
110   private:
111     csi::html::DefList* pList;
112     XmlElement *        pTerm;
113     XmlElement *        pDefinition;
114     bool                bMemberStyle;
115 };
116 
117 class ExplanationTable
118 {
119   public:
120                         ExplanationTable(
121                             XmlElement &        o_rOwner );
122 
123     void                AddEntry(
124                             const char *        i_sTerm = 0,
125                             const char *        i_sDifferentStyle = 0 );
126 
Term()127     XmlElement &        Term()                  { return *pTerm; }
Def()128     XmlElement &        Def()                   { return *pDefinition; }
129 
130   private:
131     csi::html::Table*   pTable;
132     XmlElement *        pTerm;
133     XmlElement *        pDefinition;
134 };
135 
136 class ParameterTable
137 {
138   public:
139                         ParameterTable(
140                             XmlElement &        o_rOwner );
141 
142     void                AddEntry();
143 
Type()144     XmlElement &        Type()                  { return *pTerm; }
Name()145     XmlElement &        Name()                  { return *pDefinition; }
146 
147   private:
148     csi::html::Table*   pTable;
149     XmlElement *        pTerm;
150     XmlElement *        pDefinition;
151 };
152 
153 class FlagTable
154 {
155   public:
156                         FlagTable(
157                             XmlElement &        o_rOwner,
158                             uintt               i_nNrOfColumns );
159 
160     void                SetColumn(
161                             uintt               i_nColumnPosition,  /// Starting with 0.
162                             const char *        i_sColumnName,
163                             bool                i_bValue );         /// "YES" or "NO"
164   private:
165     typedef std::pair< csi::html::TableCell*, csi::html::TableCell* > CellPair;
166 
167     // DATA
168     csi::html::Table*   pTable;
169     std::vector<CellPair>
170                         aCells;
171 };
172 
173 class IndexList
174 {
175   public:
176                         IndexList(
177                             XmlElement &        o_rOwner );
178 
179     void                AddEntry();
180 
Term()181     XmlElement &        Term()                  { return *pTerm; }
Def()182     XmlElement &        Def()                   { return *pDefinition; }
183 
184   private:
185     csi::html::DefList* pList;
186     XmlElement *        pTerm;
187     XmlElement *        pDefinition;
188 };
189 
190 
191 
192 
193 }   // namespace adcdisp
194 #endif
195