#ifndef RenderScrollbar_h
#define RenderScrollbar_h
#include "core/rendering/style/RenderStyleConstants.h"
#include "platform/scroll/Scrollbar.h"
#include "wtf/HashMap.h"
namespace WebCore {
class LocalFrame;
class Node;
class RenderBox;
class RenderScrollbarPart;
class RenderStyle;
class RenderScrollbar FINAL : public Scrollbar {
protected:
RenderScrollbar(ScrollableArea*, ScrollbarOrientation, Node*, LocalFrame*);
public:
friend class Scrollbar;
static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollableArea*, ScrollbarOrientation, Node*, LocalFrame* owningFrame = 0);
virtual ~RenderScrollbar();
RenderBox* owningRenderer() const;
void paintPart(GraphicsContext*, ScrollbarPart, const IntRect&);
IntRect buttonRect(ScrollbarPart);
IntRect trackRect(int startLength, int endLength);
IntRect trackPieceRectWithMargins(ScrollbarPart, const IntRect&);
int minimumThumbLength();
virtual bool isOverlayScrollbar() const OVERRIDE { return false; }
private:
virtual void setParent(Widget*) OVERRIDE;
virtual void setEnabled(bool) OVERRIDE;
virtual void paint(GraphicsContext*, const IntRect& damageRect) OVERRIDE;
virtual void setHoveredPart(ScrollbarPart) OVERRIDE;
virtual void setPressedPart(ScrollbarPart) OVERRIDE;
virtual void styleChanged() OVERRIDE;
virtual bool isCustomScrollbar() const OVERRIDE { return true; }
void updateScrollbarParts(bool destroy = false);
PassRefPtr<RenderStyle> getScrollbarPseudoStyle(ScrollbarPart, PseudoId);
void updateScrollbarPart(ScrollbarPart, bool destroy = false);
RefPtr<Node> m_owner;
LocalFrame* m_owningFrame;
HashMap<unsigned, RenderScrollbarPart*> m_parts;
};
DEFINE_TYPE_CASTS(RenderScrollbar, ScrollbarThemeClient, scrollbar, scrollbar->isCustomScrollbar(), scrollbar.isCustomScrollbar());
}
#endif