html_list.cpp

来自「将konqueror浏览器移植到ARM9 2410中」· C++ 代码 · 共 386 行

CPP
386
字号
/** * This file is part of the DOM implementation for KDE. * * (C) 1999 Lars Knoll (knoll@kde.org) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB.  If not, write to * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * $Id: html_list.cpp,v 1.12 2001/07/15 19:57:09 mueller Exp $ */// --------------------------------------------------------------------------#include "html_list.h"#include "html_listimpl.h"using namespace DOM;#include "htmlhashes.h"HTMLDListElement::HTMLDListElement() : HTMLElement(){}HTMLDListElement::HTMLDListElement(const HTMLDListElement &other) : HTMLElement(other){}HTMLDListElement::HTMLDListElement(HTMLDListElementImpl *impl) : HTMLElement(impl){}HTMLDListElement &HTMLDListElement::operator = (const Node &other){    if(other.elementId() != ID_DL)    {	impl = 0;	return *this;    }    Node::operator = (other);    return *this;}HTMLDListElement &HTMLDListElement::operator = (const HTMLDListElement &other){    HTMLElement::operator = (other);    return *this;}HTMLDListElement::~HTMLDListElement(){}bool HTMLDListElement::compact() const{    if(!impl) return 0;    return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();}void HTMLDListElement::setCompact( bool _compact ){   if(impl)    {	DOMString str;	if( _compact )	    str = "";	((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);    }}// --------------------------------------------------------------------------HTMLDirectoryElement::HTMLDirectoryElement() : HTMLElement(){}HTMLDirectoryElement::HTMLDirectoryElement(const HTMLDirectoryElement &other) : HTMLElement(other){}HTMLDirectoryElement::HTMLDirectoryElement(HTMLDirectoryElementImpl *impl) : HTMLElement(impl){}HTMLDirectoryElement &HTMLDirectoryElement::operator = (const Node &other){    if(other.elementId() != ID_DIR)    {	impl = 0;	return *this;    }    Node::operator = (other);    return *this;}HTMLDirectoryElement &HTMLDirectoryElement::operator = (const HTMLDirectoryElement &other){    HTMLElement::operator = (other);    return *this;}HTMLDirectoryElement::~HTMLDirectoryElement(){}bool HTMLDirectoryElement::compact() const{    if(!impl) return 0;    return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();}void HTMLDirectoryElement::setCompact( bool _compact ){   if(impl)    {	DOMString str;	if( _compact )	    str = "";	((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);    }}// --------------------------------------------------------------------------HTMLLIElement::HTMLLIElement() : HTMLElement(){}HTMLLIElement::HTMLLIElement(const HTMLLIElement &other) : HTMLElement(other){}HTMLLIElement::HTMLLIElement(HTMLLIElementImpl *impl) : HTMLElement(impl){}HTMLLIElement &HTMLLIElement::operator = (const Node &other){    if(other.elementId() != ID_LI)    {	impl = 0;	return *this;    }    Node::operator = (other);    return *this;}HTMLLIElement &HTMLLIElement::operator = (const HTMLLIElement &other){    HTMLElement::operator = (other);    return *this;}HTMLLIElement::~HTMLLIElement(){}DOMString HTMLLIElement::type() const{    if(!impl) return DOMString();    return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);}void HTMLLIElement::setType( const DOMString &value ){    if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);}long HTMLLIElement::value() const{    if(!impl) return 0;    return ((ElementImpl *)impl)->getAttribute(ATTR_VALUE).toInt();}void HTMLLIElement::setValue( long _value ){    if(impl) {	DOMString value(QString::number(_value));        ((ElementImpl *)impl)->setAttribute(ATTR_VALUE,value);    }}// --------------------------------------------------------------------------HTMLMenuElement::HTMLMenuElement() : HTMLElement(){}HTMLMenuElement::HTMLMenuElement(const HTMLMenuElement &other) : HTMLElement(other){}HTMLMenuElement::HTMLMenuElement(HTMLMenuElementImpl *impl) : HTMLElement(impl){}HTMLMenuElement &HTMLMenuElement::operator = (const Node &other){    if(other.elementId() != ID_MENU)    {	impl = 0;	return *this;    }    Node::operator = (other);    return *this;}HTMLMenuElement &HTMLMenuElement::operator = (const HTMLMenuElement &other){    HTMLElement::operator = (other);    return *this;}HTMLMenuElement::~HTMLMenuElement(){}bool HTMLMenuElement::compact() const{    if(!impl) return 0;    return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();}void HTMLMenuElement::setCompact( bool _compact ){   if(impl)    {	DOMString str;	if( _compact )	    str = "";	((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);    }}// --------------------------------------------------------------------------HTMLOListElement::HTMLOListElement() : HTMLElement(){}HTMLOListElement::HTMLOListElement(const HTMLOListElement &other) : HTMLElement(other){}HTMLOListElement::HTMLOListElement(HTMLOListElementImpl *impl) : HTMLElement(impl){}HTMLOListElement &HTMLOListElement::operator = (const Node &other){    if(other.elementId() != ID_OL)    {	impl = 0;	return *this;    }    Node::operator = (other);    return *this;}HTMLOListElement &HTMLOListElement::operator = (const HTMLOListElement &other){    HTMLElement::operator = (other);    return *this;}HTMLOListElement::~HTMLOListElement(){}bool HTMLOListElement::compact() const{    if(!impl) return 0;    return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();}void HTMLOListElement::setCompact( bool _compact ){   if(impl)    {	DOMString str;	if( _compact )	    str = "";	((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);    }}long HTMLOListElement::start() const{    if(!impl) return 0;    return ((ElementImpl *)impl)->getAttribute(ATTR_START).toInt();}void HTMLOListElement::setStart( long _start ){    if(impl) {	DOMString value(QString::number(_start));        ((ElementImpl *)impl)->setAttribute(ATTR_START,value);    }}DOMString HTMLOListElement::type() const{    if(!impl) return DOMString();    return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);}void HTMLOListElement::setType( const DOMString &value ){    if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);}// --------------------------------------------------------------------------HTMLUListElement::HTMLUListElement() : HTMLElement(){}HTMLUListElement::HTMLUListElement(const HTMLUListElement &other) : HTMLElement(other){}HTMLUListElement::HTMLUListElement(HTMLUListElementImpl *impl) : HTMLElement(impl){}HTMLUListElement &HTMLUListElement::operator = (const Node &other){    if(other.elementId() != ID_UL)    {	impl = 0;	return *this;    }    Node::operator = (other);    return *this;}HTMLUListElement &HTMLUListElement::operator = (const HTMLUListElement &other){    HTMLElement::operator = (other);    return *this;}HTMLUListElement::~HTMLUListElement(){}bool HTMLUListElement::compact() const{    if(!impl) return 0;    return !((ElementImpl *)impl)->getAttribute(ATTR_COMPACT).isNull();}void HTMLUListElement::setCompact( bool _compact ){   if(impl)    {	DOMString str;	if( _compact )	    str = "";	((ElementImpl *)impl)->setAttribute(ATTR_COMPACT, str);    }}DOMString HTMLUListElement::type() const{    if(!impl) return DOMString();    return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);}void HTMLUListElement::setType( const DOMString &value ){    if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?