#ifndef WebScrollBar_h
#define WebScrollBar_h
#include "WebKit.h"
#include <wtf/RefPtr.h>
#include <wtf/OwnPtr.h>
#pragma warning(push, 0)
#include <WebCore/COMPtr.h>
#include <WebCore/Scrollbar.h>
#include <WebCore/ScrollbarClient.h>
#pragma warning(pop)
namespace WebCore {
class Scrollbar;
}
using namespace WebCore;
class WebScrollBar : public IWebScrollBarPrivate, ScrollbarClient
{
public:
static WebScrollBar* createInstance();
protected:
WebScrollBar();
~WebScrollBar();
public:
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
virtual ULONG STDMETHODCALLTYPE AddRef(void);
virtual ULONG STDMETHODCALLTYPE Release(void);
virtual HRESULT STDMETHODCALLTYPE init(
IWebScrollBarDelegatePrivate* delegate,
OLE_HANDLE containingWindow,
WebScrollBarOrientation orientation,
WebScrollBarControlSize controlSize);
virtual HRESULT STDMETHODCALLTYPE setEnabled(
BOOL enabled);
virtual HRESULT STDMETHODCALLTYPE setSteps(
int lineStep,
int pageStep);
virtual HRESULT STDMETHODCALLTYPE setProportion(
int visibleSize,
int totalSize);
virtual HRESULT STDMETHODCALLTYPE setRect(
RECT bounds);
virtual HRESULT STDMETHODCALLTYPE setValue(
int value);
virtual HRESULT STDMETHODCALLTYPE value(
int* value);
virtual HRESULT STDMETHODCALLTYPE paint(
HDC dc,
RECT damageRect);
virtual HRESULT STDMETHODCALLTYPE frameRect(
RECT* bounds);
virtual HRESULT STDMETHODCALLTYPE width(
int* w);
virtual HRESULT STDMETHODCALLTYPE height(
int* h);
virtual HRESULT STDMETHODCALLTYPE requestedWidth(
int* w);
virtual HRESULT STDMETHODCALLTYPE requestedHeight(
int* h);
virtual HRESULT STDMETHODCALLTYPE handleMouseEvent(
OLE_HANDLE window,
UINT msg,
WPARAM wParam,
LPARAM lParam);
virtual HRESULT STDMETHODCALLTYPE scroll(
WebScrollDirection direction,
WebScrollGranularity granularity,
float multiplier);
protected:
virtual void valueChanged(Scrollbar*);
virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
virtual bool isActive() const { return true; }
virtual bool scrollbarCornerPresent() const { return false; }
ULONG m_refCount;
HWND m_containingWindow;
RefPtr<WebCore::Scrollbar> m_scrollBar;
COMPtr<IWebScrollBarDelegatePrivate> m_delegate;
};
#endif