html_block.cpp
// --------------------------------------------------------------------------
#include "dom/html_block.h"
#include "dom/html_misc.h"
#include "html/html_blockimpl.h"
#include "html/html_miscimpl.h"
using namespace DOM;
#include "misc/htmlhashes.h"
HTMLBlockquoteElement::HTMLBlockquoteElement()
: HTMLElement()
{
}
HTMLBlockquoteElement::HTMLBlockquoteElement(const HTMLBlockquoteElement &other)
: HTMLElement(other)
{
}
HTMLBlockquoteElement::HTMLBlockquoteElement(HTMLElementImpl *impl)
: HTMLElement(impl)
{
}
HTMLBlockquoteElement &HTMLBlockquoteElement::operator = (const Node &other)
{
assignOther( other, ID_BLOCKQUOTE );
return *this;
}
HTMLBlockquoteElement &HTMLBlockquoteElement::operator = (const HTMLBlockquoteElement &other)
{
HTMLElement::operator = (other);
return *this;
}
HTMLBlockquoteElement::~HTMLBlockquoteElement()
{
}
DOMString HTMLBlockquoteElement::cite() const
{
if(!impl) return DOMString();
return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
}
void HTMLBlockquoteElement::setCite( const DOMString &value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
}
// --------------------------------------------------------------------------
HTMLDivElement::HTMLDivElement()
: HTMLElement()
{
}
HTMLDivElement::HTMLDivElement(const HTMLDivElement &other)
: HTMLElement(other)
{
}
HTMLDivElement::HTMLDivElement(HTMLDivElementImpl *impl)
: HTMLElement(impl)
{
}
HTMLDivElement &HTMLDivElement::operator = (const Node &other)
{
assignOther( other, ID_DIV );
return *this;
}
HTMLDivElement &HTMLDivElement::operator = (const HTMLDivElement &other)
{
HTMLElement::operator = (other);
return *this;
}
HTMLDivElement::~HTMLDivElement()
{
}
DOMString HTMLDivElement::align() const
{
if(!impl) return DOMString();
return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
}
void HTMLDivElement::setAlign( const DOMString &value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
}
// --------------------------------------------------------------------------
HTMLHRElement::HTMLHRElement()
: HTMLElement()
{
}
HTMLHRElement::HTMLHRElement(const HTMLHRElement &other)
: HTMLElement(other)
{
}
HTMLHRElement::HTMLHRElement(HTMLHRElementImpl *impl)
: HTMLElement(impl)
{
}
HTMLHRElement &HTMLHRElement::operator = (const Node &other)
{
assignOther( other, ID_HR );
return *this;
}
HTMLHRElement &HTMLHRElement::operator = (const HTMLHRElement &other)
{
HTMLElement::operator = (other);
return *this;
}
HTMLHRElement::~HTMLHRElement()
{
}
DOMString HTMLHRElement::align() const
{
if(!impl) return DOMString();
return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
}
void HTMLHRElement::setAlign( const DOMString &value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
}
bool HTMLHRElement::noShade() const
{
if(!impl) return false;
return !((ElementImpl *)impl)->getAttribute(ATTR_NOSHADE).isNull();
}
void HTMLHRElement::setNoShade( bool _noShade )
{
if(impl)
{
DOMString str;
if( _noShade )
str = "";
((ElementImpl *)impl)->setAttribute(ATTR_NOSHADE, str);
}
}
DOMString HTMLHRElement::size() const
{
if(!impl) return DOMString();
return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE);
}
void HTMLHRElement::setSize( const DOMString &value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
}
DOMString HTMLHRElement::width() const
{
if(!impl) return DOMString();
return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
}
void HTMLHRElement::setWidth( const DOMString &value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
}
// --------------------------------------------------------------------------
HTMLHeadingElement::HTMLHeadingElement()
: HTMLElement()
{
}
HTMLHeadingElement::HTMLHeadingElement(const HTMLHeadingElement &other)
: HTMLElement(other)
{
}
HTMLHeadingElement::HTMLHeadingElement(HTMLElementImpl *impl)
: HTMLElement(impl)
{
}
HTMLHeadingElement &HTMLHeadingElement::operator = (const Node &other)
{
if(other.elementId() != ID_H1 &&
other.elementId() != ID_H2 &&
other.elementId() != ID_H3 &&
other.elementId() != ID_H4 &&
other.elementId() != ID_H5 &&
other.elementId() != ID_H6 )
{
if ( impl ) impl->deref();
impl = 0;
} else {
Node::operator = (other);
}
return *this;
}
HTMLHeadingElement &HTMLHeadingElement::operator = (const HTMLHeadingElement &other)
{
HTMLElement::operator = (other);
return *this;
}
HTMLHeadingElement::~HTMLHeadingElement()
{
}
DOMString HTMLHeadingElement::align() const
{
if(!impl) return DOMString();
return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
}
void HTMLHeadingElement::setAlign( const DOMString &value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
}
// --------------------------------------------------------------------------
HTMLParagraphElement::HTMLParagraphElement() : HTMLElement()
{
}
HTMLParagraphElement::HTMLParagraphElement(const HTMLParagraphElement &other)
: HTMLElement(other)
{
}
HTMLParagraphElement::HTMLParagraphElement(HTMLElementImpl *impl)
: HTMLElement(impl)
{
}
HTMLParagraphElement &HTMLParagraphElement::operator = (const Node &other)
{
assignOther( other, ID_P );
return *this;
}
HTMLParagraphElement &HTMLParagraphElement::operator = (const HTMLParagraphElement &other)
{
HTMLElement::operator = (other);
return *this;
}
HTMLParagraphElement::~HTMLParagraphElement()
{
}
DOMString HTMLParagraphElement::align() const
{
if(!impl) return DOMString();
return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
}
void HTMLParagraphElement::setAlign( const DOMString &value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
}
// --------------------------------------------------------------------------
HTMLPreElement::HTMLPreElement() : HTMLElement()
{
}
HTMLPreElement::HTMLPreElement(const HTMLPreElement &other)
: HTMLElement(other)
{
}
HTMLPreElement::HTMLPreElement(HTMLPreElementImpl *impl)
: HTMLElement(impl)
{
}
HTMLPreElement &HTMLPreElement::operator = (const Node &other)
{
assignOther( other, ID_PRE );
return *this;
}
HTMLPreElement &HTMLPreElement::operator = (const HTMLPreElement &other)
{
HTMLElement::operator = (other);
return *this;
}
HTMLPreElement::~HTMLPreElement()
{
}
long HTMLPreElement::width() const
{
if(!impl) return 0;
DOMString w = ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
return w.toInt();
}
void HTMLPreElement::setWidth( long _width )
{
if(!impl) return;
QString aStr;
aStr.sprintf("%ld", _width);
DOMString value(aStr);
((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
}
// --------------------------------------------------------------------------
HTMLLayerElement::HTMLLayerElement() : HTMLElement()
{
}
HTMLLayerElement::HTMLLayerElement(const HTMLLayerElement &other)
: HTMLElement(other)
{
}
HTMLLayerElement::HTMLLayerElement(HTMLLayerElementImpl *impl)
: HTMLElement(impl)
{
}
HTMLLayerElement &HTMLLayerElement::operator = (const Node &other)
{
assignOther( other, ID_LAYER );
return *this;
}
HTMLLayerElement &HTMLLayerElement::operator = (const HTMLLayerElement &other)
{
HTMLElement::operator = (other);
return *this;
}
HTMLLayerElement::~HTMLLayerElement()
{
}
long HTMLLayerElement::top() const
{
if(!impl) return 0;
DOMString t = ((ElementImpl *)impl)->getAttribute(ATTR_TOP);
return t.toInt();
}
void HTMLLayerElement::setTop( long _top )
{
if(!impl) return;
QString aStr;
aStr.sprintf("%ld", _top);
DOMString value(aStr);
((ElementImpl *)impl)->setAttribute(ATTR_TOP, value);
}
long HTMLLayerElement::left() const
{
if(!impl) return 0;
DOMString l = ((ElementImpl *)impl)->getAttribute(ATTR_LEFT);
return l.toInt();
}
void HTMLLayerElement::setLeft( long _left )
{
if(!impl) return;
QString aStr;
aStr.sprintf("%ld", _left);
DOMString value(aStr);
((ElementImpl *)impl)->setAttribute(ATTR_LEFT, value);
}
DOMString HTMLLayerElement::visibility() const
{
if(!impl) return DOMString();
return ((ElementImpl *)impl)->getAttribute(ATTR_VISIBILITY);
}
void HTMLLayerElement::setVisibility( const DOMString &value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VISIBILITY, value);
}
DOMString HTMLLayerElement::bgColor() const
{
if(!impl) return DOMString();
return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
}
void HTMLLayerElement::setBgColor( const DOMString &value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
}
HTMLCollection HTMLLayerElement::layers() const
{
if(!impl) return HTMLCollection();
return HTMLCollection(impl, HTMLCollectionImpl::DOC_LAYERS);
}
DOM::HTMLLayerElement::top
long top() const
The absolute position of the layer from the top.
Definition: html_block.cpp:383
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:274
DOM::HTMLLayerElement
Layer container for Netscape 4.x compatability.
Definition: html_block.h:337
DOM::HTMLLayerElement::left
long left() const
The absolute position of the layer from the left.
Definition: html_block.cpp:400
DOM::HTMLParagraphElement::setAlign
void setAlign(const DOMString &)
see align
Definition: html_block.cpp:297
DOM::HTMLPreElement::width
long width() const
Fixed width for content.
Definition: html_block.cpp:334
DOM::HTMLLayerElement::bgColor
DOMString bgColor() const
The background color of the layer.
Definition: html_block.cpp:428
DOM::HTMLLayerElement::setBgColor
void setBgColor(const DOMString &)
see bgColor
Definition: html_block.cpp:434
DOM::HTMLHRElement::width
DOMString width() const
The width of the rule.
Definition: html_block.cpp:193
DOM::HTMLCollection
An HTMLCollection is a list of nodes.
Definition: html_misc.h:126
DOM::HTMLLayerElement::setTop
void setTop(long)
see top
Definition: html_block.cpp:390
DOM::HTMLBlockquoteElement::cite
DOMString cite() const
A URI designating a document that describes the reason for the change.
Definition: html_block.cpp:66
DOM::HTMLHeadingElement::align
DOMString align() const
Horizontal text alignment.
Definition: html_block.cpp:248
DOM::HTMLLayerElement::layers
HTMLCollection layers() const
The collection of sub-layers.
Definition: html_block.cpp:439
DOM::HTMLDivElement::setAlign
void setAlign(const DOMString &)
see align
Definition: html_block.cpp:116
DOM::HTMLParagraphElement
Paragraphs.
Definition: html_block.h:258
DOM::HTMLHRElement::noShade
bool noShade() const
Indicates to the user agent that there should be no shading in the rendering of this element...
Definition: html_block.cpp:165
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:43
DOM::HTMLHeadingElement
For the H1 to H6 elements.
Definition: html_block.h:217
DOM::HTMLHRElement::setNoShade
void setNoShade(bool)
see noShade
Definition: html_block.cpp:171
DOM::HTMLHRElement::size
DOMString size() const
The height of the rule.
Definition: html_block.cpp:182
DOM::HTMLLayerElement::setLeft
void setLeft(long)
see left
Definition: html_block.cpp:407
DOM::HTMLHRElement::align
DOMString align() const
Align the rule on the page.
Definition: html_block.cpp:154
DOM::HTMLDivElement::align
DOMString align() const
Horizontal text alignment.
Definition: html_block.cpp:110
DOM::HTMLBlockquoteElement
??? See the BLOCKQUOTE element definition in HTML 4.0.
Definition: html_block.h:50
DOM::HTMLPreElement
Preformatted text.
Definition: html_block.h:299
DOM::HTMLHRElement::setWidth
void setWidth(const DOMString &)
see width
Definition: html_block.cpp:199
DOM::HTMLDivElement
Generic block container.
Definition: html_block.h:91
DOM::HTMLParagraphElement::align
DOMString align() const
Horizontal text alignment.
Definition: html_block.cpp:291
DOM::HTMLHeadingElement::setAlign
void setAlign(const DOMString &)
see align
Definition: html_block.cpp:254
DOM::HTMLPreElement::setWidth
void setWidth(long)
see width
Definition: html_block.cpp:341
DOM::HTMLLayerElement::setVisibility
void setVisibility(const DOMString &)
see visibility
Definition: html_block.cpp:423
DOM::HTMLHRElement::setAlign
void setAlign(const DOMString &)
see align
Definition: html_block.cpp:160
DOM::HTMLBlockquoteElement::setCite
void setCite(const DOMString &)
see cite
Definition: html_block.cpp:72
DOM::HTMLElement
All HTML element interfaces derive from this class.
Definition: html_element.h:69
DOM::HTMLHRElement::setSize
void setSize(const DOMString &)
see size
Definition: html_block.cpp:188
DOM::HTMLLayerElement::visibility
DOMString visibility() const
The visibility of layers is either "show" or "hide".
Definition: html_block.cpp:417
DOM::HTMLHRElement
Create a horizontal rule.
Definition: html_block.h:133

KDE Home | KDE Accessibility Home | Description of Access Keys