FormAssociatedElement.h [plain text]
#ifndef FormAssociatedElement_h
#define FormAssociatedElement_h
#include "HTMLElement.h"
namespace WebCore {
class FormDataList;
class HTMLFormElement;
class ValidationMessage;
class ValidityState;
class VisibleSelection;
class FormAssociatedElement {
public:
virtual ~FormAssociatedElement();
void ref() { refFormAssociatedElement(); }
void deref() { derefFormAssociatedElement(); }
static HTMLFormElement* findAssociatedForm(const HTMLElement*, HTMLFormElement*);
HTMLFormElement* form() const { return m_form; }
ValidityState* validity();
virtual bool isFormControlElement() const = 0;
virtual bool isEnumeratable() const = 0;
const AtomicString& name() const { return formControlName(); }
virtual bool appendFormData(FormDataList&, bool) { return false; }
void formWillBeDestroyed();
void resetFormOwner();
void formRemovedFromTree(const Node* formRoot);
protected:
FormAssociatedElement();
void insertedInto(Node*);
void removedFrom(Node*);
void didMoveToNewDocument(Document* oldDocument);
void setForm(HTMLFormElement*);
void formAttributeChanged();
virtual void willChangeForm();
virtual void didChangeForm();
private:
virtual const AtomicString& formControlName() const = 0;
virtual void refFormAssociatedElement() = 0;
virtual void derefFormAssociatedElement() = 0;
HTMLFormElement* m_form;
OwnPtr<ValidityState> m_validityState;
};
HTMLElement* toHTMLElement(FormAssociatedElement*);
const HTMLElement* toHTMLElement(const FormAssociatedElement*);
}
#endif // FormAssociatedElement_h