gfx/skia/trunk/include/views/animated/SkProgressBarView.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/include/views/animated/SkProgressBarView.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2006 The Android Open Source Project
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +
    1.12 +
    1.13 +#ifndef SkProgressBarView_DEFINED
    1.14 +#define SkProgressBarView_DEFINED
    1.15 +
    1.16 +#include "SkView.h"
    1.17 +#include "SkWidgetViews.h"
    1.18 +#include "SkAnimator.h"
    1.19 +
    1.20 +class SkProgressBarView : public SkWidgetView {
    1.21 +    public:
    1.22 +        SkProgressBarView();
    1.23 +        //SkProgressBarView(int max);
    1.24 +
    1.25 +        //inflate: "sk-progress"
    1.26 +
    1.27 +        void reset();   //reset progress to zero
    1.28 +        void setProgress(int progress);
    1.29 +        void changeProgress(int diff);
    1.30 +        void setMax(int max);
    1.31 +
    1.32 +        int getProgress() const { return fProgress; }
    1.33 +        int getMax() const { return fMax; }
    1.34 +
    1.35 +    protected:
    1.36 +        //overrides
    1.37 +        virtual void onInflate(const SkDOM& dom, const SkDOM::Node* node);
    1.38 +        virtual void onSizeChange();
    1.39 +        virtual void onDraw(SkCanvas* canvas);
    1.40 +        virtual bool onEvent(const SkEvent& evt);
    1.41 +
    1.42 +    private:
    1.43 +        SkAnimator  fAnim;
    1.44 +        int         fProgress;
    1.45 +        int         fMax;
    1.46 +
    1.47 +        typedef SkWidgetView INHERITED;
    1.48 +};
    1.49 +
    1.50 +
    1.51 +
    1.52 +
    1.53 +#endif

mercurial