#ifndef AXNodeObject_h
#define AXNodeObject_h
#include "core/accessibility/AXObject.h"
#include "platform/geometry/LayoutRect.h"
#include "wtf/Forward.h"
namespace WebCore {
class AXObjectCache;
class Element;
class LocalFrame;
class FrameView;
class HitTestResult;
class HTMLAnchorElement;
class HTMLAreaElement;
class HTMLElement;
class HTMLLabelElement;
class HTMLMapElement;
class HTMLSelectElement;
class IntPoint;
class IntSize;
class Node;
class RenderListBox;
class RenderTextControl;
class RenderView;
class VisibleSelection;
class Widget;
class AXNodeObject : public AXObject {
protected:
explicit AXNodeObject(Node*);
public:
static PassRefPtr<AXNodeObject> create(Node*);
virtual ~AXNodeObject();
protected:
AccessibilityRole m_ariaRole;
bool m_childrenDirty;
#ifndef NDEBUG
bool m_initialized;
#endif
virtual bool computeAccessibilityIsIgnored() const OVERRIDE;
virtual AccessibilityRole determineAccessibilityRole();
String accessibilityDescriptionForElements(Vector<Element*> &elements) const;
void alterSliderValue(bool increase);
String ariaAccessibilityDescription() const;
void ariaLabeledByElements(Vector<Element*>& elements) const;
void changeValueByStep(bool increase);
AccessibilityRole determineAriaRoleAttribute() const;
void elementsFromAttribute(Vector<Element*>& elements, const QualifiedName&) const;
bool hasContentEditableAttributeSet() const;
bool isDescendantOfBarrenParent() const;
bool isGenericFocusableElement() const;
HTMLLabelElement* labelForElement(Element*) const;
AXObject* menuButtonForMenu() const;
Element* menuItemElementForMenu() const;
Element* mouseButtonListener() const;
AccessibilityRole remapAriaRoleDueToParent(AccessibilityRole) const;
bool isNativeCheckboxOrRadio() const;
void setNode(Node*);
AXObject* correspondingControlForLabelElement() const;
HTMLLabelElement* labelElementContainer() const;
virtual void init() OVERRIDE;
virtual void detach() OVERRIDE;
virtual bool isDetached() const OVERRIDE { return !m_node; }
virtual bool isAXNodeObject() const OVERRIDE FINAL { return true; }
virtual bool isAnchor() const OVERRIDE FINAL;
virtual bool isControl() const OVERRIDE;
virtual bool isFieldset() const OVERRIDE FINAL;
virtual bool isHeading() const OVERRIDE FINAL;
virtual bool isHovered() const OVERRIDE FINAL;
virtual bool isImage() const OVERRIDE FINAL;
bool isImageButton() const;
virtual bool isInputImage() const OVERRIDE FINAL;
virtual bool isLink() const OVERRIDE FINAL;
virtual bool isMenu() const OVERRIDE FINAL;
virtual bool isMenuButton() const OVERRIDE FINAL;
virtual bool isMultiSelectable() const OVERRIDE;
bool isNativeImage() const;
virtual bool isNativeTextControl() const OVERRIDE FINAL;
virtual bool isNonNativeTextControl() const OVERRIDE FINAL;
virtual bool isPasswordField() const OVERRIDE FINAL;
virtual bool isProgressIndicator() const OVERRIDE;
virtual bool isSlider() const OVERRIDE;
virtual bool isChecked() const OVERRIDE FINAL;
virtual bool isClickable() const OVERRIDE FINAL;
virtual bool isEnabled() const OVERRIDE;
virtual bool isIndeterminate() const OVERRIDE FINAL;
virtual bool isPressed() const OVERRIDE FINAL;
virtual bool isReadOnly() const OVERRIDE;
virtual bool isRequired() const OVERRIDE FINAL;
virtual bool canSetFocusAttribute() const OVERRIDE;
virtual bool canSetValueAttribute() const OVERRIDE;
virtual bool canvasHasFallbackContent() const OVERRIDE FINAL;
virtual bool exposesTitleUIElement() const OVERRIDE;
virtual int headingLevel() const OVERRIDE FINAL;
virtual unsigned hierarchicalLevel() const OVERRIDE FINAL;
virtual String text() const OVERRIDE;
virtual AXObject* titleUIElement() const OVERRIDE;
virtual AccessibilityButtonState checkboxOrRadioValue() const OVERRIDE FINAL;
virtual void colorValue(int& r, int& g, int& b) const OVERRIDE FINAL;
virtual String valueDescription() const OVERRIDE;
virtual float valueForRange() const OVERRIDE;
virtual float maxValueForRange() const OVERRIDE;
virtual float minValueForRange() const OVERRIDE;
virtual String stringValue() const OVERRIDE;
virtual String ariaDescribedByAttribute() const OVERRIDE FINAL;
virtual String ariaLabeledByAttribute() const OVERRIDE FINAL;
virtual AccessibilityRole ariaRoleAttribute() const OVERRIDE FINAL;
virtual String textUnderElement() const OVERRIDE;
virtual String accessibilityDescription() const OVERRIDE;
virtual String title() const OVERRIDE;
virtual String helpText() const OVERRIDE;
virtual LayoutRect elementRect() const OVERRIDE;
virtual AXObject* parentObject() const OVERRIDE;
virtual AXObject* parentObjectIfExists() const OVERRIDE;
virtual AXObject* firstChild() const OVERRIDE;
virtual AXObject* nextSibling() const OVERRIDE;
virtual void addChildren() OVERRIDE;
virtual bool canHaveChildren() const OVERRIDE;
void addChild(AXObject*);
void insertChild(AXObject*, unsigned index);
virtual Element* actionElement() const OVERRIDE FINAL;
virtual Element* anchorElement() const OVERRIDE;
virtual Document* document() const OVERRIDE;
virtual Node* node() const OVERRIDE { return m_node; }
virtual void setFocused(bool) OVERRIDE FINAL;
virtual void increment() OVERRIDE FINAL;
virtual void decrement() OVERRIDE FINAL;
virtual void childrenChanged() OVERRIDE;
virtual void selectionChanged() OVERRIDE FINAL;
virtual void textChanged() OVERRIDE;
virtual void updateAccessibilityRole() OVERRIDE FINAL;
private:
Node* m_node;
String alternativeTextForWebArea() const;
void alternativeText(Vector<AccessibilityText>&) const;
void ariaLabeledByText(Vector<AccessibilityText>&) const;
void changeValueByPercent(float percentChange);
float stepValueForRange() const;
};
DEFINE_AX_OBJECT_TYPE_CASTS(AXNodeObject, isAXNodeObject());
}
#endif