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 SkProgressBarView_DEFINED michael@0: #define SkProgressBarView_DEFINED michael@0: michael@0: #include "SkView.h" michael@0: #include "SkWidgetViews.h" michael@0: #include "SkAnimator.h" michael@0: michael@0: class SkProgressBarView : public SkWidgetView { michael@0: public: michael@0: SkProgressBarView(); michael@0: //SkProgressBarView(int max); michael@0: michael@0: //inflate: "sk-progress" michael@0: michael@0: void reset(); //reset progress to zero michael@0: void setProgress(int progress); michael@0: void changeProgress(int diff); michael@0: void setMax(int max); michael@0: michael@0: int getProgress() const { return fProgress; } michael@0: int getMax() const { return fMax; } 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: int fProgress; michael@0: int fMax; michael@0: michael@0: typedef SkWidgetView INHERITED; michael@0: }; michael@0: michael@0: michael@0: michael@0: michael@0: #endif