KHtml

html_list.cpp
1 /**
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright 1999 Lars Knoll ([email protected])
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  */
22 // --------------------------------------------------------------------------
23 
24 #include "dom/html_list.h"
25 #include "html/html_listimpl.h"
26 
27 using namespace DOM;
28 
29 HTMLDListElement::HTMLDListElement() : HTMLElement()
30 {
31 }
32 
33 HTMLDListElement::HTMLDListElement(const HTMLDListElement &other) : HTMLElement(other)
34 {
35 }
36 
37 HTMLDListElement::HTMLDListElement(HTMLDListElementImpl *impl) : HTMLElement(impl)
38 {
39 }
40 
41 HTMLDListElement &HTMLDListElement::operator = (const Node &other)
42 {
43  assignOther(other, ID_DL);
44  return *this;
45 }
46 
47 HTMLDListElement &HTMLDListElement::operator = (const HTMLDListElement &other)
48 {
49  HTMLElement::operator = (other);
50  return *this;
51 }
52 
53 HTMLDListElement::~HTMLDListElement()
54 {
55 }
56 
58 {
59  if (!impl) {
60  return 0;
61  }
62  return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();
63 }
64 
65 void HTMLDListElement::setCompact(bool _compact)
66 {
67  if (impl) {
68  DOMString str;
69  if (_compact) {
70  str = "";
71  }
72  ((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);
73  }
74 }
75 
76 // --------------------------------------------------------------------------
77 
78 HTMLDirectoryElement::HTMLDirectoryElement() : HTMLElement()
79 {
80 }
81 
82 HTMLDirectoryElement::HTMLDirectoryElement(const HTMLDirectoryElement &other) : HTMLElement(other)
83 {
84 }
85 
86 HTMLDirectoryElement::HTMLDirectoryElement(HTMLDirectoryElementImpl *impl) : HTMLElement(impl)
87 {
88 }
89 
90 HTMLDirectoryElement &HTMLDirectoryElement::operator = (const Node &other)
91 {
92  assignOther(other, ID_DIR);
93  return *this;
94 }
95 
96 HTMLDirectoryElement &HTMLDirectoryElement::operator = (const HTMLDirectoryElement &other)
97 {
98  HTMLElement::operator = (other);
99  return *this;
100 }
101 
102 HTMLDirectoryElement::~HTMLDirectoryElement()
103 {
104 }
105 
107 {
108  if (!impl) {
109  return 0;
110  }
111  return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();
112 }
113 
115 {
116  if (impl) {
117  DOMString str;
118  if (_compact) {
119  str = "";
120  }
121  ((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);
122  }
123 }
124 
125 // --------------------------------------------------------------------------
126 
127 HTMLLIElement::HTMLLIElement() : HTMLElement()
128 {
129 }
130 
131 HTMLLIElement::HTMLLIElement(const HTMLLIElement &other) : HTMLElement(other)
132 {
133 }
134 
135 HTMLLIElement::HTMLLIElement(HTMLLIElementImpl *impl) : HTMLElement(impl)
136 {
137 }
138 
139 HTMLLIElement &HTMLLIElement::operator = (const Node &other)
140 {
141  assignOther(other, ID_LI);
142  return *this;
143 }
144 
145 HTMLLIElement &HTMLLIElement::operator = (const HTMLLIElement &other)
146 {
147  HTMLElement::operator = (other);
148  return *this;
149 }
150 
151 HTMLLIElement::~HTMLLIElement()
152 {
153 }
154 
156 {
157  if (!impl) {
158  return DOMString();
159  }
160  return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
161 }
162 
164 {
165  if (impl) {
166  ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
167  }
168 }
169 
171 {
172  if (!impl) {
173  return 0;
174  }
175  return ((ElementImpl *)impl)->getAttribute(ATTR_VALUE).toInt();
176 }
177 
178 void HTMLLIElement::setValue(long _value)
179 {
180  if (impl) {
181  DOMString value(QString::number(_value));
182  ((ElementImpl *)impl)->setAttribute(ATTR_VALUE, value);
183  }
184 }
185 
186 // --------------------------------------------------------------------------
187 
188 HTMLMenuElement::HTMLMenuElement() : HTMLElement()
189 {
190 }
191 
192 HTMLMenuElement::HTMLMenuElement(const HTMLMenuElement &other) : HTMLElement(other)
193 {
194 }
195 
196 HTMLMenuElement::HTMLMenuElement(HTMLMenuElementImpl *impl) : HTMLElement(impl)
197 {
198 }
199 
200 HTMLMenuElement &HTMLMenuElement::operator = (const Node &other)
201 {
202  assignOther(other, ID_MENU);
203  return *this;
204 }
205 
206 HTMLMenuElement &HTMLMenuElement::operator = (const HTMLMenuElement &other)
207 {
208  HTMLElement::operator = (other);
209  return *this;
210 }
211 
212 HTMLMenuElement::~HTMLMenuElement()
213 {
214 }
215 
217 {
218  if (!impl) {
219  return 0;
220  }
221  return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();
222 }
223 
224 void HTMLMenuElement::setCompact(bool _compact)
225 {
226  if (impl) {
227  DOMString str;
228  if (_compact) {
229  str = "";
230  }
231  ((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);
232  }
233 }
234 
235 // --------------------------------------------------------------------------
236 
237 HTMLOListElement::HTMLOListElement() : HTMLElement()
238 {
239 }
240 
241 HTMLOListElement::HTMLOListElement(const HTMLOListElement &other) : HTMLElement(other)
242 {
243 }
244 
245 HTMLOListElement::HTMLOListElement(HTMLOListElementImpl *impl) : HTMLElement(impl)
246 {
247 }
248 
249 HTMLOListElement &HTMLOListElement::operator = (const Node &other)
250 {
251  assignOther(other, ID_OL);
252  return *this;
253 }
254 
255 HTMLOListElement &HTMLOListElement::operator = (const HTMLOListElement &other)
256 {
257  HTMLElement::operator = (other);
258  return *this;
259 }
260 
261 HTMLOListElement::~HTMLOListElement()
262 {
263 }
264 
266 {
267  if (!impl) {
268  return 0;
269  }
270  return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();
271 }
272 
273 void HTMLOListElement::setCompact(bool _compact)
274 {
275  if (impl) {
276  DOMString str;
277  if (_compact) {
278  str = "";
279  }
280  ((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);
281  }
282 }
283 
285 {
286  if (!impl) {
287  return 0;
288  }
289  return ((ElementImpl *)impl)->getAttribute(ATTR_START).toInt();
290 }
291 
292 void HTMLOListElement::setStart(long _start)
293 {
294 
295  if (impl) {
296  DOMString value(QString::number(_start));
297  ((ElementImpl *)impl)->setAttribute(ATTR_START, value);
298  }
299 }
300 
302 {
303  if (!impl) {
304  return DOMString();
305  }
306  return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
307 }
308 
310 {
311  if (impl) {
312  ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
313  }
314 }
315 
316 // --------------------------------------------------------------------------
317 
318 HTMLUListElement::HTMLUListElement() : HTMLElement()
319 {
320 }
321 
322 HTMLUListElement::HTMLUListElement(const HTMLUListElement &other) : HTMLElement(other)
323 {
324 }
325 
326 HTMLUListElement::HTMLUListElement(HTMLUListElementImpl *impl) : HTMLElement(impl)
327 {
328 }
329 
330 HTMLUListElement &HTMLUListElement::operator = (const Node &other)
331 {
332  assignOther(other, ID_UL);
333  return *this;
334 }
335 
336 HTMLUListElement &HTMLUListElement::operator = (const HTMLUListElement &other)
337 {
338  HTMLElement::operator = (other);
339  return *this;
340 }
341 
342 HTMLUListElement::~HTMLUListElement()
343 {
344 }
345 
347 {
348  if (!impl) {
349  return 0;
350  }
351  return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();
352 }
353 
354 void HTMLUListElement::setCompact(bool _compact)
355 {
356  if (impl) {
357  DOMString str;
358  if (_compact) {
359  str = "";
360  }
361  ((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);
362  }
363 }
364 
366 {
367  if (!impl) {
368  return DOMString();
369  }
370  return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
371 }
372 
374 {
375  if (impl) {
376  ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
377  }
378 }
379 
DOMString type() const
List item bullet style.
Definition: html_list.cpp:155
void setType(const DOMString &)
see type
Definition: html_list.cpp:309
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:278
Directory list.
Definition: html_list.h:95
void setCompact(bool)
see compact
Definition: html_list.cpp:273
List item.
Definition: html_list.h:136
long value() const
Reset sequence number when used in OL See the value attribute definition in HTML 4...
Definition: html_list.cpp:170
void setCompact(bool)
see compact
Definition: html_list.cpp:354
DOMString type() const
Bullet style.
Definition: html_list.cpp:365
bool compact() const
Reduce spacing between list items.
Definition: html_list.cpp:346
DOMString type() const
Numbering style.
Definition: html_list.cpp:301
void setType(const DOMString &)
see type
Definition: html_list.cpp:163
QString number(int n, int base)
Ordered list.
Definition: html_list.h:235
void setType(const DOMString &)
see type
Definition: html_list.cpp:373
bool compact() const
Reduce spacing between list items.
Definition: html_list.cpp:57
void setValue(long)
see value
Definition: html_list.cpp:178
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
Definition list.
Definition: html_list.h:53
void setCompact(bool)
see compact
Definition: html_list.cpp:224
void setCompact(bool)
see compact
Definition: html_list.cpp:114
This library provides a full-featured HTML parser and widget.
bool compact() const
Reduce spacing between list items.
Definition: html_list.cpp:265
bool compact() const
Reduce spacing between list items.
Definition: html_list.cpp:216
long start() const
Starting sequence number.
Definition: html_list.cpp:284
bool compact() const
Reduce spacing between list items.
Definition: html_list.cpp:106
void setStart(long)
see start
Definition: html_list.cpp:292
Unordered list.
Definition: html_list.h:304
All HTML element interfaces derive from this class.
Definition: html_element.h:70
void setCompact(bool)
see compact
Definition: html_list.cpp:65
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Mar 2 2021 01:00:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.