#ifndef AXSpinButton_h
#define AXSpinButton_h
#include "core/accessibility/AXMockObject.h"
#include "core/html/shadow/SpinButtonElement.h"
namespace WebCore {
class AXSpinButton FINAL : public AXMockObject {
public:
static PassRefPtr<AXSpinButton> create();
virtual ~AXSpinButton();
void setSpinButtonElement(SpinButtonElement* spinButton) { m_spinButtonElement = spinButton; }
void step(int amount);
private:
AXSpinButton();
virtual AccessibilityRole roleValue() const OVERRIDE { return SpinButtonRole; }
virtual bool isSpinButton() const OVERRIDE { return true; }
virtual bool isNativeSpinButton() const OVERRIDE { return true; }
virtual void addChildren() OVERRIDE;
virtual LayoutRect elementRect() const OVERRIDE;
SpinButtonElement* m_spinButtonElement;
};
class AXSpinButtonPart FINAL : public AXMockObject {
public:
static PassRefPtr<AXSpinButtonPart> create();
virtual ~AXSpinButtonPart() { }
bool isIncrementor() const { return m_isIncrementor; }
void setIsIncrementor(bool value) { m_isIncrementor = value; }
private:
AXSpinButtonPart();
bool m_isIncrementor : 1;
virtual bool press() const OVERRIDE;
virtual AccessibilityRole roleValue() const OVERRIDE { return ButtonRole; }
virtual bool isSpinButtonPart() const OVERRIDE { return true; }
virtual LayoutRect elementRect() const OVERRIDE;
};
DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButton, isNativeSpinButton());
DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButtonPart, isSpinButtonPart());
}
#endif