1/*
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
17package android.view;
18
19import com.android.layoutlib.bridge.MockView;
20
21import android.content.Context;
22import android.graphics.Canvas;
23import android.graphics.Rect;
24import android.util.AttributeSet;
25
26/**
27 * Mock version of the SurfaceView.
28 * Only non override public methods from the real SurfaceView have been added in there.
29 * Methods that take an unknown class as parameter or as return object, have been removed for now.
30 *
31 * TODO: generate automatically.
32 *
33 */
34public class SurfaceView extends MockView {
35
36    public SurfaceView(Context context) {
37        this(context, null);
38    }
39
40    public SurfaceView(Context context, AttributeSet attrs) {
41        this(context, attrs , 0);
42    }
43
44    public SurfaceView(Context context, AttributeSet attrs, int defStyle) {
45        super(context, attrs, defStyle);
46    }
47
48    public SurfaceHolder getHolder() {
49        return mSurfaceHolder;
50    }
51
52    private SurfaceHolder mSurfaceHolder = new SurfaceHolder() {
53
54        @Override
55        public boolean isCreating() {
56            return false;
57        }
58
59        @Override
60        public void addCallback(Callback callback) {
61        }
62
63        @Override
64        public void removeCallback(Callback callback) {
65        }
66
67        @Override
68        public void setFixedSize(int width, int height) {
69        }
70
71        @Override
72        public void setSizeFromLayout() {
73        }
74
75        @Override
76        public void setFormat(int format) {
77        }
78
79        @Override
80        public void setType(int type) {
81        }
82
83        @Override
84        public void setKeepScreenOn(boolean screenOn) {
85        }
86
87        @Override
88        public Canvas lockCanvas() {
89            return null;
90        }
91
92        @Override
93        public Canvas lockCanvas(Rect dirty) {
94            return null;
95        }
96
97        @Override
98        public void unlockCanvasAndPost(Canvas canvas) {
99        }
100
101        @Override
102        public Surface getSurface() {
103            return null;
104        }
105
106        @Override
107        public Rect getSurfaceFrame() {
108            return null;
109        }
110    };
111}
112
113