KHtml
24 #include "dom/html_form.h"
25 #include "dom/dom_exception.h"
26 #include "dom/dom_doc.h"
28 #include "html/html_formimpl.h"
29 #include "html/html_miscimpl.h"
31 #include "xml/dom_docimpl.h"
35 HTMLButtonElement::HTMLButtonElement() :
HTMLElement()
43 HTMLButtonElement::HTMLButtonElement(HTMLButtonElementImpl *impl) :
HTMLElement(impl)
49 assignOther(other, ID_BUTTON);
55 HTMLElement::operator = (other);
59 HTMLButtonElement::~HTMLButtonElement()
73 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_ACCESSKEY);
88 return !
static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_DISABLED).isNull();
94 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_DISABLED, _disabled ?
"" :
nullptr);
103 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_NAME);
116 static_cast<HTMLButtonElementImpl *
>(impl)->
focus();
123 static_cast<HTMLButtonElementImpl *
>(impl)->
blur();
132 return static_cast<ElementImpl *
>(impl)->
tabIndex();
140 static_cast<ElementImpl *
>(impl)->
setTabIndex(_tabIndex);
148 return static_cast<HTMLButtonElementImpl *
>(impl)->
type();
172 HTMLFieldSetElement::HTMLFieldSetElement() :
HTMLElement()
180 HTMLFieldSetElement::HTMLFieldSetElement(HTMLFieldSetElementImpl *impl) :
HTMLElement(impl)
186 assignOther(other, ID_FIELDSET);
192 HTMLElement::operator = (other);
196 HTMLFieldSetElement::~HTMLFieldSetElement()
215 HTMLFormElement::HTMLFormElement(HTMLFormElementImpl *impl) :
HTMLElement(impl)
221 assignOther(other, ID_FORM);
227 HTMLElement::operator = (other);
231 HTMLFormElement::~HTMLFormElement()
240 return HTMLFormCollection(impl);
248 return static_cast<HTMLFormElementImpl *
>(impl)->
length();
256 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_NAME);
262 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_NAME, value);
271 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_ACCEPT_CHARSET);
277 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_ACCEPT_CHARSET, value);
286 return static_cast<HTMLFormElementImpl *
>(impl)->
action();
292 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_ACTION, value);
301 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_ENCTYPE);
307 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_ENCTYPE, value);
316 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_METHOD);
322 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_METHOD, value);
331 return static_cast<HTMLFormElementImpl *
>(impl)->
target();
337 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_TARGET, value);
344 static_cast<HTMLFormElementImpl *
>(impl)->
submit();
351 static_cast<HTMLFormElementImpl *
>(impl)->
reset();
357 HTMLInputElement::HTMLInputElement() :
HTMLElement()
365 HTMLInputElement::HTMLInputElement(HTMLInputElementImpl *impl) :
HTMLElement(impl)
371 assignOther(other, ID_INPUT);
377 HTMLElement::operator = (other);
381 HTMLInputElement::~HTMLInputElement()
401 ((ElementImpl *)impl)->setAttribute(ATTR_VALUE,
value);
410 return !((ElementImpl *)impl)->getAttribute(ATTR_CHECKED).isNull();
416 ((ElementImpl *)impl)->setAttribute(ATTR_CHECKED, _defaultChecked ?
"" :
nullptr);
430 return ((ElementImpl *)impl)->getAttribute(ATTR_ACCEPT);
436 ((ElementImpl *)impl)->setAttribute(ATTR_ACCEPT,
value);
445 return ((ElementImpl *)impl)->getAttribute(ATTR_ACCESSKEY);
451 ((ElementImpl *)impl)->setAttribute(ATTR_ACCESSKEY,
value);
460 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
466 ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN,
value);
475 return ((ElementImpl *)impl)->getAttribute(ATTR_ALT);
481 ((ElementImpl *)impl)->setAttribute(ATTR_ALT,
value);
490 return ((HTMLInputElementImpl *)impl)->checked();
496 ((HTMLInputElementImpl *)impl)->setChecked(_checked);
505 return ((HTMLInputElementImpl *)impl)->indeterminate();
511 ((HTMLInputElementImpl *)impl)->setIndeterminate(_indeterminate);
520 return !((ElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
526 ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED, _disabled ?
"" :
nullptr);
535 return ((HTMLInputElementImpl *)impl)->getAttribute(ATTR_MAXLENGTH).toInt();
542 ((ElementImpl *)impl)->setAttribute(ATTR_MAXLENGTH,
value);
551 return static_cast<HTMLInputElementImpl *const
>(impl)->
name();
557 static_cast<HTMLInputElementImpl *
>(impl)->
setName(
value);
566 return !
static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_READONLY).isNull();
572 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_READONLY, _readOnly ?
"" :
nullptr);
577 #ifndef KHTML_NO_DEPRECATED
583 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_SIZE);
587 #ifndef KHTML_NO_DEPRECATED
601 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_SIZE).toInt();
617 return !s.isNull() ? impl->document()->completeURL(s.string()) : s;
632 return static_cast<ElementImpl *
>(impl)->
tabIndex();
640 static_cast<ElementImpl *
>(impl)->
setTabIndex(_tabIndex);
648 return ((HTMLInputElementImpl *)impl)->type();
656 static_cast<HTMLInputElementImpl *
>(impl)->
setType(_type);
664 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_USEMAP);
679 return ((HTMLInputElementImpl *)impl)->value();
685 ((HTMLInputElementImpl *)impl)->setValue(
value);
693 ((HTMLInputElementImpl *)impl)->blur();
700 ((HTMLInputElementImpl *)impl)->focus();
707 ((HTMLInputElementImpl *)impl)->select();
714 ((HTMLInputElementImpl *)impl)->click();
721 return ((HTMLInputElementImpl *)impl)->selectionStart();
729 return ((HTMLInputElementImpl *)impl)->selectionEnd();
737 ((HTMLInputElementImpl *)impl)->setSelectionStart(pos);
744 ((HTMLInputElementImpl *)impl)->setSelectionEnd(pos);
751 ((HTMLInputElementImpl *)impl)->setSelectionRange(
start, end);
757 HTMLLabelElement::HTMLLabelElement() :
HTMLElement()
765 HTMLLabelElement::HTMLLabelElement(HTMLLabelElementImpl *impl) :
HTMLElement(impl)
771 assignOther(other, ID_LABEL);
777 HTMLElement::operator = (other);
781 HTMLLabelElement::~HTMLLabelElement()
790 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_ACCESSKEY);
796 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_ACCESSKEY, value);
805 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_FOR);
811 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_FOR, value);
817 HTMLLegendElement::HTMLLegendElement() :
HTMLElement()
825 HTMLLegendElement::HTMLLegendElement(HTMLLegendElementImpl *impl) :
HTMLElement(impl)
831 assignOther(other, ID_LEGEND);
837 HTMLElement::operator = (other);
841 HTMLLegendElement::~HTMLLegendElement()
855 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_ACCESSKEY);
861 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_ACCESSKEY, value);
870 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_ALIGN);
876 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_ALIGN, value);
882 HTMLOptGroupElement::HTMLOptGroupElement() :
HTMLElement()
890 HTMLOptGroupElement::HTMLOptGroupElement(HTMLOptGroupElementImpl *impl) :
HTMLElement(impl)
896 assignOther(other, ID_OPTGROUP);
902 HTMLElement::operator = (other);
906 HTMLOptGroupElement::~HTMLOptGroupElement()
915 return !
static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_DISABLED).isNull();
921 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_DISABLED, _disabled ?
"" :
nullptr);
930 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_LABEL);
936 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_LABEL, value);
942 HTMLSelectElement::HTMLSelectElement() :
HTMLElement()
950 HTMLSelectElement::HTMLSelectElement(HTMLSelectElementImpl *impl) :
HTMLElement(impl)
956 assignOther(other, ID_SELECT);
962 HTMLElement::operator = (other);
966 HTMLSelectElement::~HTMLSelectElement()
975 return ((HTMLSelectElementImpl *)impl)->type();
983 return ((HTMLSelectElementImpl *)impl)->selectedIndex();
989 ((HTMLSelectElementImpl *)impl)->setSelectedIndex(_selectedIndex);
998 return static_cast<HTMLSelectElementImpl *
>(impl)->
value();
1003 if (!impl ||
value.isNull()) {
1014 return ((HTMLSelectElementImpl *)impl)->length();
1035 return !
static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_DISABLED).isNull();
1041 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_DISABLED, _disabled ?
"" :
nullptr);
1050 return !
static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_MULTIPLE).isNull();
1056 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_MULTIPLE, _multiple ?
"" :
nullptr);
1065 return static_cast<HTMLSelectElementImpl *const
>(impl)->
name();
1071 static_cast<HTMLSelectElementImpl *
>(impl)->
setName(
value);
1080 return ((HTMLSelectElementImpl *)impl)->getAttribute(ATTR_SIZE).toInt();
1097 return static_cast<ElementImpl *
>(impl)->
tabIndex();
1105 static_cast<ElementImpl *
>(impl)->
setTabIndex(_tabIndex);
1114 int exceptioncode = 0;
1115 static_cast<HTMLSelectElementImpl *
>(impl)->
add(
1116 static_cast<HTMLElementImpl *
>(element.
handle()),
1117 static_cast<HTMLElementImpl *
>(before.
handle()), exceptioncode);
1118 if (exceptioncode) {
1126 static_cast<HTMLSelectElementImpl *
>(impl)->
remove(
index);
1133 ((HTMLSelectElementImpl *)impl)->blur();
1140 ((HTMLSelectElementImpl *)impl)->focus();
1146 HTMLTextAreaElement::HTMLTextAreaElement() :
HTMLElement()
1154 HTMLTextAreaElement::HTMLTextAreaElement(HTMLTextAreaElementImpl *impl) :
HTMLElement(impl)
1160 assignOther(other, ID_TEXTAREA);
1166 HTMLElement::operator = (other);
1170 HTMLTextAreaElement::~HTMLTextAreaElement()
1179 return ((HTMLTextAreaElementImpl *)impl)->defaultValue();
1185 ((HTMLTextAreaElementImpl *)impl)->setDefaultValue(
value);
1199 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_ACCESSKEY);
1214 return ((HTMLTextAreaElementImpl *)impl)->getAttribute(ATTR_COLS).toInt();
1231 return !
static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_DISABLED).isNull();
1237 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_DISABLED, _disabled ?
"" :
nullptr);
1246 return static_cast<HTMLTextAreaElementImpl *const
>(impl)->
name();
1252 static_cast<HTMLTextAreaElementImpl *
>(impl)->
setName(
value);
1261 return !
static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_READONLY).isNull();
1267 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_READONLY, _readOnly ?
"" :
nullptr);
1276 return ((HTMLTextAreaElementImpl *)impl)->getAttribute(ATTR_ROWS).toInt();
1293 return static_cast<ElementImpl *
>(impl)->
tabIndex();
1301 static_cast<ElementImpl *
>(impl)->
setTabIndex(_tabIndex);
1309 return ((HTMLTextAreaElementImpl *)impl)->type();
1317 return ((HTMLTextAreaElementImpl *)impl)->value();
1323 ((HTMLTextAreaElementImpl *)impl)->setValue(
value);
1330 ((HTMLTextAreaElementImpl *)impl)->blur();
1337 ((HTMLTextAreaElementImpl *)impl)->focus();
1344 ((HTMLTextAreaElementImpl *)impl)->select();
1351 return ((HTMLTextAreaElementImpl *)impl)->selectionStart();
1359 return ((HTMLTextAreaElementImpl *)impl)->selectionEnd();
1367 return ((HTMLTextAreaElementImpl *)impl)->textLength();
1375 ((HTMLTextAreaElementImpl *)impl)->setSelectionStart(pos);
1382 ((HTMLTextAreaElementImpl *)impl)->setSelectionEnd(pos);
1389 ((HTMLTextAreaElementImpl *)impl)->setSelectionRange(
start, end);
1395 HTMLOptionElement::HTMLOptionElement() :
HTMLElement()
1403 HTMLOptionElement::HTMLOptionElement(HTMLOptionElementImpl *impl) :
HTMLElement(impl)
1409 assignOther(other, ID_OPTION);
1415 HTMLElement::operator = (other);
1419 HTMLOptionElement::~HTMLOptionElement()
1433 return !
static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_SELECTED).isNull();
1448 return ((HTMLOptionElementImpl *)impl)->text();
1456 return ((HTMLOptionElementImpl *)impl)->index();
1461 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
1469 return !
static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_DISABLED).isNull();
1475 static_cast<ElementImpl *
>(impl)->
setAttribute(ATTR_DISABLED, _disabled ?
"" :
nullptr);
1484 return static_cast<ElementImpl *
>(impl)->
getAttribute(ATTR_LABEL);
1499 return ((HTMLOptionElementImpl *)impl)->selected();
1507 ((HTMLOptionElementImpl *)impl)->setSelected(_selected);
1515 return static_cast<HTMLOptionElementImpl *
>(impl)->
value();
1527 HTMLIsIndexElement::HTMLIsIndexElement() :
HTMLElement()
1535 HTMLIsIndexElement::HTMLIsIndexElement(HTMLIsIndexElementImpl *impl) :
HTMLElement(impl)
1541 assignOther(other, ID_ISINDEX);
1547 HTMLElement::operator = (other);
1551 HTMLIsIndexElement::~HTMLIsIndexElement()
1565 return static_cast<HTMLIsIndexElementImpl *
>(impl)->
prompt();
1571 static_cast<HTMLIsIndexElementImpl *
>(impl)->
setPrompt(value);
void setSelected(bool)
see selected
void focus()
Gives keyboard focus to this element.
DOMString trimSpaces() const
Returns a string with Space Characters removed from the start and the end.
long selectedIndex() const
The ordinal index of the selected option.
HTMLCollection options() const
The collection of OPTION elements contained by this element.
void setDefaultValue(const DOMString &)
see defaultValue
QString number(int n, int base)
DOMString type() const
The type of control created.
void setDisabled(bool)
see disabled
All HTML element interfaces derive from this class.
long rows() const
Number of text rows.
bool disabled() const
The control is unavailable in this context.
void setIndex(long)
see index
Q_SCRIPTABLE Q_NOREPLY void start()
long textLength()
Returns the length of the text.
long size() const
Number of visible rows.
void setValue(const DOMString &)
see value
Organizes form controls into logical groups.
Element form() const
KHTML extension to DOM This method returns the associated form element.
bool disabled() const
The control is unavailable in this context.
void setDisabled(bool)
see disabled
void setReadOnly(bool)
see readOnly
void add(const HTMLElement &element, const HTMLElement &before)
Add a new element to the collection of OPTION elements for this SELECT .
DOMString value() const
The current form control value.
bool disabled() const
The control is unavailable in this context.
This library provides a full-featured HTML parser and widget.
void setValue(const DOMString &)
see value
void setValue(const DOMString &)
see value
long cols() const
Width of control (in characters).
void setAccessKey(const DOMString &)
see accessKey
DOMString getAttribute(const DOMString &name)
Retrieves an attribute value by name.
An HTMLCollection is a list of nodes.
void focus()
Gives keyboard focus to this element.
void setSelectedIndex(long)
see selectedIndex
bool defaultSelected() const
Stores the initial value of the selected attribute.
DOMString align() const
Text alignment relative to FIELDSET .
Provides a caption for a FIELDSET grouping.
DOMString name() const
Form control or object name when submitted with a form.
void setName(const DOMString &)
see name
DOMString value() const
The current textual content of the multi-line text field.
DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impos...
void setLabel(const DOMString &)
see label
void setTabIndex(long)
see tabIndex
bool readOnly() const
This control is read-only.
void setCols(long)
see cols
DOMString htmlFor() const
This attribute links this label with another form control by id attribute.
void select()
Select the contents of the TEXTAREA .
void blur()
Removes keyboard focus from this element.
void setDisabled(bool)
see disabled
void setSelectionRange(long start, long end)
Selects the text from start to end, and positions the cursor after the selection.
void setLabel(const DOMString &)
see label
DOMString defaultValue() const
Stores the initial control value (i.e., the initial value of value ).
DOMString accessKey() const
A single character access key to give access to the form control.
unsigned long index() const
void setAccessKey(const DOMString &)
see accessKey
void setAccessKey(const DOMString &)
see accessKey
Group options together in logical subdivisions.
void setSelectionStart(long offset)
Move the beginning of the selection to the given offset in text NOTE: this method is not part of the ...
void setDisabled(bool)
see disabled
long tabIndex() const
Index that represents the element's position in the tabbing order.
DOMString value() const
The current form control value.
DOMString name() const
Form control or object name when submitted with a form.
void remove(long index)
Remove an element from the collection of OPTION elements for this SELECT .
DOMString prompt() const
The prompt message.
void setTabIndex(long)
see tabIndex
long selectionEnd()
Returns the character offset of end of selection, or if none, the cursor position.
void setRows(long)
see rows
void setDefaultSelected(bool)
see defaultSelected
bool disabled() const
The control is unavailable in this context.
DOMString accessKey() const
A single character access key to give access to the form control.
long length() const
The number of options in this SELECT .
DOMString accessKey() const
A single character access key to give access to the form control.
This class implements the basic string we use in the DOM.
DOMString text() const
The text contained within the option element.
void setSize(long)
see size
void setHtmlFor(const DOMString &)
see htmlFor
void setPrompt(const DOMString &)
see prompt
DOMString label() const
Option label for use in hierarchical menus.
DOMString label() const
Assigns a label to this option group.
The select element allows the selection of an option.
DOMString type() const
The type of this form control.
long index() const
The index of this OPTION in its parent SELECT .
This element is used for single-line text input.
The Node interface is the primary datatype for the entire Document Object Model.
long selectionStart()
Returns the character offset of beginning of selection, or if none, the cursor position.
bool selected() const
Means that this option is initially selected.
NodeImpl * handle() const
void setAttribute(const DOMString &name, const DOMString &value)
Adds a new attribute.
void setSelectionEnd(long offset)
Move the end of the selection (and the cursor) to the given offset in text NOTE: this method is not p...
bool multiple() const
If true, multiple OPTION elements may be selected in this SELECT .
void setMultiple(bool)
see multiple
void blur()
Removes keyboard focus from this element.
void setAlign(const DOMString &)
see align
DOMStringImpl * implementation() const
void setName(const DOMString &)
see name
long tabIndex() const
Index that represents the element's position in the tabbing order.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:55:32 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.