File indexing completed on 2024-04-28 15:23:02

0001 /**
0002  * This file is part of the DOM implementation for KDE.
0003  *
0004  * Copyright 1999 Lars Knoll (knoll@kde.org)
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public License
0017  * along with this library; see the file COPYING.LIB.  If not, write to
0018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020  *
0021  */
0022 // --------------------------------------------------------------------------
0023 
0024 #include "dom/html_list.h"
0025 #include "html/html_listimpl.h"
0026 
0027 using namespace DOM;
0028 
0029 HTMLDListElement::HTMLDListElement() : HTMLElement()
0030 {
0031 }
0032 
0033 HTMLDListElement::HTMLDListElement(const HTMLDListElement &other) : HTMLElement(other)
0034 {
0035 }
0036 
0037 HTMLDListElement::HTMLDListElement(HTMLDListElementImpl *impl) : HTMLElement(impl)
0038 {
0039 }
0040 
0041 HTMLDListElement &HTMLDListElement::operator = (const Node &other)
0042 {
0043     assignOther(other, ID_DL);
0044     return *this;
0045 }
0046 
0047 HTMLDListElement &HTMLDListElement::operator = (const HTMLDListElement &other)
0048 {
0049     HTMLElement::operator = (other);
0050     return *this;
0051 }
0052 
0053 HTMLDListElement::~HTMLDListElement()
0054 {
0055 }
0056 
0057 bool HTMLDListElement::compact() const
0058 {
0059     if (!impl) {
0060         return 0;
0061     }
0062     return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();
0063 }
0064 
0065 void HTMLDListElement::setCompact(bool _compact)
0066 {
0067     if (impl) {
0068         DOMString str;
0069         if (_compact) {
0070             str = "";
0071         }
0072         ((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);
0073     }
0074 }
0075 
0076 // --------------------------------------------------------------------------
0077 
0078 HTMLDirectoryElement::HTMLDirectoryElement() : HTMLElement()
0079 {
0080 }
0081 
0082 HTMLDirectoryElement::HTMLDirectoryElement(const HTMLDirectoryElement &other) : HTMLElement(other)
0083 {
0084 }
0085 
0086 HTMLDirectoryElement::HTMLDirectoryElement(HTMLDirectoryElementImpl *impl) : HTMLElement(impl)
0087 {
0088 }
0089 
0090 HTMLDirectoryElement &HTMLDirectoryElement::operator = (const Node &other)
0091 {
0092     assignOther(other, ID_DIR);
0093     return *this;
0094 }
0095 
0096 HTMLDirectoryElement &HTMLDirectoryElement::operator = (const HTMLDirectoryElement &other)
0097 {
0098     HTMLElement::operator = (other);
0099     return *this;
0100 }
0101 
0102 HTMLDirectoryElement::~HTMLDirectoryElement()
0103 {
0104 }
0105 
0106 bool HTMLDirectoryElement::compact() const
0107 {
0108     if (!impl) {
0109         return 0;
0110     }
0111     return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();
0112 }
0113 
0114 void HTMLDirectoryElement::setCompact(bool _compact)
0115 {
0116     if (impl) {
0117         DOMString str;
0118         if (_compact) {
0119             str = "";
0120         }
0121         ((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);
0122     }
0123 }
0124 
0125 // --------------------------------------------------------------------------
0126 
0127 HTMLLIElement::HTMLLIElement() : HTMLElement()
0128 {
0129 }
0130 
0131 HTMLLIElement::HTMLLIElement(const HTMLLIElement &other) : HTMLElement(other)
0132 {
0133 }
0134 
0135 HTMLLIElement::HTMLLIElement(HTMLLIElementImpl *impl) : HTMLElement(impl)
0136 {
0137 }
0138 
0139 HTMLLIElement &HTMLLIElement::operator = (const Node &other)
0140 {
0141     assignOther(other, ID_LI);
0142     return *this;
0143 }
0144 
0145 HTMLLIElement &HTMLLIElement::operator = (const HTMLLIElement &other)
0146 {
0147     HTMLElement::operator = (other);
0148     return *this;
0149 }
0150 
0151 HTMLLIElement::~HTMLLIElement()
0152 {
0153 }
0154 
0155 DOMString HTMLLIElement::type() const
0156 {
0157     if (!impl) {
0158         return DOMString();
0159     }
0160     return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
0161 }
0162 
0163 void HTMLLIElement::setType(const DOMString &value)
0164 {
0165     if (impl) {
0166         ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
0167     }
0168 }
0169 
0170 long HTMLLIElement::value() const
0171 {
0172     if (!impl) {
0173         return 0;
0174     }
0175     return ((ElementImpl *)impl)->getAttribute(ATTR_VALUE).toInt();
0176 }
0177 
0178 void HTMLLIElement::setValue(long _value)
0179 {
0180     if (impl) {
0181         DOMString value(QString::number(_value));
0182         ((ElementImpl *)impl)->setAttribute(ATTR_VALUE, value);
0183     }
0184 }
0185 
0186 // --------------------------------------------------------------------------
0187 
0188 HTMLMenuElement::HTMLMenuElement() : HTMLElement()
0189 {
0190 }
0191 
0192 HTMLMenuElement::HTMLMenuElement(const HTMLMenuElement &other) : HTMLElement(other)
0193 {
0194 }
0195 
0196 HTMLMenuElement::HTMLMenuElement(HTMLMenuElementImpl *impl) : HTMLElement(impl)
0197 {
0198 }
0199 
0200 HTMLMenuElement &HTMLMenuElement::operator = (const Node &other)
0201 {
0202     assignOther(other, ID_MENU);
0203     return *this;
0204 }
0205 
0206 HTMLMenuElement &HTMLMenuElement::operator = (const HTMLMenuElement &other)
0207 {
0208     HTMLElement::operator = (other);
0209     return *this;
0210 }
0211 
0212 HTMLMenuElement::~HTMLMenuElement()
0213 {
0214 }
0215 
0216 bool HTMLMenuElement::compact() const
0217 {
0218     if (!impl) {
0219         return 0;
0220     }
0221     return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();
0222 }
0223 
0224 void HTMLMenuElement::setCompact(bool _compact)
0225 {
0226     if (impl) {
0227         DOMString str;
0228         if (_compact) {
0229             str = "";
0230         }
0231         ((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);
0232     }
0233 }
0234 
0235 // --------------------------------------------------------------------------
0236 
0237 HTMLOListElement::HTMLOListElement() : HTMLElement()
0238 {
0239 }
0240 
0241 HTMLOListElement::HTMLOListElement(const HTMLOListElement &other) : HTMLElement(other)
0242 {
0243 }
0244 
0245 HTMLOListElement::HTMLOListElement(HTMLOListElementImpl *impl) : HTMLElement(impl)
0246 {
0247 }
0248 
0249 HTMLOListElement &HTMLOListElement::operator = (const Node &other)
0250 {
0251     assignOther(other, ID_OL);
0252     return *this;
0253 }
0254 
0255 HTMLOListElement &HTMLOListElement::operator = (const HTMLOListElement &other)
0256 {
0257     HTMLElement::operator = (other);
0258     return *this;
0259 }
0260 
0261 HTMLOListElement::~HTMLOListElement()
0262 {
0263 }
0264 
0265 bool HTMLOListElement::compact() const
0266 {
0267     if (!impl) {
0268         return 0;
0269     }
0270     return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();
0271 }
0272 
0273 void HTMLOListElement::setCompact(bool _compact)
0274 {
0275     if (impl) {
0276         DOMString str;
0277         if (_compact) {
0278             str = "";
0279         }
0280         ((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);
0281     }
0282 }
0283 
0284 long HTMLOListElement::start() const
0285 {
0286     if (!impl) {
0287         return 0;
0288     }
0289     return ((ElementImpl *)impl)->getAttribute(ATTR_START).toInt();
0290 }
0291 
0292 void HTMLOListElement::setStart(long _start)
0293 {
0294 
0295     if (impl) {
0296         DOMString value(QString::number(_start));
0297         ((ElementImpl *)impl)->setAttribute(ATTR_START, value);
0298     }
0299 }
0300 
0301 DOMString HTMLOListElement::type() const
0302 {
0303     if (!impl) {
0304         return DOMString();
0305     }
0306     return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
0307 }
0308 
0309 void HTMLOListElement::setType(const DOMString &value)
0310 {
0311     if (impl) {
0312         ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
0313     }
0314 }
0315 
0316 // --------------------------------------------------------------------------
0317 
0318 HTMLUListElement::HTMLUListElement() : HTMLElement()
0319 {
0320 }
0321 
0322 HTMLUListElement::HTMLUListElement(const HTMLUListElement &other) : HTMLElement(other)
0323 {
0324 }
0325 
0326 HTMLUListElement::HTMLUListElement(HTMLUListElementImpl *impl) : HTMLElement(impl)
0327 {
0328 }
0329 
0330 HTMLUListElement &HTMLUListElement::operator = (const Node &other)
0331 {
0332     assignOther(other, ID_UL);
0333     return *this;
0334 }
0335 
0336 HTMLUListElement &HTMLUListElement::operator = (const HTMLUListElement &other)
0337 {
0338     HTMLElement::operator = (other);
0339     return *this;
0340 }
0341 
0342 HTMLUListElement::~HTMLUListElement()
0343 {
0344 }
0345 
0346 bool HTMLUListElement::compact() const
0347 {
0348     if (!impl) {
0349         return 0;
0350     }
0351     return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();
0352 }
0353 
0354 void HTMLUListElement::setCompact(bool _compact)
0355 {
0356     if (impl) {
0357         DOMString str;
0358         if (_compact) {
0359             str = "";
0360         }
0361         ((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);
0362     }
0363 }
0364 
0365 DOMString HTMLUListElement::type() const
0366 {
0367     if (!impl) {
0368         return DOMString();
0369     }
0370     return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
0371 }
0372 
0373 void HTMLUListElement::setType(const DOMString &value)
0374 {
0375     if (impl) {
0376         ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
0377     }
0378 }
0379