#ifndef RenderScrollbar_h
#define RenderScrollbar_h
#include "RenderStyleConstants.h"
#include "Scrollbar.h"
#include <wtf/HashMap.h>
namespace WebCore {
class RenderBox;
class RenderStyle;
class RenderScrollbarPart;
class RenderStyle;
class RenderScrollbar : public Scrollbar {
protected:
RenderScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderBox*);
public:
friend class Scrollbar;
static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderBox*);
virtual ~RenderScrollbar();
virtual void setParent(ScrollView*);
virtual void setEnabled(bool);
virtual void paint(GraphicsContext*, const IntRect& damageRect);
virtual void setHoveredPart(ScrollbarPart);
virtual void setPressedPart(ScrollbarPart);
void updateScrollbarParts(bool destroy = false);
static ScrollbarPart partForStyleResolve();
static RenderScrollbar* scrollbarForStyleResolve();
virtual void styleChanged();
RenderBox* owningRenderer() const { return m_owner; }
void paintPart(GraphicsContext*, ScrollbarPart, const IntRect&);
IntRect buttonRect(ScrollbarPart);
IntRect trackRect(int startLength, int endLength);
IntRect trackPieceRectWithMargins(ScrollbarPart, const IntRect&);
int minimumThumbLength();
virtual bool isCustomScrollbar() const { return true; }
private:
PassRefPtr<RenderStyle> getScrollbarPseudoStyle(ScrollbarPart, PseudoId);
void updateScrollbarPart(ScrollbarPart, bool destroy = false);
RenderBox* m_owner;
HashMap<unsigned, RenderScrollbarPart*> m_parts;
};
}
#endif // RenderScrollbar_h