HTMLOptionElement.h [plain text]
#ifndef HTMLOptionElement_h
#define HTMLOptionElement_h
#include "HTMLElement.h"
namespace WebCore {
class HTMLSelectElement;
class HTMLOptionElement : public HTMLElement {
public:
static PassRefPtr<HTMLOptionElement> create(Document*);
static PassRefPtr<HTMLOptionElement> create(const QualifiedName&, Document*);
static PassRefPtr<HTMLOptionElement> createForJSConstructor(Document*, const String& data, const String& value,
bool defaultSelected, bool selected, ExceptionCode&);
virtual String text() const;
void setText(const String&, ExceptionCode&);
int index() const;
String value() const;
void setValue(const String&);
bool selected();
void setSelected(bool);
HTMLSelectElement* ownerSelectElement() const;
String label() const;
void setLabel(const String&);
virtual bool isEnabledFormControl() const OVERRIDE { return !disabled(); }
bool ownElementDisabled() const { return m_disabled; }
virtual bool disabled() const;
String textIndentedToRespectGroupLabel() const;
void setSelectedState(bool);
private:
HTMLOptionElement(const QualifiedName&, Document*);
virtual bool supportsFocus() const;
virtual bool isFocusable() const;
virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
virtual void attach();
virtual void detach();
virtual void setRenderStyle(PassRefPtr<RenderStyle>);
virtual void parseAttribute(Attribute*) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(Node*) OVERRIDE;
virtual void accessKeyAction(bool);
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
virtual RenderStyle* nonRendererRenderStyle() const;
String collectOptionInnerText() const;
String m_value;
String m_label;
bool m_disabled;
bool m_isSelected;
RefPtr<RenderStyle> m_style;
};
HTMLOptionElement* toHTMLOptionElement(Node*);
const HTMLOptionElement* toHTMLOptionElement(const Node*);
void toHTMLOptionElement(const HTMLOptionElement*);
#ifdef NDEBUG
inline HTMLOptionElement* toHTMLOptionElement(Node* node)
{
return static_cast<HTMLOptionElement*>(node);
}
inline const HTMLOptionElement* toHTMLOptionElement(const Node* node)
{
return static_cast<const HTMLOptionElement*>(node);
}
#endif
}
#endif