2
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3
* (C) 1999 Antti Koivisto (koivisto@kde.org)
4
* Copyright (C) 2004, 2005, 2006, 2007 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., 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
26
#include "StyledElement.h"
30
class DocumentFragment;
32
class HTMLFormElement;
34
enum HTMLTagStatus { TagStatusOptional, TagStatusRequired, TagStatusForbidden };
36
class HTMLElement : public StyledElement {
38
HTMLElement(const QualifiedName& tagName, Document*);
39
virtual ~HTMLElement();
41
virtual bool isHTMLElement() const { return true; }
43
virtual String nodeName() const;
45
virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
46
virtual void parseMappedAttribute(MappedAttribute*);
48
virtual PassRefPtr<Node> cloneNode(bool deep);
50
PassRefPtr<HTMLCollection> children();
53
void setId(const String&);
54
virtual String title() const;
55
void setTitle(const String&);
57
void setLang(const String&);
59
void setDir(const String&);
60
String className() const;
61
void setClassName(const String&);
63
String innerHTML() const;
64
String outerHTML() const;
65
PassRefPtr<DocumentFragment> createContextualFragment(const String&);
66
void setInnerHTML(const String&, ExceptionCode&);
67
void setOuterHTML(const String&, ExceptionCode&);
68
void setInnerText(const String&, ExceptionCode&);
69
void setOuterText(const String&, ExceptionCode&);
71
virtual bool isFocusable() const;
72
virtual bool isContentEditable() const;
73
virtual bool isContentRichlyEditable() const;
74
virtual String contentEditable() const;
75
virtual void setContentEditable(MappedAttribute*);
76
virtual void setContentEditable(const String&);
80
virtual void accessKeyAction(bool sendToAnyElement);
82
virtual bool isGenericFormElement() const { return false; }
84
virtual String toString() const;
86
virtual HTMLTagStatus endTagRequirement() const;
87
virtual int tagPriority() const;
88
virtual bool childAllowed(Node* newChild); // Error-checking during parsing that checks the DTD
90
// Helper function to check the DTD for a given child node.
91
virtual bool checkDTD(const Node*);
92
static bool inEitherTagList(const Node*);
93
static bool inInlineTagList(const Node*);
94
static bool inBlockTagList(const Node*);
95
static bool isRecognizedTagName(const QualifiedName&);
97
void setHTMLEventListener(const AtomicString& eventType, Attribute*);
99
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
101
HTMLFormElement* form() const { return virtualForm(); }
102
HTMLFormElement* findFormAncestor() const;
105
void addHTMLAlignment(MappedAttribute*);
108
virtual HTMLFormElement* virtualForm() const;