KHtml

html_object.cpp
1 
23 #include "html_object.h"
24 #include "dom_doc.h"
25 
26 #include <html/html_objectimpl.h>
27 
28 using namespace DOM;
29 
30 HTMLAppletElement::HTMLAppletElement() : HTMLElement()
31 {
32 }
33 
34 HTMLAppletElement::HTMLAppletElement(const HTMLAppletElement &other)
35  : HTMLElement(other)
36 {
37 }
38 
39 HTMLAppletElement::HTMLAppletElement(HTMLAppletElementImpl *impl)
40  : HTMLElement(impl)
41 {
42 }
43 
44 HTMLAppletElement &HTMLAppletElement::operator = (const Node &other)
45 {
46  assignOther(other, ID_APPLET);
47  return *this;
48 }
49 
50 HTMLAppletElement &HTMLAppletElement::operator = (const HTMLAppletElement &other)
51 {
52  HTMLElement::operator = (other);
53  return *this;
54 }
55 
56 HTMLAppletElement::~HTMLAppletElement()
57 {
58 }
59 
61 {
62  if (!impl) {
63  return DOMString();
64  }
65  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
66 }
67 
69 {
70  if (impl) {
71  ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
72  }
73 }
74 
76 {
77  if (!impl) {
78  return DOMString();
79  }
80  return ((ElementImpl *)impl)->getAttribute(ATTR_ALT);
81 }
82 
84 {
85  if (impl) {
86  ((ElementImpl *)impl)->setAttribute(ATTR_ALT, value);
87  }
88 }
89 
91 {
92  if (!impl) {
93  return DOMString();
94  }
95  return ((ElementImpl *)impl)->getAttribute(ATTR_ARCHIVE);
96 }
97 
99 {
100  if (impl) {
101  ((ElementImpl *)impl)->setAttribute(ATTR_ARCHIVE, value);
102  }
103 }
104 
106 {
107  if (!impl) {
108  return DOMString();
109  }
110  return ((ElementImpl *)impl)->getAttribute(ATTR_CODE);
111 }
112 
114 {
115  if (impl) {
116  ((ElementImpl *)impl)->setAttribute(ATTR_CODE, value);
117  }
118 }
119 
121 {
122  if (!impl) {
123  return DOMString();
124  }
125  return ((ElementImpl *)impl)->getAttribute(ATTR_CODEBASE);
126 }
127 
129 {
130  if (impl) {
131  ((ElementImpl *)impl)->setAttribute(ATTR_CODEBASE, value);
132  }
133 }
134 
136 {
137  if (!impl) {
138  return DOMString();
139  }
140  return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT);
141 }
142 
144 {
145  if (impl) {
146  ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value);
147  }
148 }
149 
150 #ifndef KHTML_NO_DEPRECATED
152 {
153  if (!impl) {
154  return DOMString();
155  }
156  return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE);
157 }
158 #endif
159 
160 #ifndef KHTML_NO_DEPRECATED
162 {
163  if (impl) {
164  ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, value);
165  }
166 }
167 #endif
168 
170 {
171  if (!impl) {
172  return 0;
173  }
174  return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE).toInt();
175 }
176 
178 {
179  if (impl) {
180  ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value));
181  }
182 }
183 
185 {
186  if (!impl) {
187  return DOMString();
188  }
189  return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
190 }
191 
193 {
194  if (impl) {
195  ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
196  }
197 }
198 
200 {
201  if (!impl) {
202  return DOMString();
203  }
204  return ((ElementImpl *)impl)->getAttribute(ATTR_OBJECT);
205 }
206 
208 {
209  if (impl) {
210  ((ElementImpl *)impl)->setAttribute(ATTR_OBJECT, value);
211  }
212 }
213 
214 #ifndef KHTML_NO_DEPRECATED
216 {
217  if (!impl) {
218  return DOMString();
219  }
220  return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE);
221 }
222 #endif
223 
224 #ifndef KHTML_NO_DEPRECATED
226 {
227  if (impl) {
228  ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, value);
229  }
230 }
231 #endif
232 
234 {
235  if (!impl) {
236  return 0;
237  }
238  return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE).toInt();
239 }
240 
242 {
243  if (impl) {
244  ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, QString::number(value));
245  }
246 }
247 
249 {
250  if (!impl) {
251  return DOMString();
252  }
253  return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
254 }
255 
257 {
258  if (impl) {
259  ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
260  }
261 }
262 
263 // --------------------------------------------------------------------------
264 
265 HTMLObjectElement::HTMLObjectElement() : HTMLElement()
266 {
267 }
268 
269 HTMLObjectElement::HTMLObjectElement(const HTMLObjectElement &other) : HTMLElement(other)
270 {
271 }
272 
273 HTMLObjectElement::HTMLObjectElement(HTMLObjectElementImpl *impl) : HTMLElement(impl)
274 {
275 }
276 
277 HTMLObjectElement &HTMLObjectElement::operator = (const Node &other)
278 {
279  assignOther(other, ID_OBJECT);
280  return *this;
281 }
282 
283 HTMLObjectElement &HTMLObjectElement::operator = (const HTMLObjectElement &other)
284 {
285  HTMLElement::operator = (other);
286  return *this;
287 }
288 
289 HTMLObjectElement::~HTMLObjectElement()
290 {
291 }
292 
294 {
295  if (!impl) {
296  return nullptr;
297  }
298  return ((HTMLObjectElementImpl *)impl)->form();
299 }
300 
302 {
303  if (!impl) {
304  return DOMString();
305  }
306  return ((ElementImpl *)impl)->getAttribute(ATTR_CODE);
307 }
308 
310 {
311  if (impl) {
312  ((ElementImpl *)impl)->setAttribute(ATTR_CODE, value);
313  }
314 }
315 
317 {
318  if (!impl) {
319  return DOMString();
320  }
321  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
322 }
323 
325 {
326  if (impl) {
327  ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
328  }
329 }
330 
332 {
333  if (!impl) {
334  return DOMString();
335  }
336  return ((ElementImpl *)impl)->getAttribute(ATTR_ARCHIVE);
337 }
338 
340 {
341  if (impl) {
342  ((ElementImpl *)impl)->setAttribute(ATTR_ARCHIVE, value);
343  }
344 }
345 
347 {
348  if (!impl) {
349  return DOMString();
350  }
351  return ((ElementImpl *)impl)->getAttribute(ATTR_BORDER);
352 }
353 
355 {
356  if (impl) {
357  ((ElementImpl *)impl)->setAttribute(ATTR_BORDER, value);
358  }
359 }
360 
362 {
363  if (!impl) {
364  return DOMString();
365  }
366  return ((ElementImpl *)impl)->getAttribute(ATTR_CODEBASE);
367 }
368 
370 {
371  if (impl) {
372  ((ElementImpl *)impl)->setAttribute(ATTR_CODEBASE, value);
373  }
374 }
375 
377 {
378  if (!impl) {
379  return DOMString();
380  }
381  return ((ElementImpl *)impl)->getAttribute(ATTR_CODETYPE);
382 }
383 
385 {
386  if (impl) {
387  ((ElementImpl *)impl)->setAttribute(ATTR_CODETYPE, value);
388  }
389 }
390 
392 {
393  if (!impl) {
394  return DOMString();
395  }
396  return ((ElementImpl *)impl)->getAttribute(ATTR_DATA);
397 }
398 
400 {
401  if (impl) {
402  ((ElementImpl *)impl)->setAttribute(ATTR_DATA, value);
403  }
404 }
405 
407 {
408  if (!impl) {
409  return 0;
410  }
411  return !((ElementImpl *)impl)->getAttribute(ATTR_DECLARE).isNull();
412 }
413 
414 void HTMLObjectElement::setDeclare(bool _declare)
415 {
416  if (impl) {
417  DOMString str;
418  if (_declare) {
419  str = "";
420  }
421  ((ElementImpl *)impl)->setAttribute(ATTR_DECLARE, str);
422  }
423 }
424 
426 {
427  if (!impl) {
428  return DOMString();
429  }
430  return ((ElementImpl *)impl)->getAttribute(ATTR_HEIGHT);
431 }
432 
434 {
435  if (impl) {
436  ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, value);
437  }
438 }
439 
440 #ifndef KHTML_NO_DEPRECATED
442 {
443  if (!impl) {
444  return DOMString();
445  }
446  return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE);
447 }
448 #endif
449 
450 #ifndef KHTML_NO_DEPRECATED
452 {
453  if (impl) {
454  ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, value);
455  }
456 }
457 #endif
458 
460 {
461  if (!impl) {
462  return 0;
463  }
464  return ((ElementImpl *)impl)->getAttribute(ATTR_HSPACE).toInt();
465 }
466 
468 {
469  if (impl) {
470  ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value));
471  }
472 }
473 
475 {
476  if (!impl) {
477  return DOMString();
478  }
479  return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
480 }
481 
483 {
484  if (impl) {
485  ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
486  }
487 }
488 
490 {
491  if (!impl) {
492  return DOMString();
493  }
494  return ((ElementImpl *)impl)->getAttribute(ATTR_STANDBY);
495 }
496 
498 {
499  if (impl) {
500  ((ElementImpl *)impl)->setAttribute(ATTR_STANDBY, value);
501  }
502 }
503 
505 {
506  if (!impl) {
507  return 0;
508  }
509  return ((ElementImpl *)impl)->getAttribute(ATTR_TABINDEX).toInt();
510 }
511 
512 void HTMLObjectElement::setTabIndex(long _tabIndex)
513 {
514  if (impl) {
515  DOMString value(QString::number(_tabIndex));
516  ((ElementImpl *)impl)->setAttribute(ATTR_TABINDEX, value);
517  }
518 }
519 
521 {
522  if (!impl) {
523  return DOMString();
524  }
525  return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
526 }
527 
529 {
530  if (impl) {
531  ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
532  }
533 }
534 
536 {
537  if (!impl) {
538  return DOMString();
539  }
540  return ((ElementImpl *)impl)->getAttribute(ATTR_USEMAP);
541 }
542 
544 {
545  if (impl) {
546  ((ElementImpl *)impl)->setAttribute(ATTR_USEMAP, value);
547  }
548 }
549 
550 #ifndef KHTML_NO_DEPRECATED
552 {
553  if (!impl) {
554  return DOMString();
555  }
556  return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE);
557 }
558 #endif
559 
560 #ifndef KHTML_NO_DEPRECATED
562 {
563  if (impl) {
564  ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, value);
565  }
566 }
567 #endif
568 
570 {
571  if (!impl) {
572  return 0;
573  }
574  return ((ElementImpl *)impl)->getAttribute(ATTR_VSPACE).toInt();
575 }
576 
578 {
579  if (impl) {
580  ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, QString::number(value));
581  }
582 }
583 
585 {
586  if (!impl) {
587  return DOMString();
588  }
589  return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
590 }
591 
593 {
594  if (impl) {
595  ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
596  }
597 }
598 
600 {
601  if (impl) {
602  return static_cast<HTMLObjectElementImpl *>(impl)->contentDocument();
603  }
604  return Document();
605 }
606 
607 // --------------------------------------------------------------------------
608 
609 HTMLParamElement::HTMLParamElement() : HTMLElement()
610 {
611 }
612 
613 HTMLParamElement::HTMLParamElement(const HTMLParamElement &other) : HTMLElement(other)
614 {
615 }
616 
617 HTMLParamElement::HTMLParamElement(HTMLParamElementImpl *impl) : HTMLElement(impl)
618 {
619 }
620 
621 HTMLParamElement &HTMLParamElement::operator = (const Node &other)
622 {
623  assignOther(other, ID_PARAM);
624  return *this;
625 }
626 
627 HTMLParamElement &HTMLParamElement::operator = (const HTMLParamElement &other)
628 {
629  HTMLElement::operator = (other);
630  return *this;
631 }
632 
633 HTMLParamElement::~HTMLParamElement()
634 {
635 }
636 
638 {
639  if (!impl) {
640  return DOMString();
641  }
642  return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
643 }
644 
646 {
647  if (impl) {
648  ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
649  }
650 }
651 
653 {
654  if (!impl) {
655  return DOMString();
656  }
657  return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
658 }
659 
661 {
662  if (impl) {
663  ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
664  }
665 }
666 
668 {
669  if (!impl) {
670  return DOMString();
671  }
672  return ((ElementImpl *)impl)->getAttribute(ATTR_VALUE);
673 }
674 
676 {
677  if (impl) {
678  ((ElementImpl *)impl)->setAttribute(ATTR_VALUE, value);
679  }
680 }
681 
683 {
684  if (!impl) {
685  return DOMString();
686  }
687  return ((ElementImpl *)impl)->getAttribute(ATTR_VALUETYPE);
688 }
689 
691 {
692  if (impl) {
693  ((ElementImpl *)impl)->setAttribute(ATTR_VALUETYPE, value);
694  }
695 }
696 
DOMString object() const
Serialized applet file.
DOMString archive() const
Comma-separated archive list.
Definition: html_object.cpp:90
DOMString width() const
Override width.
void setBorder(const DOMString &)
see border
KHTML_DEPRECATED DOMString hspace() const
DOMString name() const
The name of a run-time parameter.
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:278
long getHspace() const
Horizontal space, in pixels, to the left and right of this image, applet, or object.
HTMLFormElement form() const
Returns the FORM element containing this control.
void setCode(const DOMString &)
see code
void setName(const DOMString &)
see name
long getVspace() const
Vertical space, in pixels, above and below this image, applet, or object.
bool declare() const
Declare (for future reference), but do not instantiate, this object.
void setArchive(const DOMString &)
see archive
DOMString valueType() const
Information about the meaning of the value attribute value.
void setType(const DOMString &)
see type
void setCode(const DOMString &)
see code
The FORM element encompasses behavior similar to a collection and an element.
Definition: html_form.h:207
void setHspace(long)
see hspace
void setAlign(const DOMString &)
see align
Definition: html_object.cpp:68
DOMString value() const
The value of a run-time parameter.
void setHeight(const DOMString &)
see height
Document contentDocument() const
Introduced in DOM Level 2.
DOMString border() const
Width of border around the object.
void setDeclare(bool)
see declare
DOMString code() const
Applet class file.
DOMString archive() const
Space-separated list of archives.
void setHspace(long)
see hspace
DOMString codeBase() const
Base URI for classid , data , and archive attributes.
void setValue(const DOMString &)
see value
void setData(const DOMString &)
see data
long getHspace() const
Horizontal space, in pixels, to the left and right of this image, applet, or object.
void setCodeType(const DOMString &)
see codeType
An embedded Java applet.
Definition: html_object.h:50
Parameters fed to the OBJECT element.
Definition: html_object.h:577
QString number(int n, int base)
long tabIndex() const
Index that represents the element&#39;s position in the tabbing order.
DOMString align() const
Aligns this object (vertically or horizontally) with respect to its surrounding text.
void setArchive(const DOMString &)
see archive
Definition: html_object.cpp:98
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:246
DOMString name() const
Form control or object name when submitted with a form.
DOMString type() const
Content type for data downloaded via data attribute.
Generic embedded object.
Definition: html_object.h:268
void setUseMap(const DOMString &)
see useMap
DOMString data() const
A URI specifying the location of the object&#39;s data.
DOMString height() const
Override height.
DOMString type() const
Content type for the value attribute when valuetype has the value "ref".
This library provides a full-featured HTML parser and widget.
void setName(const DOMString &)
see name
void setWidth(const DOMString &)
see width
void setVspace(long)
see vspace
void setType(const DOMString &)
see type
DOMString codeBase() const
Optional base URI for applet.
void setObject(const DOMString &)
see object
DOMString name() const
The name of the applet.
DOMString code() const
Applet class file.
void setAlign(const DOMString &)
see align
void setValueType(const DOMString &)
see valueType
Element form() const
KHTML extension to DOM This method returns the associated form element.
void setTabIndex(long)
see tabIndex
void setAlt(const DOMString &)
see alt
Definition: html_object.cpp:83
void setVspace(long)
see vspace
void setHeight(const DOMString &)
see height
DOMString align() const
Aligns this object (vertically or horizontally) with respect to its surrounding text.
Definition: html_object.cpp:60
void setStandby(const DOMString &)
see standby
KHTML_DEPRECATED DOMString vspace() const
DOMString codeType() const
Content type for data downloaded via classid attribute.
long getVspace() const
Vertical space, in pixels, above and below this image, applet, or object.
KHTML_DEPRECATED DOMString vspace() const
DOMString standby() const
Message to render while loading the object.
void setCodeBase(const DOMString &)
see codeBase
DOMString height() const
Override height.
DOMString width() const
Override width.
KHTML_DEPRECATED DOMString hspace() const
void setWidth(const DOMString &)
see width
DOMString useMap() const
Use client-side image map.
void setName(const DOMString &)
see name
All HTML element interfaces derive from this class.
Definition: html_element.h:70
void setCodeBase(const DOMString &value)
see codeBase
DOMString alt() const
Alternate text for user agents not rendering the normal content of this element.
Definition: html_object.cpp:75
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Nov 27 2020 22:47:41 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.