2 * This file is part of the DOM implementation for KDE.
4 * Copyright 1999 Lars Knoll (knoll@kde.org)
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.
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.
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.
22 // --------------------------------------------------------------------------
24 #include "dom/html_list.h"
25 #include "html/html_listimpl.h"
26 #include "misc/htmlhashes.h"
30 HTMLDListElement::HTMLDListElement() : HTMLElement()
34 HTMLDListElement::HTMLDListElement(const HTMLDListElement
&other
) : HTMLElement(other
)
38 HTMLDListElement::HTMLDListElement(HTMLDListElementImpl
*impl
) : HTMLElement(impl
)
42 HTMLDListElement
&HTMLDListElement::operator = (const Node
&other
)
44 assignOther( other
, ID_DL
);
48 HTMLDListElement
&HTMLDListElement::operator = (const HTMLDListElement
&other
)
50 HTMLElement::operator = (other
);
54 HTMLDListElement::~HTMLDListElement()
58 bool HTMLDListElement::compact() const
61 return !((ElementImpl
*)impl
)->getAttribute(ATTR_COMPACT
).isNull();
64 void HTMLDListElement::setCompact( bool _compact
)
71 ((ElementImpl
*)impl
)->setAttribute(ATTR_COMPACT
, str
);
75 // --------------------------------------------------------------------------
77 HTMLDirectoryElement::HTMLDirectoryElement() : HTMLElement()
81 HTMLDirectoryElement::HTMLDirectoryElement(const HTMLDirectoryElement
&other
) : HTMLElement(other
)
85 HTMLDirectoryElement::HTMLDirectoryElement(HTMLDirectoryElementImpl
*impl
) : HTMLElement(impl
)
89 HTMLDirectoryElement
&HTMLDirectoryElement::operator = (const Node
&other
)
91 assignOther( other
, ID_DIR
);
95 HTMLDirectoryElement
&HTMLDirectoryElement::operator = (const HTMLDirectoryElement
&other
)
97 HTMLElement::operator = (other
);
101 HTMLDirectoryElement::~HTMLDirectoryElement()
105 bool HTMLDirectoryElement::compact() const
108 return !((ElementImpl
*)impl
)->getAttribute(ATTR_COMPACT
).isNull();
111 void HTMLDirectoryElement::setCompact( bool _compact
)
118 ((ElementImpl
*)impl
)->setAttribute(ATTR_COMPACT
, str
);
122 // --------------------------------------------------------------------------
124 HTMLLIElement::HTMLLIElement() : HTMLElement()
128 HTMLLIElement::HTMLLIElement(const HTMLLIElement
&other
) : HTMLElement(other
)
132 HTMLLIElement::HTMLLIElement(HTMLLIElementImpl
*impl
) : HTMLElement(impl
)
136 HTMLLIElement
&HTMLLIElement::operator = (const Node
&other
)
138 assignOther( other
, ID_LI
);
142 HTMLLIElement
&HTMLLIElement::operator = (const HTMLLIElement
&other
)
144 HTMLElement::operator = (other
);
148 HTMLLIElement::~HTMLLIElement()
152 DOMString
HTMLLIElement::type() const
154 if(!impl
) return DOMString();
155 return ((ElementImpl
*)impl
)->getAttribute(ATTR_TYPE
);
158 void HTMLLIElement::setType( const DOMString
&value
)
160 if(impl
) ((ElementImpl
*)impl
)->setAttribute(ATTR_TYPE
, value
);
163 long HTMLLIElement::value() const
166 return ((ElementImpl
*)impl
)->getAttribute(ATTR_VALUE
).toInt();
169 void HTMLLIElement::setValue( long _value
)
172 DOMString
value(QString::number(_value
));
173 ((ElementImpl
*)impl
)->setAttribute(ATTR_VALUE
,value
);
177 // --------------------------------------------------------------------------
179 HTMLMenuElement::HTMLMenuElement() : HTMLElement()
183 HTMLMenuElement::HTMLMenuElement(const HTMLMenuElement
&other
) : HTMLElement(other
)
187 HTMLMenuElement::HTMLMenuElement(HTMLMenuElementImpl
*impl
) : HTMLElement(impl
)
191 HTMLMenuElement
&HTMLMenuElement::operator = (const Node
&other
)
193 assignOther( other
, ID_MENU
);
197 HTMLMenuElement
&HTMLMenuElement::operator = (const HTMLMenuElement
&other
)
199 HTMLElement::operator = (other
);
203 HTMLMenuElement::~HTMLMenuElement()
207 bool HTMLMenuElement::compact() const
210 return !((ElementImpl
*)impl
)->getAttribute(ATTR_COMPACT
).isNull();
213 void HTMLMenuElement::setCompact( bool _compact
)
220 ((ElementImpl
*)impl
)->setAttribute(ATTR_COMPACT
, str
);
224 // --------------------------------------------------------------------------
226 HTMLOListElement::HTMLOListElement() : HTMLElement()
230 HTMLOListElement::HTMLOListElement(const HTMLOListElement
&other
) : HTMLElement(other
)
234 HTMLOListElement::HTMLOListElement(HTMLOListElementImpl
*impl
) : HTMLElement(impl
)
238 HTMLOListElement
&HTMLOListElement::operator = (const Node
&other
)
240 assignOther( other
, ID_OL
);
244 HTMLOListElement
&HTMLOListElement::operator = (const HTMLOListElement
&other
)
246 HTMLElement::operator = (other
);
250 HTMLOListElement::~HTMLOListElement()
254 bool HTMLOListElement::compact() const
257 return !((ElementImpl
*)impl
)->getAttribute(ATTR_COMPACT
).isNull();
260 void HTMLOListElement::setCompact( bool _compact
)
267 ((ElementImpl
*)impl
)->setAttribute(ATTR_COMPACT
, str
);
271 long HTMLOListElement::start() const
274 return ((ElementImpl
*)impl
)->getAttribute(ATTR_START
).toInt();
277 void HTMLOListElement::setStart( long _start
)
281 DOMString
value(QString::number(_start
));
282 ((ElementImpl
*)impl
)->setAttribute(ATTR_START
,value
);
286 DOMString
HTMLOListElement::type() const
288 if(!impl
) return DOMString();
289 return ((ElementImpl
*)impl
)->getAttribute(ATTR_TYPE
);
292 void HTMLOListElement::setType( const DOMString
&value
)
294 if(impl
) ((ElementImpl
*)impl
)->setAttribute(ATTR_TYPE
, value
);
297 // --------------------------------------------------------------------------
299 HTMLUListElement::HTMLUListElement() : HTMLElement()
303 HTMLUListElement::HTMLUListElement(const HTMLUListElement
&other
) : HTMLElement(other
)
307 HTMLUListElement::HTMLUListElement(HTMLUListElementImpl
*impl
) : HTMLElement(impl
)
311 HTMLUListElement
&HTMLUListElement::operator = (const Node
&other
)
313 assignOther( other
, ID_UL
);
317 HTMLUListElement
&HTMLUListElement::operator = (const HTMLUListElement
&other
)
319 HTMLElement::operator = (other
);
323 HTMLUListElement::~HTMLUListElement()
327 bool HTMLUListElement::compact() const
330 return !((ElementImpl
*)impl
)->getAttribute(ATTR_COMPACT
).isNull();
333 void HTMLUListElement::setCompact( bool _compact
)
340 ((ElementImpl
*)impl
)->setAttribute(ATTR_COMPACT
, str
);
344 DOMString
HTMLUListElement::type() const
346 if(!impl
) return DOMString();
347 return ((ElementImpl
*)impl
)->getAttribute(ATTR_TYPE
);
350 void HTMLUListElement::setType( const DOMString
&value
)
352 if(impl
) ((ElementImpl
*)impl
)->setAttribute(ATTR_TYPE
, value
);