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 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 HTMLFrameSetElement_h
25#define HTMLFrameSetElement_h
26
27#include "Color.h"
28#include "Document.h"
29#include "HTMLElement.h"
30
31namespace WebCore {
32
33class HTMLFrameSetElement : public HTMLElement {
34public:
35    HTMLFrameSetElement(const QualifiedName&, Document*);
36    ~HTMLFrameSetElement();
37
38    virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
39    virtual int tagPriority() const { return 10; }
40    virtual bool checkDTD(const Node* newChild);
41
42    virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
43    virtual void parseMappedAttribute(MappedAttribute*);
44
45    virtual void attach();
46    virtual bool rendererIsNeeded(RenderStyle*);
47    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
48
49    virtual void defaultEventHandler(Event*);
50
51    bool hasFrameBorder() const { return frameborder; }
52    bool noResize() const { return noresize; }
53
54    int totalRows() const { return m_totalRows; }
55    int totalCols() const { return m_totalCols; }
56    int border() const { return m_border; }
57
58    bool hasBorderColor() const { return m_borderColorSet; }
59
60    virtual void recalcStyle(StyleChange);
61
62    String cols() const;
63    void setCols(const String&);
64
65    String rows() const;
66    void setRows(const String&);
67
68    const Length* rowLengths() const { return m_rows; }
69    const Length* colLengths() const { return m_cols; }
70
71    // Declared virtual in Element
72    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(blur);
73    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(error);
74    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(focus);
75    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(load);
76
77    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(beforeunload);
78    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(hashchange);
79    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(message);
80    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(offline);
81    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(online);
82    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(popstate);
83    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(resize);
84    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(storage);
85    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(unload);
86#if ENABLE(ORIENTATION_EVENTS)
87    DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(orientationchange);
88#endif
89
90private:
91    Length* m_rows;
92    Length* m_cols;
93
94    int m_totalRows;
95    int m_totalCols;
96
97    int m_border;
98    bool m_borderSet;
99
100    bool m_borderColorSet;
101
102    bool frameborder;
103    bool frameBorderSet;
104    bool noresize;
105};
106
107} // namespace WebCore
108
109#endif // HTMLFrameSetElement_h
110