1 
2 /*
3  * Copyright 2006 The Android Open Source Project
4  *
5  * Use of this source code is governed by a BSD-style license that can be
6  * found in the LICENSE file.
7  */
8 
9 
10 #ifndef SkBorderView_DEFINED
11 #define SkBorderView_DEFINED
12 
13 #include "SkView.h"
14 #include "SkWidgetViews.h"
15 #include "SkAnimator.h"
16 
17 class SkBorderView : public SkWidgetView {
18 public:
19     SkBorderView();
20     ~SkBorderView();
21     void setSkin(const char skin[]);
getLeft()22     SkScalar getLeft() const { return fLeft; }
getRight()23     SkScalar getRight() const { return fRight; }
getTop()24     SkScalar getTop() const { return fTop; }
getBottom()25     SkScalar getBottom() const { return fBottom; }
26 protected:
27     //overrides
28     virtual void onInflate(const SkDOM& dom,  const SkDOM::Node* node);
29     virtual void onSizeChange();
30     virtual void onDraw(SkCanvas* canvas);
31     virtual bool onEvent(const SkEvent& evt);
32 private:
33     SkAnimator fAnim;
34     SkScalar fLeft, fRight, fTop, fBottom;  //margin on each side
35     SkRect fMargin;
36 
37     typedef SkWidgetView INHERITED;
38 };
39 
40 #endif
41