15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/*
25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *           (C) 1999 Antti Koivisto (koivisto@kde.org)
45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *           (C) 2000 Dirk Mueller (mueller@kde.org)
55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * This library is free software; you can redistribute it and/or
85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modify it under the terms of the GNU Library General Public
95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * License as published by the Free Software Foundation; either
105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * version 2 of the License, or (at your option) any later version.
115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * This library is distributed in the hope that it will be useful,
135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * but WITHOUT ANY WARRANTY; without even the implied warranty of
145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Library General Public License for more details.
165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * You should have received a copy of the GNU Library General Public License
185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * along with this library; see the file COPYING.LIB.  If not, write to
195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Boston, MA 02110-1301, USA.
215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */
235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#ifndef HTMLButtonElement_h
255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define HTMLButtonElement_h
265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
2753e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/html/HTMLFormControlElement.h"
285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
29c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink {
305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
3153e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)class HTMLButtonElement FINAL : public HTMLFormControlElement {
327242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    DEFINE_WRAPPERTYPEINFO();
335c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)public:
34323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles)    static PassRefPtrWillBeRawPtr<HTMLButtonElement> create(Document&, HTMLFormElement*);
355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
365c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    void setType(const AtomicString&);
3702772c6a72f1ee0b226341a4f4439970c29fc861Ben Murdoch
38a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles)    const AtomicString& value() const;
395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
405c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    virtual bool willRespondToMouseClickEvents() OVERRIDE;
415c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
425c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)private:
4351b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    HTMLButtonElement(Document&, HTMLFormElement*);
445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
455c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    enum Type { SUBMIT, RESET, BUTTON };
465c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
4709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual const AtomicString& formControlType() const OVERRIDE;
48926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
4909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
505c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
51926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    // HTMLFormControlElement always creates one, but buttons don't need it.
52926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE { return false; }
535c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
54197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    virtual Node::InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
55197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    virtual void attributeWillChange(const QualifiedName&, const AtomicString& oldValue, const AtomicString& newValue) OVERRIDE;
56926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
575c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
5809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual void defaultEventHandler(Event*) OVERRIDE;
595c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
6009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual bool appendFormData(FormDataList&, bool) OVERRIDE;
615c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
6209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual bool isEnumeratable() const OVERRIDE { return true; }
635c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    virtual bool supportLabels() const OVERRIDE { return true; }
64bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    virtual bool isInteractiveContent() const OVERRIDE;
6509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual bool supportsAutofocus() const OVERRIDE;
665c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
6751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual bool canBeSuccessfulSubmitButton() const OVERRIDE;
6809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual bool isActivatedSubmit() const OVERRIDE;
6909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual void setActivatedSubmit(bool flag) OVERRIDE;
705c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
7109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual void accessKeyAction(bool sendMouseEvents) OVERRIDE;
725c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
735c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
7409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual bool canStartSelection() const OVERRIDE { return false; }
755c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
7609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual bool isOptionalFormControl() const OVERRIDE { return true; }
7709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual bool recalcWillValidate() const OVERRIDE;
785c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
795c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    Type m_type;
805c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)    bool m_isActivatedSubmit;
815c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)};
825c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
837242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci} // namespace blink
845c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
857242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci#endif // HTMLButtonElement_h
86