KHtml

html_object.cpp
1 /**
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright 1999 Lars Knoll ([email protected])
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  */
22 
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 
void setHspace(long)
see hspace
DOMString name() const
The name of a run-time parameter.
void setData(const DOMString &)
see data
void setCodeType(const DOMString &)
see codeType
QString number(int n, int base)
DOMString codeBase() const
Base URI for classid , data , and archive attributes.
DOMString object() const
Serialized applet file.
DOMString type() const
Content type for data downloaded via data attribute.
void setTabIndex(long)
see tabIndex
All HTML element interfaces derive from this class.
Definition: html_element.h:70
void setVspace(long)
see vspace
DOMString value() const
The value of a run-time parameter.
long tabIndex() const
Index that represents the element's position in the tabbing order.
Generic embedded object.
Definition: html_object.h:268
void setType(const DOMString &)
see type
Element form() const
KHTML extension to DOM This method returns the associated form element.
DOMString useMap() const
Use client-side image map.
DOMString type() const
Content type for the value attribute when valuetype has the value "ref".
DOMString name() const
The name of the applet.
This library provides a full-featured HTML parser and widget.
void setType(const DOMString &)
see type
long getHspace() const
Horizontal space, in pixels, to the left and right of this image, applet, or object.
DOMString data() const
A URI specifying the location of the object's data.
DOMString archive() const
Space-separated list of archives.
void setAlign(const DOMString &)
see align
void setArchive(const DOMString &)
see archive
void setCodeBase(const DOMString &)
see codeBase
DOMString alt() const
Alternate text for user agents not rendering the normal content of this element.
Definition: html_object.cpp:75
DOMString align() const
Aligns this object (vertically or horizontally) with respect to its surrounding text.
DOMString code() const
Applet class file.
DOMString name() const
Form control or object name when submitted with a form.
void setStandby(const DOMString &)
see standby
DOMString codeType() const
Content type for data downloaded via classid attribute.
The FORM element encompasses behavior similar to a collection and an element.
Definition: html_form.h:207
KHTML_DEPRECATED DOMString hspace() const
void setVspace(long)
see vspace
HTMLFormElement form() const
Returns the FORM element containing this control.
long getVspace() const
Vertical space, in pixels, above and below this image, applet, or object.
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:246
void setObject(const DOMString &)
see object
void setValue(const DOMString &)
see value
void setBorder(const DOMString &)
see border
void setArchive(const DOMString &)
see archive
Definition: html_object.cpp:98
KHTML_DEPRECATED DOMString vspace() const
void setHeight(const DOMString &)
see height
void setHeight(const DOMString &)
see height
void setAlign(const DOMString &)
see align
Definition: html_object.cpp:68
DOMString standby() const
Message to render while loading the object.
Document contentDocument() const
Introduced in DOM Level 2.
DOMString archive() const
Comma-separated archive list.
Definition: html_object.cpp:90
long getHspace() const
Horizontal space, in pixels, to the left and right of this image, applet, or object.
void setName(const DOMString &)
see name
DOMString codeBase() const
Optional base URI for applet.
void setName(const DOMString &)
see name
DOMString width() const
Override width.
void setValueType(const DOMString &)
see valueType
void setDeclare(bool)
see declare
KHTML_DEPRECATED DOMString hspace() const
bool declare() const
Declare (for future reference), but do not instantiate, this object.
DOMString height() const
Override height.
void setName(const DOMString &)
see name
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOMString height() const
Override height.
void setWidth(const DOMString &)
see width
void setCodeBase(const DOMString &value)
see codeBase
void setWidth(const DOMString &)
see width
DOMString code() const
Applet class file.
void setCode(const DOMString &)
see code
KHTML_DEPRECATED DOMString vspace() const
An embedded Java applet.
Definition: html_object.h:50
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:278
DOMString width() const
Override width.
DOMString border() const
Width of border around the object.
long getVspace() const
Vertical space, in pixels, above and below this image, applet, or object.
void setHspace(long)
see hspace
DOMString valueType() const
Information about the meaning of the value attribute value.
void setCode(const DOMString &)
see code
void setAlt(const DOMString &)
see alt
Definition: html_object.cpp:83
void setUseMap(const DOMString &)
see useMap
Parameters fed to the OBJECT element.
Definition: html_object.h:577
DOMString align() const
Aligns this object (vertically or horizontally) with respect to its surrounding text.
Definition: html_object.cpp:60
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.