michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkScrollBarView_DEFINED michael@0: #define SkScrollBarView_DEFINED michael@0: michael@0: #include "SkView.h" michael@0: #include "SkWidgetViews.h" michael@0: #include "SkAnimator.h" michael@0: michael@0: class SkScrollBarView : public SkWidgetView { michael@0: public: michael@0: SkScrollBarView(); michael@0: michael@0: unsigned getStart() const { return fStartPoint; } michael@0: unsigned getShown() const { return fShownLength; } michael@0: unsigned getTotal() const { return fTotalLength; } michael@0: michael@0: void setStart(unsigned start); michael@0: void setShown(unsigned shown); michael@0: void setTotal(unsigned total); michael@0: michael@0: protected: michael@0: //overrides michael@0: virtual void onInflate(const SkDOM& dom, const SkDOM::Node* node); michael@0: virtual void onSizeChange(); michael@0: virtual void onDraw(SkCanvas* canvas); michael@0: virtual bool onEvent(const SkEvent& evt); michael@0: michael@0: private: michael@0: SkAnimator fAnim; michael@0: unsigned fTotalLength, fStartPoint, fShownLength; michael@0: michael@0: void adjust(); michael@0: michael@0: typedef SkWidgetView INHERITED; michael@0: }; michael@0: #endif