• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • khtml
 

khtml

  • khtml
  • dom
html_form.cpp
1 
22 // --------------------------------------------------------------------------
23 
24 #include "dom/html_form.h"
25 #include "dom/dom_exception.h"
26 #include "dom/dom_doc.h"
27 
28 #include "html/html_formimpl.h"
29 #include "html/html_miscimpl.h"
30 
31 #include "xml/dom_docimpl.h"
32 #include "misc/htmlhashes.h"
33 
34 using namespace DOM;
35 
36 HTMLButtonElement::HTMLButtonElement() : HTMLElement()
37 {
38 }
39 
40 HTMLButtonElement::HTMLButtonElement(const HTMLButtonElement &other) : HTMLElement(other)
41 {
42 }
43 
44 HTMLButtonElement::HTMLButtonElement(HTMLButtonElementImpl *impl) : HTMLElement(impl)
45 {
46 }
47 
48 HTMLButtonElement &HTMLButtonElement::operator = (const Node &other)
49 {
50  assignOther( other, ID_BUTTON );
51  return *this;
52 }
53 
54 HTMLButtonElement &HTMLButtonElement::operator = (const HTMLButtonElement &other)
55 {
56  HTMLElement::operator = (other);
57  return *this;
58 }
59 
60 HTMLButtonElement::~HTMLButtonElement()
61 {
62 }
63 
64 HTMLFormElement HTMLButtonElement::form() const
65 {
66  return Element::form();
67 }
68 
69 DOMString HTMLButtonElement::accessKey() const
70 {
71  if(!impl) return DOMString();
72  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
73 }
74 
75 void HTMLButtonElement::setAccessKey( const DOMString &value )
76 {
77  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
78 }
79 
80 bool HTMLButtonElement::disabled() const
81 {
82  if(!impl) return 0;
83  return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
84 }
85 
86 void HTMLButtonElement::setDisabled( bool _disabled )
87 {
88  if (impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
89 }
90 
91 DOMString HTMLButtonElement::name() const
92 {
93  if(!impl) return DOMString();
94  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_NAME);
95 }
96 
97 void HTMLButtonElement::setName( const DOMString &value )
98 {
99  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_NAME, value);
100 }
101 
102 void HTMLButtonElement::focus( )
103 {
104  if(impl)
105  static_cast<HTMLButtonElementImpl*>(impl)->focus();
106 }
107 
108 void HTMLButtonElement::blur( )
109 {
110  if(impl)
111  static_cast<HTMLButtonElementImpl*>(impl)->blur();
112 }
113 
114 long HTMLButtonElement::tabIndex() const
115 {
116  if(!impl) return 0;
117  return static_cast<ElementImpl*>(impl)->tabIndex();
118 }
119 
120 void HTMLButtonElement::setTabIndex( long _tabIndex )
121 {
122  if (!impl) return;
123  static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
124 }
125 
126 DOMString HTMLButtonElement::type() const
127 {
128  if(!impl) return DOMString();
129  return static_cast<HTMLButtonElementImpl*>(impl)->type();
130 }
131 
132 DOMString HTMLButtonElement::value() const
133 {
134  if(!impl) return DOMString();
135  DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_VALUE);
136  if (s.isNull()) return DOMString("");
137  return s;
138 }
139 
140 void HTMLButtonElement::setValue( const DOMString &value )
141 {
142  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_VALUE, value);
143 }
144 
145 // --------------------------------------------------------------------------
146 
147 HTMLFieldSetElement::HTMLFieldSetElement() : HTMLElement()
148 {
149 }
150 
151 HTMLFieldSetElement::HTMLFieldSetElement(const HTMLFieldSetElement &other) : HTMLElement(other)
152 {
153 }
154 
155 HTMLFieldSetElement::HTMLFieldSetElement(HTMLFieldSetElementImpl *impl) : HTMLElement(impl)
156 {
157 }
158 
159 HTMLFieldSetElement &HTMLFieldSetElement::operator = (const Node &other)
160 {
161  assignOther( other, ID_FIELDSET );
162  return *this;
163 }
164 
165 HTMLFieldSetElement &HTMLFieldSetElement::operator = (const HTMLFieldSetElement &other)
166 {
167  HTMLElement::operator = (other);
168  return *this;
169 }
170 
171 HTMLFieldSetElement::~HTMLFieldSetElement()
172 {
173 }
174 
175 HTMLFormElement HTMLFieldSetElement::form() const
176 {
177  return Element::form();
178 }
179 
180 // --------------------------------------------------------------------------
181 
182 HTMLFormElement::HTMLFormElement() : HTMLElement()
183 {
184 }
185 
186 HTMLFormElement::HTMLFormElement(const HTMLFormElement &other) : HTMLElement(other)
187 {
188 }
189 
190 HTMLFormElement::HTMLFormElement(HTMLFormElementImpl *impl) : HTMLElement(impl)
191 {
192 }
193 
194 HTMLFormElement &HTMLFormElement::operator = (const Node &other)
195 {
196  assignOther( other, ID_FORM );
197  return *this;
198 }
199 
200 HTMLFormElement &HTMLFormElement::operator = (const HTMLFormElement &other)
201 {
202  HTMLElement::operator = (other);
203  return *this;
204 }
205 
206 HTMLFormElement::~HTMLFormElement()
207 {
208 }
209 
210 HTMLCollection HTMLFormElement::elements() const
211 {
212  if(!impl) return HTMLCollection();
213  return HTMLFormCollection(impl);
214 }
215 
216 long HTMLFormElement::length() const
217 {
218  if(!impl) return 0;
219  return static_cast<HTMLFormElementImpl*>(impl)->length();
220 }
221 
222 DOMString HTMLFormElement::name() const
223 {
224  if(!impl) return DOMString();
225  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_NAME);
226 }
227 
228 void HTMLFormElement::setName( const DOMString &value )
229 {
230  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_NAME, value);
231 }
232 
233 DOMString HTMLFormElement::acceptCharset() const
234 {
235  if(!impl) return DOMString();
236  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCEPT_CHARSET);
237 }
238 
239 void HTMLFormElement::setAcceptCharset( const DOMString &value )
240 {
241  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCEPT_CHARSET, value);
242 }
243 
244 DOMString HTMLFormElement::action() const
245 {
246  if(!impl) return DOMString();
247  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACTION);
248 }
249 
250 void HTMLFormElement::setAction( const DOMString &value )
251 {
252  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACTION, value);
253 }
254 
255 DOMString HTMLFormElement::enctype() const
256 {
257  if(!impl) return DOMString();
258  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ENCTYPE);
259 }
260 
261 void HTMLFormElement::setEnctype( const DOMString &value )
262 {
263  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ENCTYPE, value);
264 }
265 
266 DOMString HTMLFormElement::method() const
267 {
268  if(!impl) return DOMString();
269  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_METHOD);
270 }
271 
272 void HTMLFormElement::setMethod( const DOMString &value )
273 {
274  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_METHOD, value);
275 }
276 
277 DOMString HTMLFormElement::target() const
278 {
279  if(!impl) return DOMString();
280  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_TARGET);
281 }
282 
283 void HTMLFormElement::setTarget( const DOMString &value )
284 {
285  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_TARGET, value);
286 }
287 
288 void HTMLFormElement::submit( )
289 {
290  if(impl) static_cast<HTMLFormElementImpl*>(impl)->submit( );
291 }
292 
293 void HTMLFormElement::reset( )
294 {
295  if(impl) static_cast<HTMLFormElementImpl*>(impl)->reset( );
296 }
297 
298 // --------------------------------------------------------------------------
299 
300 HTMLInputElement::HTMLInputElement() : HTMLElement()
301 {
302 }
303 
304 HTMLInputElement::HTMLInputElement(const HTMLInputElement &other) : HTMLElement(other)
305 {
306 }
307 
308 HTMLInputElement::HTMLInputElement(HTMLInputElementImpl *impl) : HTMLElement(impl)
309 {
310 }
311 
312 HTMLInputElement &HTMLInputElement::operator = (const Node &other)
313 {
314  assignOther( other, ID_INPUT );
315  return *this;
316 }
317 
318 HTMLInputElement &HTMLInputElement::operator = (const HTMLInputElement &other)
319 {
320  HTMLElement::operator = (other);
321  return *this;
322 }
323 
324 HTMLInputElement::~HTMLInputElement()
325 {
326 }
327 
328 DOMString HTMLInputElement::defaultValue() const
329 {
330  if(!impl) return DOMString();
331  DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_VALUE);
332  if (s.isNull()) return DOMString("");
333  return s;
334 
335 }
336 
337 void HTMLInputElement::setDefaultValue( const DOMString &value )
338 {
339  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALUE, value);
340 }
341 
342 bool HTMLInputElement::defaultChecked() const
343 {
344  if(!impl) return 0;
345  return !((ElementImpl *)impl)->getAttribute(ATTR_CHECKED).isNull();
346 }
347 
348 void HTMLInputElement::setDefaultChecked( bool _defaultChecked )
349 {
350  if(impl)
351  ((ElementImpl *)impl)->setAttribute(ATTR_CHECKED, _defaultChecked ? "" : 0);
352 }
353 
354 HTMLFormElement HTMLInputElement::form() const
355 {
356  return Element::form();
357 }
358 
359 DOMString HTMLInputElement::accept() const
360 {
361  if(!impl) return DOMString();
362  return ((ElementImpl *)impl)->getAttribute(ATTR_ACCEPT);
363 }
364 
365 void HTMLInputElement::setAccept( const DOMString &value )
366 {
367  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ACCEPT, value);
368 }
369 
370 DOMString HTMLInputElement::accessKey() const
371 {
372  if(!impl) return DOMString();
373  return ((ElementImpl *)impl)->getAttribute(ATTR_ACCESSKEY);
374 }
375 
376 void HTMLInputElement::setAccessKey( const DOMString &value )
377 {
378  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ACCESSKEY, value);
379 }
380 
381 DOMString HTMLInputElement::align() const
382 {
383  if(!impl) return DOMString();
384  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
385 }
386 
387 void HTMLInputElement::setAlign( const DOMString &value )
388 {
389  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
390 }
391 
392 DOMString HTMLInputElement::alt() const
393 {
394  if(!impl) return DOMString();
395  return ((ElementImpl *)impl)->getAttribute(ATTR_ALT);
396 }
397 
398 void HTMLInputElement::setAlt( const DOMString &value )
399 {
400  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALT, value);
401 }
402 
403 bool HTMLInputElement::checked() const
404 {
405  if(!impl) return 0;
406  return ((HTMLInputElementImpl*)impl)->checked();
407 }
408 
409 void HTMLInputElement::setChecked( bool _checked )
410 {
411  if(impl)
412  ((HTMLInputElementImpl*)impl)->setChecked(_checked);
413 }
414 
415 bool HTMLInputElement::indeterminate() const
416 {
417  if(!impl) return 0;
418  return ((HTMLInputElementImpl*)impl)->indeterminate();
419 }
420 
421 void HTMLInputElement::setIndeterminate( bool _indeterminate )
422 {
423  if(impl)
424  ((HTMLInputElementImpl*)impl)->setIndeterminate(_indeterminate);
425 }
426 
427 bool HTMLInputElement::disabled() const
428 {
429  if(!impl) return 0;
430  return !((ElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
431 }
432 
433 void HTMLInputElement::setDisabled( bool _disabled )
434 {
435  if(impl)
436  {
437  ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
438  }
439 }
440 
441 long HTMLInputElement::maxLength() const
442 {
443  if(!impl) return 0;
444  return ((HTMLInputElementImpl *)impl)->getAttribute(ATTR_MAXLENGTH).toInt();
445 }
446 
447 void HTMLInputElement::setMaxLength( long _maxLength )
448 {
449  if(impl) {
450  DOMString value(TQString::number(_maxLength));
451  ((ElementImpl *)impl)->setAttribute(ATTR_MAXLENGTH,value);
452  }
453 }
454 
455 DOMString HTMLInputElement::name() const
456 {
457  if(!impl) return DOMString();
458  return static_cast<HTMLInputElementImpl* const>(impl)->name();
459 }
460 
461 void HTMLInputElement::setName( const DOMString &value )
462 {
463  if(impl) static_cast<HTMLInputElementImpl*>(impl)->setName(value);
464 }
465 
466 bool HTMLInputElement::readOnly() const
467 {
468  if(!impl) return 0;
469  return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_READONLY).isNull();
470 }
471 
472 void HTMLInputElement::setReadOnly( bool _readOnly )
473 {
474  if(impl)
475  static_cast<ElementImpl*>(impl)->setAttribute(ATTR_READONLY, _readOnly ? "" : 0);
476 }
477 
478 /* The next two are provided for backwards compatibility. */
479 DOMString HTMLInputElement::size() const
480 {
481  if(!impl) return DOMString();
482  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SIZE);
483 }
484 
485 void HTMLInputElement::setSize( const DOMString &value )
486 {
487  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, value);
488 }
489 
490 long HTMLInputElement::getSize() const
491 {
492  if(!impl) return 0;
493  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SIZE).toInt();
494 }
495 
496 void HTMLInputElement::setSize( long value )
497 {
498  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, TQString::number(value));
499 }
500 
501 DOMString HTMLInputElement::src() const
502 {
503  if(!impl) return DOMString();
504  DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SRC);
505  return !s.isNull() ? impl->getDocument()->completeURL( s.string() ) : s;
506 }
507 
508 void HTMLInputElement::setSrc( const DOMString &value )
509 {
510  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SRC, value);
511 }
512 
513 long HTMLInputElement::tabIndex() const
514 {
515  if(!impl) return 0;
516  return static_cast<ElementImpl*>(impl)->tabIndex();
517 }
518 
519 void HTMLInputElement::setTabIndex( long _tabIndex )
520 {
521  if (!impl) return;
522  static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
523 }
524 
525 DOMString HTMLInputElement::type() const
526 {
527  if(!impl) return DOMString();
528  return ((HTMLInputElementImpl *)impl)->type();
529 }
530 
531 void HTMLInputElement::setType(const DOMString& _type)
532 {
533  if (!impl) return;
534  static_cast<HTMLInputElementImpl*>(impl)->setType(_type);
535 }
536 
537 DOMString HTMLInputElement::useMap() const
538 {
539  if(!impl) return DOMString();
540  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_USEMAP);
541 }
542 
543 void HTMLInputElement::setUseMap( const DOMString &value )
544 {
545  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_USEMAP, value);
546 }
547 
548 DOMString HTMLInputElement::value() const
549 {
550  if(!impl) return DOMString();
551  return ((HTMLInputElementImpl*)impl)->value();
552 }
553 
554 void HTMLInputElement::setValue( const DOMString &value )
555 {
556  if (impl)
557  ((HTMLInputElementImpl*)impl)->setValue(value);
558 
559 }
560 
561 void HTMLInputElement::blur( )
562 {
563  if(impl)
564  ((HTMLInputElementImpl*)impl)->blur();
565 }
566 
567 void HTMLInputElement::focus( )
568 {
569  if(impl)
570  ((HTMLInputElementImpl*)impl)->focus();
571 }
572 
573 void HTMLInputElement::select( )
574 {
575  if(impl)
576  ((HTMLInputElementImpl *)impl)->select( );
577 }
578 
579 void HTMLInputElement::click( )
580 {
581  if(impl)
582  ((HTMLInputElementImpl *)impl)->click( );
583 }
584 
585 long HTMLInputElement::selectionStart()
586 {
587  if (impl)
588  return ((HTMLInputElementImpl *)impl)->selectionStart( );
589  return -1;
590 }
591 
592 long HTMLInputElement::selectionEnd()
593 {
594  if (impl)
595  return ((HTMLInputElementImpl *)impl)->selectionEnd( );
596  return -1;
597 }
598 
599 void HTMLInputElement::setSelectionStart(long pos)
600 {
601  if (impl)
602  ((HTMLInputElementImpl *)impl)->setSelectionStart( pos );
603 }
604 
605 void HTMLInputElement::setSelectionEnd(long pos)
606 {
607  if (impl)
608  ((HTMLInputElementImpl *)impl)->setSelectionEnd( pos );
609 }
610 
611 void HTMLInputElement::setSelectionRange(long start, long end)
612 {
613  if (impl)
614  ((HTMLInputElementImpl *)impl)->setSelectionRange( start, end );
615 }
616 
617 // --------------------------------------------------------------------------
618 
619 HTMLLabelElement::HTMLLabelElement() : HTMLElement()
620 {
621 }
622 
623 HTMLLabelElement::HTMLLabelElement(const HTMLLabelElement &other) : HTMLElement(other)
624 {
625 }
626 
627 HTMLLabelElement::HTMLLabelElement(HTMLLabelElementImpl *impl) : HTMLElement(impl)
628 {
629 }
630 
631 HTMLLabelElement &HTMLLabelElement::operator = (const Node &other)
632 {
633  assignOther( other, ID_LABEL );
634  return *this;
635 }
636 
637 HTMLLabelElement &HTMLLabelElement::operator = (const HTMLLabelElement &other)
638 {
639  HTMLElement::operator = (other);
640  return *this;
641 }
642 
643 HTMLLabelElement::~HTMLLabelElement()
644 {
645 }
646 
647 DOMString HTMLLabelElement::accessKey() const
648 {
649  if(!impl) return DOMString();
650  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
651 }
652 
653 void HTMLLabelElement::setAccessKey( const DOMString &value )
654 {
655  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
656 }
657 
658 DOMString HTMLLabelElement::htmlFor() const
659 {
660  if(!impl) return DOMString();
661  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_FOR);
662 }
663 
664 void HTMLLabelElement::setHtmlFor( const DOMString &value )
665 {
666  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_FOR, value);
667 }
668 
669 // --------------------------------------------------------------------------
670 
671 HTMLLegendElement::HTMLLegendElement() : HTMLElement()
672 {
673 }
674 
675 HTMLLegendElement::HTMLLegendElement(const HTMLLegendElement &other) : HTMLElement(other)
676 {
677 }
678 
679 HTMLLegendElement::HTMLLegendElement(HTMLLegendElementImpl *impl) : HTMLElement(impl)
680 {
681 }
682 
683 HTMLLegendElement &HTMLLegendElement::operator = (const Node &other)
684 {
685  assignOther( other, ID_LEGEND );
686  return *this;
687 }
688 
689 HTMLLegendElement &HTMLLegendElement::operator = (const HTMLLegendElement &other)
690 {
691  HTMLElement::operator = (other);
692  return *this;
693 }
694 
695 HTMLLegendElement::~HTMLLegendElement()
696 {
697 }
698 
699 HTMLFormElement HTMLLegendElement::form() const
700 {
701  return Element::form();
702 }
703 
704 DOMString HTMLLegendElement::accessKey() const
705 {
706  if(!impl) return DOMString();
707  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
708 }
709 
710 void HTMLLegendElement::setAccessKey( const DOMString &value )
711 {
712  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
713 }
714 
715 DOMString HTMLLegendElement::align() const
716 {
717  if(!impl) return DOMString();
718  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ALIGN);
719 }
720 
721 void HTMLLegendElement::setAlign( const DOMString &value )
722 {
723  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ALIGN, value);
724 }
725 
726 // --------------------------------------------------------------------------
727 
728 HTMLOptGroupElement::HTMLOptGroupElement() : HTMLElement()
729 {
730 }
731 
732 HTMLOptGroupElement::HTMLOptGroupElement(const HTMLOptGroupElement &other) : HTMLElement(other)
733 {
734 }
735 
736 HTMLOptGroupElement::HTMLOptGroupElement(HTMLOptGroupElementImpl *impl) : HTMLElement(impl)
737 {
738 }
739 
740 HTMLOptGroupElement &HTMLOptGroupElement::operator = (const Node &other)
741 {
742  assignOther( other, ID_OPTGROUP );
743  return *this;
744 }
745 
746 HTMLOptGroupElement &HTMLOptGroupElement::operator = (const HTMLOptGroupElement &other)
747 {
748  HTMLElement::operator = (other);
749  return *this;
750 }
751 
752 HTMLOptGroupElement::~HTMLOptGroupElement()
753 {
754 }
755 
756 bool HTMLOptGroupElement::disabled() const
757 {
758  if(!impl) return 0;
759  return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
760 }
761 
762 void HTMLOptGroupElement::setDisabled( bool _disabled )
763 {
764  if(impl)
765  static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
766 }
767 
768 DOMString HTMLOptGroupElement::label() const
769 {
770  if(!impl) return DOMString();
771  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_LABEL);
772 }
773 
774 void HTMLOptGroupElement::setLabel( const DOMString &value )
775 {
776  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_LABEL, value);
777 }
778 
779 // --------------------------------------------------------------------------
780 
781 HTMLSelectElement::HTMLSelectElement() : HTMLElement()
782 {
783 }
784 
785 HTMLSelectElement::HTMLSelectElement(const HTMLSelectElement &other) : HTMLElement(other)
786 {
787 }
788 
789 HTMLSelectElement::HTMLSelectElement(HTMLSelectElementImpl *impl) : HTMLElement(impl)
790 {
791 }
792 
793 HTMLSelectElement &HTMLSelectElement::operator = (const Node &other)
794 {
795  assignOther( other, ID_SELECT );
796  return *this;
797 }
798 
799 HTMLSelectElement &HTMLSelectElement::operator = (const HTMLSelectElement &other)
800 {
801  HTMLElement::operator = (other);
802  return *this;
803 }
804 
805 HTMLSelectElement::~HTMLSelectElement()
806 {
807 }
808 
809 DOMString HTMLSelectElement::type() const
810 {
811  if(!impl) return DOMString();
812  return ((HTMLSelectElementImpl *)impl)->type();
813 }
814 
815 long HTMLSelectElement::selectedIndex() const
816 {
817  if(!impl) return 0;
818  return ((HTMLSelectElementImpl *)impl)->selectedIndex();
819 }
820 
821 void HTMLSelectElement::setSelectedIndex( long _selectedIndex )
822 {
823  if(impl)
824  ((HTMLSelectElementImpl *)impl)->setSelectedIndex(_selectedIndex);
825 }
826 
827 DOMString HTMLSelectElement::value() const
828 {
829  if(!impl) return DOMString();
830  return static_cast<HTMLSelectElementImpl*>(impl)->value();
831 }
832 
833 void HTMLSelectElement::setValue( const DOMString &value )
834 {
835  if(!impl || value.isNull()) return;
836  static_cast<HTMLSelectElementImpl*>(impl)->setValue(value.implementation());
837 }
838 
839 long HTMLSelectElement::length() const
840 {
841  if(!impl) return 0;
842  return ((HTMLSelectElementImpl *)impl)->length();
843 }
844 
845 HTMLFormElement HTMLSelectElement::form() const
846 {
847  return Element::form();
848 }
849 
850 HTMLCollection HTMLSelectElement::options() const
851 {
852  if(!impl) return HTMLCollection();
853  return HTMLCollection(impl, HTMLCollectionImpl::SELECT_OPTIONS);
854 }
855 
856 bool HTMLSelectElement::disabled() const
857 {
858  if(!impl) return 0;
859  return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
860 }
861 
862 void HTMLSelectElement::setDisabled( bool _disabled )
863 {
864  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
865 }
866 
867 
868 bool HTMLSelectElement::multiple() const
869 {
870  if(!impl) return 0;
871  return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_MULTIPLE).isNull();
872 }
873 
874 void HTMLSelectElement::setMultiple( bool _multiple )
875 {
876  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_MULTIPLE, _multiple ? "" : 0);
877 }
878 
879 DOMString HTMLSelectElement::name() const
880 {
881  if(!impl) return DOMString();
882  return static_cast<HTMLSelectElementImpl* const>(impl)->name();
883 }
884 
885 void HTMLSelectElement::setName( const DOMString &value )
886 {
887  if(impl) static_cast<HTMLSelectElementImpl*>(impl)->setName(value);
888 }
889 
890 long HTMLSelectElement::size() const
891 {
892  if(!impl) return 0;
893  return ((HTMLSelectElementImpl *)impl)->getAttribute(ATTR_SIZE).toInt();
894 }
895 
896 void HTMLSelectElement::setSize( long _size )
897 {
898 
899  if(impl) {
900  DOMString value(TQString::number(_size));
901  static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE,value);
902  }
903 }
904 
905 long HTMLSelectElement::tabIndex() const
906 {
907  if(!impl) return 0;
908  return static_cast<ElementImpl*>(impl)->tabIndex();
909 }
910 
911 void HTMLSelectElement::setTabIndex( long _tabIndex )
912 {
913  if (!impl) return;
914  static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
915 }
916 
917 void HTMLSelectElement::add( const HTMLElement &element, const HTMLElement &before )
918 {
919  if (!impl)
920  throw DOMException(DOMException::NOT_FOUND_ERR);
921 
922  int exceptioncode = 0;
923  static_cast<HTMLSelectElementImpl*>(impl)->add( element, before, exceptioncode );
924  if ( exceptioncode )
925  throw DOMException( exceptioncode );
926 }
927 
928 void HTMLSelectElement::remove( long index )
929 {
930  if(impl) static_cast<HTMLSelectElementImpl*>(impl)->remove( index );
931 }
932 
933 void HTMLSelectElement::blur( )
934 {
935  if(impl)
936  ((HTMLSelectElementImpl*)impl)->blur();
937 }
938 
939 void HTMLSelectElement::focus( )
940 {
941  if(impl)
942  ((HTMLSelectElementImpl*)impl)->focus();
943 }
944 
945 // --------------------------------------------------------------------------
946 
947 HTMLTextAreaElement::HTMLTextAreaElement() : HTMLElement()
948 {
949 }
950 
951 HTMLTextAreaElement::HTMLTextAreaElement(const HTMLTextAreaElement &other) : HTMLElement(other)
952 {
953 }
954 
955 HTMLTextAreaElement::HTMLTextAreaElement(HTMLTextAreaElementImpl *impl) : HTMLElement(impl)
956 {
957 }
958 
959 HTMLTextAreaElement &HTMLTextAreaElement::operator = (const Node &other)
960 {
961  assignOther( other, ID_TEXTAREA );
962  return *this;
963 }
964 
965 HTMLTextAreaElement &HTMLTextAreaElement::operator = (const HTMLTextAreaElement &other)
966 {
967  HTMLElement::operator = (other);
968  return *this;
969 }
970 
971 HTMLTextAreaElement::~HTMLTextAreaElement()
972 {
973 }
974 
975 DOMString HTMLTextAreaElement::defaultValue() const
976 {
977  if(!impl) return DOMString();
978  return ((HTMLTextAreaElementImpl *)impl)->defaultValue();
979 }
980 
981 void HTMLTextAreaElement::setDefaultValue( const DOMString &value )
982 {
983  if (impl) ((HTMLTextAreaElementImpl *)impl)->setDefaultValue(value);
984 }
985 
986 HTMLFormElement HTMLTextAreaElement::form() const
987 {
988  return Element::form();
989 }
990 
991 DOMString HTMLTextAreaElement::accessKey() const
992 {
993  if(!impl) return DOMString();
994  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
995 }
996 
997 void HTMLTextAreaElement::setAccessKey( const DOMString &value )
998 {
999  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
1000 }
1001 
1002 long HTMLTextAreaElement::cols() const
1003 {
1004  if(!impl) return 0;
1005  return ((HTMLTextAreaElementImpl *)impl)->getAttribute(ATTR_COLS).toInt();
1006 }
1007 
1008 void HTMLTextAreaElement::setCols( long _cols )
1009 {
1010 
1011  if(impl) {
1012  DOMString value(TQString::number(_cols));
1013  static_cast<ElementImpl*>(impl)->setAttribute(ATTR_COLS,value);
1014  }
1015 }
1016 
1017 bool HTMLTextAreaElement::disabled() const
1018 {
1019  if(!impl) return 0;
1020  return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
1021 }
1022 
1023 void HTMLTextAreaElement::setDisabled( bool _disabled )
1024 {
1025  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
1026 }
1027 
1028 DOMString HTMLTextAreaElement::name() const
1029 {
1030  if(!impl) return DOMString();
1031  return static_cast<HTMLTextAreaElementImpl* const>(impl)->name();
1032 }
1033 
1034 void HTMLTextAreaElement::setName( const DOMString &value )
1035 {
1036  if(impl) static_cast<HTMLTextAreaElementImpl*>(impl)->setName(value);
1037 }
1038 
1039 bool HTMLTextAreaElement::readOnly() const
1040 {
1041  if(!impl) return 0;
1042  return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_READONLY).isNull();
1043 }
1044 
1045 void HTMLTextAreaElement::setReadOnly( bool _readOnly )
1046 {
1047  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_READONLY, _readOnly ? "" : 0);
1048 }
1049 
1050 long HTMLTextAreaElement::rows() const
1051 {
1052  if(!impl) return 0;
1053  return ((HTMLTextAreaElementImpl *)impl)->getAttribute(ATTR_ROWS).toInt();
1054 }
1055 
1056 void HTMLTextAreaElement::setRows( long _rows )
1057 {
1058 
1059  if(impl) {
1060  DOMString value(TQString::number(_rows));
1061  static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ROWS,value);
1062  }
1063 }
1064 
1065 long HTMLTextAreaElement::tabIndex() const
1066 {
1067  if(!impl) return 0;
1068  return static_cast<ElementImpl*>(impl)->tabIndex();
1069 }
1070 
1071 void HTMLTextAreaElement::setTabIndex( long _tabIndex )
1072 {
1073  if (!impl) return;
1074  static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
1075 }
1076 
1077 DOMString HTMLTextAreaElement::type() const
1078 {
1079  if(!impl) return DOMString();
1080  return ((HTMLTextAreaElementImpl *)impl)->type();
1081 }
1082 
1083 DOMString HTMLTextAreaElement::value() const
1084 {
1085  if(!impl) return DOMString();
1086  return ((HTMLTextAreaElementImpl *)impl)->value();
1087 }
1088 
1089 void HTMLTextAreaElement::setValue( const DOMString &value )
1090 {
1091  if(impl) ((HTMLTextAreaElementImpl *)impl)->setValue(value);
1092 }
1093 
1094 void HTMLTextAreaElement::blur( )
1095 {
1096  if(impl)
1097  ((HTMLTextAreaElementImpl*)impl)->blur();
1098 }
1099 
1100 void HTMLTextAreaElement::focus( )
1101 {
1102  if(impl)
1103  ((HTMLTextAreaElementImpl*)impl)->focus();
1104 }
1105 
1106 void HTMLTextAreaElement::select( )
1107 {
1108  if(impl)
1109  ((HTMLTextAreaElementImpl *)impl)->select( );
1110 }
1111 
1112 long HTMLTextAreaElement::selectionStart()
1113 {
1114  if (impl)
1115  return ((HTMLTextAreaElementImpl *)impl)->selectionStart( );
1116  return 0;
1117 }
1118 
1119 long HTMLTextAreaElement::selectionEnd()
1120 {
1121  if (impl)
1122  return ((HTMLTextAreaElementImpl *)impl)->selectionEnd( );
1123  return 0;
1124 }
1125 
1126 long HTMLTextAreaElement::textLength()
1127 {
1128  if (impl)
1129  return ((HTMLTextAreaElementImpl *)impl)->textLength( );
1130  return 0;
1131 }
1132 
1133 void HTMLTextAreaElement::setSelectionStart(long pos)
1134 {
1135  if (impl)
1136  ((HTMLTextAreaElementImpl *)impl)->setSelectionStart( pos );
1137 }
1138 
1139 void HTMLTextAreaElement::setSelectionEnd(long pos)
1140 {
1141  if (impl)
1142  ((HTMLTextAreaElementImpl *)impl)->setSelectionEnd( pos );
1143 }
1144 
1145 void HTMLTextAreaElement::setSelectionRange(long start, long end)
1146 {
1147  if (impl)
1148  ((HTMLTextAreaElementImpl *)impl)->setSelectionRange( start, end );
1149 }
1150 
1151 // --------------------------------------------------------------------------
1152 
1153 HTMLOptionElement::HTMLOptionElement() : HTMLElement()
1154 {
1155 }
1156 
1157 HTMLOptionElement::HTMLOptionElement(const HTMLOptionElement &other) : HTMLElement(other)
1158 {
1159 }
1160 
1161 HTMLOptionElement::HTMLOptionElement(HTMLOptionElementImpl *impl) : HTMLElement(impl)
1162 {
1163 }
1164 
1165 HTMLOptionElement &HTMLOptionElement::operator = (const Node &other)
1166 {
1167  assignOther( other, ID_OPTION );
1168  return *this;
1169 }
1170 
1171 HTMLOptionElement &HTMLOptionElement::operator = (const HTMLOptionElement &other)
1172 {
1173  HTMLElement::operator = (other);
1174  return *this;
1175 }
1176 
1177 HTMLOptionElement::~HTMLOptionElement()
1178 {
1179 }
1180 
1181 HTMLFormElement HTMLOptionElement::form() const
1182 {
1183  return Element::form();
1184 }
1185 
1186 bool HTMLOptionElement::defaultSelected() const
1187 {
1188  if(!impl) return 0;
1189  return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SELECTED).isNull();
1190 }
1191 
1192 void HTMLOptionElement::setDefaultSelected( bool _defaultSelected )
1193 {
1194  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SELECTED, _defaultSelected ? "" : 0);
1195 }
1196 
1197 DOMString HTMLOptionElement::text() const
1198 {
1199  if(!impl) return DOMString();
1200  return ((HTMLOptionElementImpl *)impl)->text();
1201 }
1202 
1203 long HTMLOptionElement::index() const
1204 {
1205  if(!impl) return 0;
1206  return ((HTMLOptionElementImpl *)impl)->index();
1207 }
1208 
1209 void HTMLOptionElement::setIndex( long /*_index*/ )
1210 {
1211  throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
1212 }
1213 
1214 bool HTMLOptionElement::disabled() const
1215 {
1216  if(!impl) return 0;
1217  return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
1218 }
1219 
1220 void HTMLOptionElement::setDisabled( bool _disabled )
1221 {
1222  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
1223 }
1224 
1225 DOMString HTMLOptionElement::label() const
1226 {
1227  if(!impl) return DOMString();
1228  return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_LABEL);
1229 }
1230 
1231 void HTMLOptionElement::setLabel( const DOMString &value )
1232 {
1233  if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_LABEL, value);
1234 }
1235 
1236 bool HTMLOptionElement::selected() const
1237 {
1238  if(!impl) return 0;
1239  return ((HTMLOptionElementImpl *)impl)->selected();
1240 }
1241 
1242 void HTMLOptionElement::setSelected(bool _selected) {
1243  if(!impl) return;
1244  ((HTMLOptionElementImpl *)impl)->setSelected(_selected);
1245 }
1246 
1247 DOMString HTMLOptionElement::value() const
1248 {
1249  if(!impl) return DOMString();
1250  return static_cast<HTMLOptionElementImpl*>(impl)->value();
1251 }
1252 
1253 void HTMLOptionElement::setValue( const DOMString &value )
1254 {
1255  if(impl) static_cast<HTMLOptionElementImpl*>(impl)->setValue(value.implementation());
1256 }
1257 
1258 // -----------------------------------------------------------------------------
1259 
1260 HTMLIsIndexElement::HTMLIsIndexElement() : HTMLElement()
1261 {
1262 }
1263 
1264 HTMLIsIndexElement::HTMLIsIndexElement(const HTMLIsIndexElement &other) : HTMLElement(other)
1265 {
1266 }
1267 
1268 HTMLIsIndexElement::HTMLIsIndexElement(HTMLIsIndexElementImpl *impl) : HTMLElement(impl)
1269 {
1270 }
1271 
1272 HTMLIsIndexElement &HTMLIsIndexElement::operator = (const Node &other)
1273 {
1274  assignOther( other, ID_ISINDEX );
1275  return *this;
1276 }
1277 
1278 HTMLIsIndexElement &HTMLIsIndexElement::operator = (const HTMLIsIndexElement &other)
1279 {
1280  HTMLElement::operator = (other);
1281  return *this;
1282 }
1283 
1284 HTMLIsIndexElement::~HTMLIsIndexElement()
1285 {
1286 }
1287 
1288 HTMLFormElement HTMLIsIndexElement::form() const
1289 {
1290  return Element::form();
1291 }
1292 
1293 DOMString HTMLIsIndexElement::prompt() const
1294 {
1295  if(!impl) return DOMString();
1296  return static_cast<HTMLIsIndexElementImpl*>(impl)->prompt();
1297 }
1298 
1299 void HTMLIsIndexElement::setPrompt( const DOMString &value )
1300 {
1301  if(impl) static_cast<HTMLIsIndexElementImpl*>(impl)->setPrompt(value);
1302 }

khtml

Skip menu "khtml"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

khtml

Skip menu "khtml"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for khtml by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |