blob: 94ccc1f0a577a24f7851d0df82ea3883e5774cf3 [file] [log] [blame]
reed@android.com8a1c16f2008-12-17 15:59:43 +00001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef SkBorderView_DEFINED
18#define SkBorderView_DEFINED
19
20#include "SkView.h"
21#include "SkWidgetViews.h"
22#include "SkAnimator.h"
23
24class SkBorderView : public SkWidgetView {
25public:
26 SkBorderView();
27 ~SkBorderView();
28 void setSkin(const char skin[]);
29 SkScalar getLeft() const { return fLeft; }
30 SkScalar getRight() const { return fRight; }
31 SkScalar getTop() const { return fTop; }
32 SkScalar getBottom() const { return fBottom; }
33protected:
34 //overrides
35 virtual void onInflate(const SkDOM& dom, const SkDOM::Node* node);
36 virtual void onSizeChange();
37 virtual void onDraw(SkCanvas* canvas);
38 virtual bool onEvent(const SkEvent& evt);
39private:
40 SkAnimator fAnim;
41 SkScalar fLeft, fRight, fTop, fBottom; //margin on each side
42 SkRect fMargin;
43
44 typedef SkWidgetView INHERITED;
45};
46
47#endif
48