#ifndef SliderThumbElement_h
#define SliderThumbElement_h
#include "HTMLNames.h"
#include "core/html/HTMLDivElement.h"
#include "core/rendering/RenderBlockFlow.h"
#include "wtf/Forward.h"
namespace WebCore {
class HTMLElement;
class HTMLInputElement;
class Event;
class FloatPoint;
class SliderThumbElement FINAL : public HTMLDivElement {
public:
static PassRefPtr<SliderThumbElement> create(Document&);
void setPositionFromValue();
void dragFrom(const LayoutPoint&);
virtual void defaultEventHandler(Event*) OVERRIDE;
virtual bool willRespondToMouseMoveEvents() OVERRIDE;
virtual bool willRespondToMouseClickEvents() OVERRIDE;
virtual void detach(const AttachContext& = AttachContext()) OVERRIDE;
virtual const AtomicString& shadowPseudoId() const OVERRIDE;
HTMLInputElement* hostInput() const;
void setPositionFromPoint(const LayoutPoint&);
void stopDragging();
private:
SliderThumbElement(Document&);
virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren() OVERRIDE;
virtual bool isDisabledFormControl() const OVERRIDE;
virtual bool matchesReadOnlyPseudoClass() const OVERRIDE;
virtual bool matchesReadWritePseudoClass() const OVERRIDE;
virtual Node* focusDelegate() OVERRIDE;
void startDragging();
bool m_inDragMode;
};
inline PassRefPtr<Element> SliderThumbElement::cloneElementWithoutAttributesAndChildren()
{
return create(document());
}
DEFINE_ELEMENT_TYPE_CASTS(SliderThumbElement, isHTMLElement());
class RenderSliderThumb FINAL : public RenderBlockFlow {
public:
RenderSliderThumb(SliderThumbElement*);
void updateAppearance(RenderStyle* parentStyle);
private:
virtual bool isSliderThumb() const OVERRIDE;
};
class SliderContainerElement FINAL : public HTMLDivElement {
public:
static PassRefPtr<SliderContainerElement> create(Document&);
private:
SliderContainerElement(Document&);
virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
virtual const AtomicString& shadowPseudoId() const OVERRIDE;
};
}
#endif