1*898949d6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*898949d6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*898949d6SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*898949d6SAndrew Rist * distributed with this work for additional information
6*898949d6SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*898949d6SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*898949d6SAndrew Rist * "License"); you may not use this file except in compliance
9*898949d6SAndrew Rist * with the License. You may obtain a copy of the License at
10*898949d6SAndrew Rist *
11*898949d6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*898949d6SAndrew Rist *
13*898949d6SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*898949d6SAndrew Rist * software distributed under the License is distributed on an
15*898949d6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*898949d6SAndrew Rist * KIND, either express or implied. See the License for the
17*898949d6SAndrew Rist * specific language governing permissions and limitations
18*898949d6SAndrew Rist * under the License.
19*898949d6SAndrew Rist *
20*898949d6SAndrew Rist *************************************************************/
21*898949d6SAndrew Rist
22*898949d6SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir #include <precomp.h>
25cdf0e10cSrcweir #include <udm/html/htmlitem.hxx>
26cdf0e10cSrcweir
27cdf0e10cSrcweir // NOT FULLY DECLARED SERVICES
28cdf0e10cSrcweir
29cdf0e10cSrcweir
30cdf0e10cSrcweir namespace csi
31cdf0e10cSrcweir {
32cdf0e10cSrcweir namespace html
33cdf0e10cSrcweir {
34cdf0e10cSrcweir
35cdf0e10cSrcweir using namespace csi::xml;
36cdf0e10cSrcweir
37cdf0e10cSrcweir template <class ELEM>
38cdf0e10cSrcweir inline ELEM &
PushElem(Element & i_rMain,DYN ELEM * let_dpSub,DYN Item * let_dpItem)39cdf0e10cSrcweir PushElem( Element & i_rMain,
40cdf0e10cSrcweir DYN ELEM * let_dpSub,
41cdf0e10cSrcweir DYN Item * let_dpItem )
42cdf0e10cSrcweir {
43cdf0e10cSrcweir i_rMain << let_dpSub;
44cdf0e10cSrcweir if ( let_dpItem != 0 )
45cdf0e10cSrcweir *let_dpSub << let_dpItem;
46cdf0e10cSrcweir return *let_dpSub;
47cdf0e10cSrcweir }
48cdf0e10cSrcweir
49cdf0e10cSrcweir
50cdf0e10cSrcweir bool
LineBreakAfterBeginTag() const51cdf0e10cSrcweir Body::LineBreakAfterBeginTag() const
52cdf0e10cSrcweir {
53cdf0e10cSrcweir return true;
54cdf0e10cSrcweir }
55cdf0e10cSrcweir
56cdf0e10cSrcweir #ifndef COMPATIBLE_NETSCAPE_47
57cdf0e10cSrcweir bool
LineBreakAfterBeginTag() const58cdf0e10cSrcweir HorizontalLine::LineBreakAfterBeginTag() const
59cdf0e10cSrcweir {
60cdf0e10cSrcweir return true;
61cdf0e10cSrcweir }
62cdf0e10cSrcweir #endif
63cdf0e10cSrcweir
64cdf0e10cSrcweir
Image(const String & i_sSrc,const String & i_sWidth,const String & i_sHeight,const String & i_sAlign,const String & i_sBorder)65cdf0e10cSrcweir Image::Image( const String & i_sSrc,
66cdf0e10cSrcweir const String & i_sWidth,
67cdf0e10cSrcweir const String & i_sHeight,
68cdf0e10cSrcweir const String & i_sAlign,
69cdf0e10cSrcweir const String & i_sBorder )
70cdf0e10cSrcweir : AnEmptyElement( "img" )
71cdf0e10cSrcweir {
72cdf0e10cSrcweir *this << new AnAttribute(String("src"),i_sSrc)
73cdf0e10cSrcweir << new AnAttribute(String("width"),i_sWidth)
74cdf0e10cSrcweir << new AnAttribute(String("height"),i_sHeight)
75cdf0e10cSrcweir << new AnAttribute(String("align"),i_sAlign)
76cdf0e10cSrcweir << new AnAttribute(String("border"),i_sBorder);
77cdf0e10cSrcweir }
78cdf0e10cSrcweir
79cdf0e10cSrcweir bool
LineBreakAfterEndTag() const80cdf0e10cSrcweir Paragraph::LineBreakAfterEndTag() const
81cdf0e10cSrcweir {
82cdf0e10cSrcweir return true;
83cdf0e10cSrcweir }
84cdf0e10cSrcweir
85cdf0e10cSrcweir const char *
86cdf0e10cSrcweir Headline::sTags[6] = { "h1", "h2", "h3", "h4", "h5", "h6" };
87cdf0e10cSrcweir
88cdf0e10cSrcweir bool
LineBreakAfterEndTag() const89cdf0e10cSrcweir Headline::LineBreakAfterEndTag() const
90cdf0e10cSrcweir {
91cdf0e10cSrcweir return true;
92cdf0e10cSrcweir }
93cdf0e10cSrcweir
94cdf0e10cSrcweir #ifndef COMPATIBLE_NETSCAPE_47
95cdf0e10cSrcweir bool
LineBreakAfterBeginTag() const96cdf0e10cSrcweir LineBreak::LineBreakAfterBeginTag() const
97cdf0e10cSrcweir {
98cdf0e10cSrcweir return true;
99cdf0e10cSrcweir }
100cdf0e10cSrcweir #endif
101cdf0e10cSrcweir
102cdf0e10cSrcweir
103cdf0e10cSrcweir bool
LineBreakAfterEndTag() const104cdf0e10cSrcweir TableCell::LineBreakAfterEndTag() const
105cdf0e10cSrcweir {
106cdf0e10cSrcweir return true;
107cdf0e10cSrcweir }
108cdf0e10cSrcweir
109cdf0e10cSrcweir
110cdf0e10cSrcweir
111cdf0e10cSrcweir TableCell &
AddCell(DYN Item * let_dpItem)112cdf0e10cSrcweir TableRow::AddCell( DYN Item * let_dpItem )
113cdf0e10cSrcweir {
114cdf0e10cSrcweir return PushElem( *this, new TableCell, let_dpItem );
115cdf0e10cSrcweir }
116cdf0e10cSrcweir
117cdf0e10cSrcweir bool
LineBreakAfterBeginTag() const118cdf0e10cSrcweir TableRow::LineBreakAfterBeginTag() const
119cdf0e10cSrcweir {
120cdf0e10cSrcweir return true;
121cdf0e10cSrcweir }
122cdf0e10cSrcweir
123cdf0e10cSrcweir
Table(const String & i_sBorder,const String & i_sWidth,const String & i_sCellPadding,const String & i_sCellSpacing)124cdf0e10cSrcweir Table::Table( const String & i_sBorder,
125cdf0e10cSrcweir const String & i_sWidth,
126cdf0e10cSrcweir const String & i_sCellPadding,
127cdf0e10cSrcweir const String & i_sCellSpacing )
128cdf0e10cSrcweir : csi::xml::AnElement("table")
129cdf0e10cSrcweir {
130cdf0e10cSrcweir if ( i_sBorder.length() > 0 )
131cdf0e10cSrcweir *this << new AnAttribute(String("border"),i_sBorder);
132cdf0e10cSrcweir if ( i_sBorder.length() > 0 )
133cdf0e10cSrcweir *this << new AnAttribute(String("width"),i_sWidth);
134cdf0e10cSrcweir if ( i_sBorder.length() > 0 )
135cdf0e10cSrcweir *this << new AnAttribute(String("cellpadding"),i_sCellPadding);
136cdf0e10cSrcweir if ( i_sBorder.length() > 0 )
137cdf0e10cSrcweir *this << new AnAttribute(String("cellspacing"),i_sCellSpacing);
138cdf0e10cSrcweir }
139cdf0e10cSrcweir
140cdf0e10cSrcweir TableRow &
AddRow()141cdf0e10cSrcweir Table::AddRow()
142cdf0e10cSrcweir {
143cdf0e10cSrcweir TableRow * ret = new TableRow;
144cdf0e10cSrcweir *this << ret;
145cdf0e10cSrcweir return *ret;
146cdf0e10cSrcweir }
147cdf0e10cSrcweir
148cdf0e10cSrcweir bool
FinishEmptyTag_XmlStyle() const149cdf0e10cSrcweir Table::FinishEmptyTag_XmlStyle() const
150cdf0e10cSrcweir {
151cdf0e10cSrcweir return false;
152cdf0e10cSrcweir }
153cdf0e10cSrcweir
154cdf0e10cSrcweir bool
LineBreakAfterBeginTag() const155cdf0e10cSrcweir Table::LineBreakAfterBeginTag() const
156cdf0e10cSrcweir {
157cdf0e10cSrcweir return true;
158cdf0e10cSrcweir }
159cdf0e10cSrcweir
160cdf0e10cSrcweir
161cdf0e10cSrcweir
162cdf0e10cSrcweir bool
LineBreakAfterEndTag() const163cdf0e10cSrcweir DefListTerm::LineBreakAfterEndTag() const
164cdf0e10cSrcweir {
165cdf0e10cSrcweir return true;
166cdf0e10cSrcweir }
167cdf0e10cSrcweir
168cdf0e10cSrcweir bool
LineBreakAfterEndTag() const169cdf0e10cSrcweir DefListDefinition::LineBreakAfterEndTag() const
170cdf0e10cSrcweir {
171cdf0e10cSrcweir return true;
172cdf0e10cSrcweir }
173cdf0e10cSrcweir
174cdf0e10cSrcweir
175cdf0e10cSrcweir
176cdf0e10cSrcweir
177cdf0e10cSrcweir
178cdf0e10cSrcweir DefListTerm &
AddTerm(DYN csi::xml::Item * let_dpItem)179cdf0e10cSrcweir DefList::AddTerm( DYN csi::xml::Item* let_dpItem )
180cdf0e10cSrcweir {
181cdf0e10cSrcweir return PushElem( *this, new DefListTerm, let_dpItem );
182cdf0e10cSrcweir }
183cdf0e10cSrcweir
184cdf0e10cSrcweir DefListDefinition &
AddDefinition(DYN csi::xml::Item * let_dpItem)185cdf0e10cSrcweir DefList::AddDefinition( DYN csi::xml::Item* let_dpItem )
186cdf0e10cSrcweir {
187cdf0e10cSrcweir return PushElem( *this, new DefListDefinition, let_dpItem );
188cdf0e10cSrcweir }
189cdf0e10cSrcweir
190cdf0e10cSrcweir bool
LineBreakAfterBeginTag() const191cdf0e10cSrcweir DefList::LineBreakAfterBeginTag() const
192cdf0e10cSrcweir {
193cdf0e10cSrcweir return true;
194cdf0e10cSrcweir }
195cdf0e10cSrcweir
196cdf0e10cSrcweir bool
FinishEmptyTag_XmlStyle() const197cdf0e10cSrcweir DefList::FinishEmptyTag_XmlStyle() const
198cdf0e10cSrcweir {
199cdf0e10cSrcweir return false;
200cdf0e10cSrcweir }
201cdf0e10cSrcweir
202cdf0e10cSrcweir bool
LineBreakAfterEndTag() const203cdf0e10cSrcweir ListItem::LineBreakAfterEndTag() const
204cdf0e10cSrcweir {
205cdf0e10cSrcweir return true;
206cdf0e10cSrcweir }
207cdf0e10cSrcweir
208cdf0e10cSrcweir
209cdf0e10cSrcweir
210cdf0e10cSrcweir
211cdf0e10cSrcweir ListItem &
AddItem(DYN csi::xml::Item * let_dpItem)212cdf0e10cSrcweir NumeratedList::AddItem( DYN csi::xml::Item* let_dpItem )
213cdf0e10cSrcweir {
214cdf0e10cSrcweir return PushElem( *this, new ListItem, let_dpItem );
215cdf0e10cSrcweir }
216cdf0e10cSrcweir
217cdf0e10cSrcweir bool
LineBreakAfterBeginTag() const218cdf0e10cSrcweir NumeratedList::LineBreakAfterBeginTag() const
219cdf0e10cSrcweir {
220cdf0e10cSrcweir return true;
221cdf0e10cSrcweir }
222cdf0e10cSrcweir
223cdf0e10cSrcweir
224cdf0e10cSrcweir ListItem &
AddItem(DYN csi::xml::Item * let_dpItem)225cdf0e10cSrcweir SimpleList::AddItem( DYN csi::xml::Item* let_dpItem )
226cdf0e10cSrcweir {
227cdf0e10cSrcweir return PushElem( *this, new ListItem, let_dpItem );
228cdf0e10cSrcweir }
229cdf0e10cSrcweir
230cdf0e10cSrcweir bool
LineBreakAfterBeginTag() const231cdf0e10cSrcweir SimpleList::LineBreakAfterBeginTag() const
232cdf0e10cSrcweir {
233cdf0e10cSrcweir return true;
234cdf0e10cSrcweir }
235cdf0e10cSrcweir
236cdf0e10cSrcweir
237cdf0e10cSrcweir
238cdf0e10cSrcweir } // namespace html
239cdf0e10cSrcweir } // namespace csi
240