Commit 9b67d30a authored by Lars Knoll's avatar Lars Knoll
Browse files

added standard compliant versions/overloads of some methods.

svn path=/trunk/kdelibs/; revision=194339
parent ec4120a8
......@@ -452,6 +452,7 @@ void HTMLInputElement::setReadOnly( bool _readOnly )
static_cast<ElementImpl*>(impl)->setAttribute(ATTR_READONLY, _readOnly ? "" : 0);
}
/* The next two are provided for backwards compatibility. */
DOMString HTMLInputElement::size() const
{
if(!impl) return DOMString();
......@@ -463,6 +464,17 @@ void HTMLInputElement::setSize( const DOMString &value )
if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, value);
}
long HTMLInputElement::getSize() const
{
if(!impl) return 0;
return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SIZE).toInt();
}
void HTMLInputElement::setSize( long value )
{
if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, QString::number(value));
}
DOMString HTMLInputElement::src() const
{
if(!impl) return DOMString();
......
......@@ -502,11 +502,22 @@ public:
*/
bool readOnly() const;
// ### remove in 4.0
/**
* see @ref readOnly
*/
void setReadOnly( bool );
/**
* @deprecated
*/
DOMString size() const;
/**
* @deprecated
*/
void setSize( const DOMString & );
/**
* Size information. The precise meaning is specific to each type
* of field. See the <a
......@@ -514,12 +525,12 @@ public:
* size attribute definition </a> in HTML 4.0.
*
*/
DOMString size() const;
long getSize() const;
/**
* see @ref size
* see @ref getSize
*/
void setSize( const DOMString & );
void setSize( long );
/**
* When the <code> type </code> attribute has the value "Image",
......
......@@ -232,6 +232,18 @@ void HTMLImageElement::setBorder( long value )
if (impl) static_cast<HTMLImageElementImpl*>(impl)->setAttribute(ATTR_BORDER, QString::number(value));
}
DOMString HTMLImageElement::getBorder() const
{
if(!impl) return DOMString();
return static_cast<HTMLImageElementImpl*>(impl)->getAttribute(ATTR_BORDER);
}
void HTMLImageElement::setBorder( const DOMString& value )
{
if (impl) static_cast<HTMLImageElementImpl*>(impl)->setAttribute(ATTR_BORDER, value);
}
long HTMLImageElement::height() const
{
if(!impl) return 0;
......
......@@ -244,10 +244,21 @@ public:
* deprecated in HTML 4.0.
*
*/
DOMString getBorder() const;
/**
* see @ref border
*/
void setBorder( const DOMString& );
/**
* @deprecated
*/
long border() const;
/**
* see @ref border
* @deprecated
*/
void setBorder( long );
......
......@@ -89,6 +89,22 @@ void HTMLBaseFontElement::setSize( const DOMString &value )
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
}
long HTMLBaseFontElement::getSize() const
{
if(!impl) return 0;
return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE).toInt();
}
void HTMLBaseFontElement::setSize( long _value )
{
if ( impl )
{
DOMString value( QString::number( _value ) );
((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
}
}
// --------------------------------------------------------------------------
HTMLCollection::HTMLCollection()
......
......@@ -89,16 +89,26 @@ public:
void setFace( const DOMString & );
/**
* Font size. See the <a
* Computed Font size. See the <a
* href="http://www.w3.org/TR/REC-html40/present/graphics.html#adef-size-BASEFONT">
* size attribute definition </a> in HTML 4.0. This attribute is
* deprecated in HTML 4.0.
*
*/
long getSize() const;
/**
* see @ref size
*/
void setSize( long );
/**
* @deprecated
*/
DOMString size() const;
/**
* see @ref size
* @deprecated
*/
void setSize( const DOMString & );
};
......
......@@ -133,6 +133,17 @@ void HTMLAppletElement::setHspace( const DOMString &value )
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, value);
}
long HTMLAppletElement::getHspace() const
{
if(!impl) return 0;
return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE).toInt();
}
void HTMLAppletElement::setHspace( long value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value));
}
DOMString HTMLAppletElement::name() const
{
if(!impl) return DOMString();
......@@ -166,6 +177,18 @@ void HTMLAppletElement::setVspace( const DOMString &value )
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, value);
}
long HTMLAppletElement::getVspace() const
{
if(!impl) return 0;
return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE).toInt();
}
void HTMLAppletElement::setVspace( long value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, QString::number(value));
}
DOMString HTMLAppletElement::width() const
{
if(!impl) return DOMString();
......@@ -329,6 +352,17 @@ void HTMLObjectElement::setHspace( const DOMString &value )
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, value);
}
long HTMLObjectElement::getHspace() const
{
if(!impl) return 0;
return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE).toInt();
}
void HTMLObjectElement::setHspace( long value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value));
}
DOMString HTMLObjectElement::name() const
{
if(!impl) return DOMString();
......@@ -398,6 +432,17 @@ void HTMLObjectElement::setVspace( const DOMString &value )
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, value);
}
long HTMLObjectElement::getVspace() const
{
if(!impl) return 0;
return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE).toInt();
}
void HTMLObjectElement::setVspace( long value )
{
if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, QString::number(value));
}
DOMString HTMLObjectElement::width() const
{
if(!impl) return DOMString();
......
......@@ -150,17 +150,27 @@ public:
void setHeight( const DOMString & );
/**
* Horizontal space to the left and right of this image, applet,
* Horizontal space, in pixels, to the left and right of this image, applet,
* or object. See the <a
* href="http://www.w3.org/TR/REC-html40/struct/objects.html#adef-hspace">
* hspace attribute definition </a> in HTML 4.0. This attribute is
* deprecated in HTML 4.0.
*
*/
long getHspace() const;
/**
* see @ref hspace
*/
void setHspace( long );
/**
* @deprecated
*/
DOMString hspace() const;
/**
* see @ref hspace
* @deprecated
*/
void setHspace( const DOMString & );
......@@ -193,17 +203,27 @@ public:
void setObject( const DOMString & );
/**
* Vertical space above and below this image, applet, or object.
* Vertical space, in pixels, above and below this image, applet, or object.
* See the <a
* href="http://www.w3.org/TR/REC-html40/struct/objects.html#adef-vspace">
* vspace attribute definition </a> in HTML 4.0. This attribute is
* deprecated in HTML 4.0.
*
*/
long getVspace() const;
/**
* see @ref vspace
*/
void setVspace( long );
/**
* @deprecated
*/
DOMString vspace() const;
/**
* see @ref vspace
* @deprecated
*/
void setVspace( const DOMString & );
......@@ -382,17 +402,27 @@ public:
void setHeight( const DOMString & );
/**
* Horizontal space to the left and right of this image, applet,
* Horizontal space, in pixels, to the left and right of this image, applet,
* or object. See the <a
* href="http://www.w3.org/TR/REC-html40/struct/objects.html#adef-hspace">
* hspace attribute definition </a> in HTML 4.0. This attribute is
* deprecated in HTML 4.0.
*
*/
long getHspace() const;
/**
* see @ref hspace
*/
void setHspace( long );
/**
* @deprecated
*/
DOMString hspace() const;
/**
* see @ref hspace
* @deprecated
*/
void setHspace( const DOMString & );
......@@ -465,17 +495,27 @@ public:
void setUseMap( const DOMString & );
/**
* Vertical space above and below this image, applet, or object.
* Vertical space, in pixels, above and below this image, applet, or object.
* See the <a
* href="http://www.w3.org/TR/REC-html40/struct/objects.html#adef-vspace">
* vspace attribute definition </a> in HTML 4.0. This attribute is
* deprecated in HTML 4.0.
*
*/
long getVspace() const;
/**
* see @ref vspace
*/
void setVspace( long );
/**
* @deprecated
*/
DOMString vspace() const;
/**
* see @ref vspace
* @deprecated
*/
void setVspace( const DOMString & );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment