1/*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
4 *           (C) 2000 Simon Hausmann <hausmann@kde.org>
5 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB.  If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 */
23
24#ifndef HTMLBodyElement_h
25#define HTMLBodyElement_h
26
27#include "HTMLElement.h"
28
29namespace WebCore {
30
31class Document;
32
33class HTMLBodyElement : public HTMLElement {
34public:
35    static PassRefPtr<HTMLBodyElement> create(Document*);
36    static PassRefPtr<HTMLBodyElement> create(const QualifiedName&, Document*);
37    virtual ~HTMLBodyElement();
38
39    String aLink() const;
40    void setALink(const String&);
41    String bgColor() const;
42    void setBgColor(const String&);
43    String link() const;
44    void setLink(const String&);
45    String text() const;
46    void setText(const String&);
47    String vLink() const;
48    void setVLink(const String&);
49
50    // Declared virtual in Element
51    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(blur);
52    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(error);
53    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(focus);
54    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(load);
55
56    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(beforeunload);
57    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(hashchange);
58    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(message);
59    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(offline);
60    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(online);
61    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(popstate);
62    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(resize);
63    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(storage);
64    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(unload);
65
66#if ENABLE(ORIENTATION_EVENTS)
67    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(orientationchange);
68#endif
69
70private:
71    HTMLBodyElement(const QualifiedName&, Document*);
72
73    virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const;
74    virtual void parseMappedAttribute(Attribute*);
75
76    virtual void insertedIntoDocument();
77
78    void createLinkDecl();
79
80    virtual bool isURLAttribute(Attribute*) const;
81
82    virtual bool supportsFocus() const;
83
84    virtual int scrollLeft() const;
85    virtual void setScrollLeft(int scrollLeft);
86
87    virtual int scrollTop() const;
88    virtual void setScrollTop(int scrollTop);
89
90    virtual int scrollHeight() const;
91    virtual int scrollWidth() const;
92
93    virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
94
95    virtual void didMoveToNewOwnerDocument();
96
97    RefPtr<CSSMutableStyleDeclaration> m_linkDecl;
98};
99
100} //namespace
101
102#endif
103