aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/graphics/SkScrollBarView.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/graphics/SkScrollBarView.h')
-rw-r--r--include/graphics/SkScrollBarView.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/graphics/SkScrollBarView.h b/include/graphics/SkScrollBarView.h
new file mode 100644
index 0000000000..ee43a3cec1
--- /dev/null
+++ b/include/graphics/SkScrollBarView.h
@@ -0,0 +1,35 @@
+#ifndef SkScrollBarView_DEFINED
+#define SkScrollBarView_DEFINED
+
+#include "SkView.h"
+#include "SkWidgetViews.h"
+#include "SkAnimator.h"
+
+class SkScrollBarView : public SkWidgetView {
+public:
+ SkScrollBarView();
+
+ unsigned getStart() const { return fStartPoint; }
+ unsigned getShown() const { return fShownLength; }
+ unsigned getTotal() const { return fTotalLength; }
+
+ void setStart(unsigned start);
+ void setShown(unsigned shown);
+ void setTotal(unsigned total);
+
+protected:
+ //overrides
+ virtual void onInflate(const SkDOM& dom, const SkDOM::Node* node);
+ virtual void onSizeChange();
+ virtual void onDraw(SkCanvas* canvas);
+ virtual bool onEvent(const SkEvent& evt);
+
+private:
+ SkAnimator fAnim;
+ unsigned fTotalLength, fStartPoint, fShownLength;
+
+ void adjust();
+
+ typedef SkWidgetView INHERITED;
+};
+#endif \ No newline at end of file