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(); }
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; }
virtual void formDestroyed() { m_form = 0; }
void resetFormOwner(HTMLFormElement*);
protected:
FormAssociatedElement(HTMLFormElement*);
void insertedIntoTree();
void removedFromTree();
void insertedIntoDocument();
void removedFromDocument();
void willMoveToNewOwnerDocument();
void setForm(HTMLFormElement* form) { m_form = form; }
void removeFromForm();
void formAttributeChanged();
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