1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ADC_DISPLAY_HTML_KIT_HXX
29 #define ADC_DISPLAY_HTML_KIT_HXX
30 
31 // BASE CLASSES
32 #include <udm/xml/xmlitem.hxx>
33 #include <udm/html/htmlitem.hxx>
34 // USED SERVICES
35 #include <ary/cpp/c_types4cpp.hxx>
36 
37 namespace ary
38 {
39     namespace cpp
40     {
41         struct S_TplParam;
42         class OperationSignature;
43         class Gate;
44     }
45 }
46 
47 
48 
49 
50 namespace adcdisp
51 {
52 
53 typedef csi::xml::Element XmlElement;
54 
55 class PageTitle_Left
56 {
57   public:
58     void                operator()(
59                             XmlElement &        o_rOwner,
60                             const char *        i_sTypeTitle,
61                             const String  &     i_sLocalName );
62 };
63 
64 class PageTitle_Std
65 {
66   public:
67     void                operator()(
68                             XmlElement &        o_rOwner,
69                             const char *        i_sTypeTitle,
70                             const String  &     i_sLocalName );
71     XmlElement &        operator()(
72                             XmlElement &        o_rOwner );
73 };
74 
75 class OperationTitle
76 {
77   public:
78     void                operator()(
79                             XmlElement &        o_rOwner,
80                             const char *        i_sItemName,
81                             ary::cpp::Ce_id     i_nId,
82                             const ::ary::cpp::Gate &
83                                                 i_gate );
84 };
85 
86 
87 class TemplateClause
88 {
89   public:
90     typedef std::vector< ary::cpp::S_TplParam> List_TplParams;
91 
92     void                operator()(
93                             XmlElement &        o_rOwner,
94                             const List_TplParams &
95                                                 i_rTplParams );
96 };
97 
98 
99 class ExplanationList
100 {
101   public:
102                         ExplanationList(
103                             XmlElement &        o_rOwner,
104                             bool                i_bMemberStyle = false );
105 
106     void                AddEntry(
107                             const char *        i_sTerm = 0,
108                             const char *        i_sDifferentClass = 0 );
109     void                AddEntry_NoTerm();
110 
111     XmlElement &        Term()                  { return *pTerm; }
112     XmlElement &        Def()                   { return *pDefinition; }
113 
114   private:
115     csi::html::DefList* pList;
116     XmlElement *        pTerm;
117     XmlElement *        pDefinition;
118     bool                bMemberStyle;
119 };
120 
121 class ExplanationTable
122 {
123   public:
124                         ExplanationTable(
125                             XmlElement &        o_rOwner );
126 
127     void                AddEntry(
128                             const char *        i_sTerm = 0,
129                             const char *        i_sDifferentStyle = 0 );
130 
131     XmlElement &        Term()                  { return *pTerm; }
132     XmlElement &        Def()                   { return *pDefinition; }
133 
134   private:
135     csi::html::Table*   pTable;
136     XmlElement *        pTerm;
137     XmlElement *        pDefinition;
138 };
139 
140 class ParameterTable
141 {
142   public:
143                         ParameterTable(
144                             XmlElement &        o_rOwner );
145 
146     void                AddEntry();
147 
148     XmlElement &        Type()                  { return *pTerm; }
149     XmlElement &        Name()                  { return *pDefinition; }
150 
151   private:
152     csi::html::Table*   pTable;
153     XmlElement *        pTerm;
154     XmlElement *        pDefinition;
155 };
156 
157 class FlagTable
158 {
159   public:
160                         FlagTable(
161                             XmlElement &        o_rOwner,
162                             uintt               i_nNrOfColumns );
163 
164     void                SetColumn(
165                             uintt               i_nColumnPosition,  /// Starting with 0.
166                             const char *        i_sColumnName,
167                             bool                i_bValue );         /// "YES" or "NO"
168   private:
169     typedef std::pair< csi::html::TableCell*, csi::html::TableCell* > CellPair;
170 
171     // DATA
172     csi::html::Table*   pTable;
173     std::vector<CellPair>
174                         aCells;
175 };
176 
177 class IndexList
178 {
179   public:
180                         IndexList(
181                             XmlElement &        o_rOwner );
182 
183     void                AddEntry();
184 
185     XmlElement &        Term()                  { return *pTerm; }
186     XmlElement &        Def()                   { return *pDefinition; }
187 
188   private:
189     csi::html::DefList* pList;
190     XmlElement *        pTerm;
191     XmlElement *        pDefinition;
192 };
193 
194 
195 
196 
197 }   // namespace adcdisp
198 #endif
199