Home | History | Annotate | Download | only in html
      1 /*
      2  * Copyright (C) 1999 Lars Knoll (knoll (at) kde.org)
      3  *           (C) 1999 Antti Koivisto (koivisto (at) kde.org)
      4  *           (C) 2000 Simon Hausmann <hausmann (at) 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 "core/html/HTMLElement.h"
     28 
     29 namespace WebCore {
     30 
     31 class Document;
     32 
     33 class HTMLBodyElement FINAL : public HTMLElement {
     34 public:
     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 
     70 private:
     71     HTMLBodyElement(const QualifiedName&, Document*);
     72 
     73     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
     74     virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
     75     virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet*) OVERRIDE;
     76 
     77     virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
     78     virtual void didNotifySubtreeInsertions(ContainerNode*) OVERRIDE;
     79 
     80     virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
     81 
     82     virtual bool supportsFocus() const;
     83 
     84     virtual int scrollLeft();
     85     virtual void setScrollLeft(int scrollLeft);
     86 
     87     virtual int scrollTop();
     88     virtual void setScrollTop(int scrollTop);
     89 
     90     virtual int scrollHeight();
     91     virtual int scrollWidth();
     92 
     93     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
     94 };
     95 
     96 inline HTMLBodyElement* toHTMLBodyElement(Node* node)
     97 {
     98     ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::bodyTag));
     99     return static_cast<HTMLBodyElement*>(node);
    100 }
    101 
    102 } //namespace
    103 
    104 #endif
    105