2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
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.
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.
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.
23 #ifndef HTMLObjectElement_h
24 #define HTMLObjectElement_h
26 #include "FormAssociatedElement.h"
27 #include "HTMLPlugInImageElement.h"
31 class HTMLFormElement;
33 class HTMLObjectElement : public HTMLPlugInImageElement, public FormAssociatedElement {
35 static PassRefPtr<HTMLObjectElement> create(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
36 virtual ~HTMLObjectElement();
38 bool isDocNamedItem() const { return m_docNamedItem; }
40 const String& classId() const { return m_classId; }
42 bool containsJavaApplet() const;
44 virtual bool useFallbackContent() const { return m_useFallbackContent; }
45 void renderFallbackContent();
47 // Implementations of FormAssociatedElement
48 HTMLFormElement* form() const { return FormAssociatedElement::form(); }
50 virtual bool isFormControlElement() const { return false; }
52 virtual bool isEnumeratable() const { return true; }
53 virtual bool appendFormData(FormDataList&, bool);
55 // Implementations of constraint validation API.
56 // Note that the object elements are always barred from constraint validation.
57 String validationMessage() { return String(); }
58 bool checkValidity() { return true; }
59 void setCustomValidity(const String&) { }
61 virtual void attributeChanged(Attribute*, bool preserveDecls = false);
63 using TreeShared<ContainerNode>::ref;
64 using TreeShared<ContainerNode>::deref;
67 HTMLObjectElement(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
69 virtual void parseMappedAttribute(Attribute*);
70 virtual void insertedIntoTree(bool deep);
71 virtual void removedFromTree(bool deep);
73 virtual bool rendererIsNeeded(RenderStyle*);
74 virtual void insertedIntoDocument();
75 virtual void removedFromDocument();
77 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
79 virtual bool isURLAttribute(Attribute*) const;
80 virtual const QualifiedName& imageSourceAttributeName() const;
82 virtual RenderWidget* renderWidgetForJSBindings() const;
84 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
86 virtual void updateWidget(bool onlyCreateNonNetscapePlugins);
87 void updateDocNamedItem();
89 bool hasFallbackContent() const;
91 // FIXME: This function should not deal with url or serviceType
92 // so that we can better share code between <object> and <embed>.
93 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType);
95 bool hasValidClassId();
97 virtual void refFormAssociatedElement() { ref(); }
98 virtual void derefFormAssociatedElement() { deref(); }
100 virtual const AtomicString& formControlName() const;
104 bool m_docNamedItem : 1;
105 bool m_useFallbackContent : 1;