]> git.saurik.com Git - iphone-api.git/blob - WebCore/HTMLImageElement.h
Add support for new WinterBoard Settings features.
[iphone-api.git] / WebCore / HTMLImageElement.h
1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2008 Apple Inc. All rights reserved.
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 #ifndef HTMLImageElement_h
24 #define HTMLImageElement_h
25
26 #include "GraphicsTypes.h"
27 #include "HTMLElement.h"
28 #include "HTMLImageLoader.h"
29
30 namespace WebCore {
31
32 class HTMLFormElement;
33
34 class HTMLImageElement : public HTMLElement {
35 friend class HTMLFormElement;
36 public:
37 HTMLImageElement(const QualifiedName&, Document*, HTMLFormElement* = 0);
38 ~HTMLImageElement();
39
40 virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
41 virtual int tagPriority() const { return 0; }
42
43 virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
44 virtual void parseMappedAttribute(MappedAttribute*);
45
46 virtual void attach();
47 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
48 virtual void insertedIntoDocument();
49 virtual void removedFromDocument();
50
51 virtual bool canStartSelection() const { return false; }
52
53 int width(bool ignorePendingStylesheets = false) const;
54 int height(bool ignorePendingStylesheets = false) const;
55
56 int naturalWidth() const;
57 int naturalHeight() const;
58
59 bool isServerMap() const { return ismap && usemap.isEmpty(); }
60
61 String altText() const;
62
63 virtual bool isURLAttribute(Attribute*) const;
64
65 CompositeOperator compositeOperator() const { return m_compositeOperator; }
66
67 CachedImage* cachedImage() const { return m_imageLoader.image(); }
68 void setCachedImage(CachedImage* i) { m_imageLoader.setImage(i); };
69
70 void setLoadManually (bool loadManually) { m_imageLoader.setLoadManually(loadManually); }
71
72 String name() const;
73 void setName(const String&);
74
75 String align() const;
76 void setAlign(const String&);
77
78 String alt() const;
79 void setAlt(const String&);
80
81 String border() const;
82 void setBorder(const String&);
83
84 void setHeight(int);
85
86 int hspace() const;
87 void setHspace(int);
88
89 bool isMap() const;
90 void setIsMap(bool);
91
92 KURL longDesc() const;
93 void setLongDesc(const String&);
94
95 KURL lowsrc() const;
96 void setLowsrc(const String&);
97
98 KURL src() const;
99 void setSrc(const String&);
100
101 String useMap() const;
102 void setUseMap(const String&);
103
104 int vspace() const;
105 void setVspace(int);
106
107 void setWidth(int);
108
109 int x() const;
110 int y() const;
111
112 bool complete() const;
113
114 bool haveFiredLoadEvent() const { return m_imageLoader.haveFiredLoadEvent(); }
115
116 virtual bool willRespondToMouseClickEvents();
117
118 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
119
120 private:
121 HTMLImageLoader m_imageLoader;
122 String usemap;
123 bool ismap;
124 HTMLFormElement* m_form;
125 AtomicString m_name;
126 AtomicString m_id;
127 CompositeOperator m_compositeOperator;
128 };
129
130 } //namespace
131
132 #endif