24 #include "dom/dom_doc.h"
25 #include "dom/html_image.h"
26 #include "dom/html_misc.h"
28 #include "html/html_imageimpl.h"
29 #include "html/html_miscimpl.h"
30 #include "misc/htmlhashes.h"
31 #include "xml/dom_docimpl.h"
43 HTMLAreaElement::HTMLAreaElement(HTMLAreaElementImpl *impl) :
HTMLElement(impl)
49 assignOther( other, ID_AREA );
55 HTMLElement::operator = (other);
59 HTMLAreaElement::~HTMLAreaElement()
66 return ((ElementImpl *)impl)->getAttribute(ATTR_ACCESSKEY);
71 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ACCESSKEY, value);
77 return ((ElementImpl *)impl)->getAttribute(ATTR_ALT);
82 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALT, value);
88 return ((ElementImpl *)impl)->getAttribute(ATTR_COORDS);
93 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COORDS, value);
100 return !
href.isNull() ? impl->getDocument()->completeURL(
href.string()) :
href;
105 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREF, value);
111 return !((ElementImpl *)impl)->getAttribute(ATTR_NOHREF).isNull();
121 ((ElementImpl *)impl)->setAttribute(ATTR_NOHREF, str);
128 return ((ElementImpl *)impl)->getAttribute(ATTR_SHAPE);
133 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SHAPE, value);
139 return ((ElementImpl *)impl)->getAttribute(ATTR_TABINDEX).toInt();
145 DOMString value(TQString::number(_tabIndex));
146 ((ElementImpl *)impl)->setAttribute(ATTR_TABINDEX,value);
153 return ((ElementImpl *)impl)->getAttribute(ATTR_TARGET);
158 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TARGET, value);
163 HTMLImageElement::HTMLImageElement() :
HTMLElement()
171 HTMLImageElement::HTMLImageElement(HTMLImageElementImpl *impl) :
HTMLElement(impl)
177 assignOther( other, ID_IMG );
183 HTMLElement::operator = (other);
187 HTMLImageElement::~HTMLImageElement()
194 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
199 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
205 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
210 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
216 return ((ElementImpl *)impl)->getAttribute(ATTR_ALT);
221 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALT, value);
228 return static_cast<HTMLImageElementImpl*
>(impl)->
getAttribute(ATTR_BORDER).toInt();
233 if (impl)
static_cast<HTMLImageElementImpl*
>(impl)->
setAttribute(ATTR_BORDER, TQString::number(value));
239 return static_cast<HTMLImageElementImpl*
>(impl)->
getAttribute(ATTR_BORDER);
244 if (impl)
static_cast<HTMLImageElementImpl*
>(impl)->
setAttribute(ATTR_BORDER, value);
251 return static_cast<HTMLImageElementImpl*
>(impl)->
height();
256 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, TQString::number(value));
263 return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE).toInt();
268 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, TQString::number(value));
274 return !((ElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
284 ((ElementImpl *)impl)->setAttribute(ATTR_ISMAP, str);
291 return ((ElementImpl *)impl)->getAttribute(ATTR_LONGDESC);
296 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_LONGDESC, value);
302 DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
303 return !s.isNull() ? impl->getDocument()->completeURL( s.string() ) : s;
308 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SRC, value);
314 return ((ElementImpl *)impl)->getAttribute(ATTR_USEMAP);
319 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_USEMAP, value);
326 return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE).toInt();
331 if(impl)
static_cast<ElementImpl*
>(impl)->
setAttribute(ATTR_VSPACE, TQString::number(value));
337 return static_cast<HTMLImageElementImpl*
>(impl)->
width();
342 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, TQString::number(value));
347 if (impl && impl->renderer()) {
350 impl->renderer()->absolutePosition(
x,y);
356 long HTMLImageElement::y()
const
358 if (impl && impl->renderer()) {
361 impl->renderer()->absolutePosition(
x,y);
377 HTMLMapElement::HTMLMapElement(HTMLMapElementImpl *impl) :
HTMLElement(impl)
383 assignOther( other, ID_MAP );
389 HTMLElement::operator = (other);
393 HTMLMapElement::~HTMLMapElement()
406 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
411 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
This class implements the basic string we use in the DOM.
DOMString getAttribute(const DOMString &name)
Retrieves an attribute value by name.
void setAttribute(const DOMString &name, const DOMString &value)
Adds a new attribute.
Client-side image map area definition.
void setHref(const DOMString &)
see href
long tabIndex() const
Index that represents the element's position in the tabbing order.
DOMString coords() const
Comma-separated list of lengths, defining an active region geometry.
DOMString alt() const
Alternate text for user agents not rendering the normal content of this element.
bool noHref() const
Specifies that this area is inactive, i.e., has no associated action.
DOMString href() const
The URI of the linked resource.
void setAlt(const DOMString &)
see alt
DOMString shape() const
The shape of the active area.
void setNoHref(bool)
see noHref
DOMString target() const
Frame to render the resource in.
void setAccessKey(const DOMString &)
see accessKey
void setShape(const DOMString &)
see shape
void setTabIndex(long)
see tabIndex
void setTarget(const DOMString &)
see target
DOMString accessKey() const
A single character access key to give access to the form control.
void setCoords(const DOMString &)
see coords
An HTMLCollection is a list of nodes.
All HTML element interfaces derive from this class.
void setName(const DOMString &)
see name
long vspace() const
Vertical space above and below this image.
DOMString getBorder() const
Width of border around image.
void setWidth(long)
see width
DOMString useMap() const
Use client-side image map.
void setHeight(long)
see height
long width() const
Override width.
void setAlign(const DOMString &)
see align
DOMString align() const
Aligns this object (vertically or horizontally) with respect to its surrounding text.
void setLongDesc(const DOMString &)
see longDesc
void setHspace(long)
see hspace
void setSrc(const DOMString &)
see src
void setBorder(const DOMString &)
see border
long hspace() const
Horizontal space to the left and right of this image.
DOMString alt() const
Alternate text for user agents not rendering the normal content of this element.
DOMString longDesc() const
URI designating a long description of this image or frame.
void setIsMap(bool)
see isMap
void setVspace(long)
see vspace
void setAlt(const DOMString &)
see alt
bool isMap() const
Use server-side image map.
DOMString name() const
The name of the element (for backwards compatibility).
void setUseMap(const DOMString &)
see useMap
DOMString src() const
URI designating the source of this image.
long height() const
Override height.
long border() const TDE_DEPRECATED
long x() const
Nonstandard extension to DOM::ImgElement.
DOMString name() const
Names the map (for use with usemap ).
HTMLCollection areas() const
The list of areas defined for the image map.
void setName(const DOMString &)
see name
The Node interface is the primary datatype for the entire Document Object Model.
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...