gfx/skia/trunk/include/views/animated/SkScrollBarView.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/SkScrollBarView.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     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 SkScrollBarView_DEFINED
    1.14 +#define SkScrollBarView_DEFINED
    1.15 +
    1.16 +#include "SkView.h"
    1.17 +#include "SkWidgetViews.h"
    1.18 +#include "SkAnimator.h"
    1.19 +
    1.20 +class SkScrollBarView : public SkWidgetView {
    1.21 +public:
    1.22 +    SkScrollBarView();
    1.23 +
    1.24 +    unsigned getStart() const { return fStartPoint; }
    1.25 +    unsigned getShown() const { return fShownLength; }
    1.26 +    unsigned getTotal() const { return fTotalLength; }
    1.27 +
    1.28 +    void setStart(unsigned start);
    1.29 +    void setShown(unsigned shown);
    1.30 +    void setTotal(unsigned total);
    1.31 +
    1.32 +protected:
    1.33 +    //overrides
    1.34 +    virtual void onInflate(const SkDOM& dom, const SkDOM::Node* node);
    1.35 +    virtual void onSizeChange();
    1.36 +    virtual void onDraw(SkCanvas* canvas);
    1.37 +    virtual bool onEvent(const SkEvent& evt);
    1.38 +
    1.39 +private:
    1.40 +    SkAnimator  fAnim;
    1.41 +    unsigned    fTotalLength, fStartPoint, fShownLength;
    1.42 +
    1.43 +    void adjust();
    1.44 +
    1.45 +    typedef SkWidgetView INHERITED;
    1.46 +};
    1.47 +#endif

mercurial