AccessibilityListBoxOption.h [plain text]
#ifndef AccessibilityListBoxOption_h
#define AccessibilityListBoxOption_h
#include "AccessibilityObject.h"
#include "HTMLElement.h"
#include <wtf/Forward.h>
namespace WebCore {
class AccessibilityListBox;
class Element;
class HTMLElement;
class HTMLSelectElement;
class AccessibilityListBoxOption final : public AccessibilityObject {
public:
static Ref<AccessibilityListBoxOption> create();
virtual ~AccessibilityListBoxOption();
void setHTMLElement(HTMLElement* element) { m_optionElement = element; }
AccessibilityRole roleValue() const override { return ListBoxOptionRole; }
bool isSelected() const override;
bool isEnabled() const override;
bool isSelectedOptionActive() const override;
String stringValue() const override;
Element* actionElement() const override;
Node* node() const override { return m_optionElement; }
void setSelected(bool) override;
bool canSetSelectedAttribute() const override;
LayoutRect elementRect() const override;
AccessibilityObject* parentObject() const override;
private:
AccessibilityListBoxOption();
bool isListBoxOption() const override { return true; }
bool canHaveChildren() const override { return false; }
HTMLSelectElement* listBoxOptionParentNode() const;
int listBoxOptionIndex() const;
IntRect listBoxOptionRect() const;
AccessibilityObject* listBoxOptionAccessibilityObject(HTMLElement*) const;
bool computeAccessibilityIsIgnored() const override;
HTMLElement* m_optionElement;
};
}
SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityListBoxOption, isListBoxOption())
#endif // AccessibilityListBoxOption_h