1/* 2 * Copyright (C) 2008 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.webkit; 18 19import com.android.layoutlib.bridge.MockView; 20 21import android.content.Context; 22import android.graphics.Bitmap; 23import android.graphics.Picture; 24import android.os.Bundle; 25import android.os.Message; 26import android.util.AttributeSet; 27import android.view.View; 28 29/** 30 * Mock version of the WebView. 31 * Only non override public methods from the real WebView have been added in there. 32 * Methods that take an unknown class as parameter or as return object, have been removed for now. 33 * 34 * TODO: generate automatically. 35 * 36 */ 37public class WebView extends MockView { 38 39 /** 40 * Construct a new WebView with a Context object. 41 * @param context A Context object used to access application assets. 42 */ 43 public WebView(Context context) { 44 this(context, null); 45 } 46 47 /** 48 * Construct a new WebView with layout parameters. 49 * @param context A Context object used to access application assets. 50 * @param attrs An AttributeSet passed to our parent. 51 */ 52 public WebView(Context context, AttributeSet attrs) { 53 this(context, attrs, com.android.internal.R.attr.webViewStyle); 54 } 55 56 /** 57 * Construct a new WebView with layout parameters and a default style. 58 * @param context A Context object used to access application assets. 59 * @param attrs An AttributeSet passed to our parent. 60 * @param defStyle The default style resource ID. 61 */ 62 public WebView(Context context, AttributeSet attrs, int defStyle) { 63 super(context, attrs, defStyle); 64 } 65 66 // START FAKE PUBLIC METHODS 67 68 public void setHorizontalScrollbarOverlay(boolean overlay) { 69 } 70 71 public void setVerticalScrollbarOverlay(boolean overlay) { 72 } 73 74 public boolean overlayHorizontalScrollbar() { 75 return false; 76 } 77 78 public boolean overlayVerticalScrollbar() { 79 return false; 80 } 81 82 public void savePassword(String host, String username, String password) { 83 } 84 85 public void setHttpAuthUsernamePassword(String host, String realm, 86 String username, String password) { 87 } 88 89 public String[] getHttpAuthUsernamePassword(String host, String realm) { 90 return null; 91 } 92 93 public void destroy() { 94 } 95 96 public static void enablePlatformNotifications() { 97 } 98 99 public static void disablePlatformNotifications() { 100 } 101 102 public void loadUrl(String url) { 103 } 104 105 public void loadData(String data, String mimeType, String encoding) { 106 } 107 108 public void loadDataWithBaseURL(String baseUrl, String data, 109 String mimeType, String encoding, String failUrl) { 110 } 111 112 public void stopLoading() { 113 } 114 115 public void reload() { 116 } 117 118 public boolean canGoBack() { 119 return false; 120 } 121 122 public void goBack() { 123 } 124 125 public boolean canGoForward() { 126 return false; 127 } 128 129 public void goForward() { 130 } 131 132 public boolean canGoBackOrForward(int steps) { 133 return false; 134 } 135 136 public void goBackOrForward(int steps) { 137 } 138 139 public boolean pageUp(boolean top) { 140 return false; 141 } 142 143 public boolean pageDown(boolean bottom) { 144 return false; 145 } 146 147 public void clearView() { 148 } 149 150 public Picture capturePicture() { 151 return null; 152 } 153 154 public float getScale() { 155 return 0; 156 } 157 158 public void setInitialScale(int scaleInPercent) { 159 } 160 161 public void invokeZoomPicker() { 162 } 163 164 public void requestFocusNodeHref(Message hrefMsg) { 165 } 166 167 public void requestImageRef(Message msg) { 168 } 169 170 public String getUrl() { 171 return null; 172 } 173 174 public String getTitle() { 175 return null; 176 } 177 178 public Bitmap getFavicon() { 179 return null; 180 } 181 182 public int getProgress() { 183 return 0; 184 } 185 186 public int getContentHeight() { 187 return 0; 188 } 189 190 public void pauseTimers() { 191 } 192 193 public void resumeTimers() { 194 } 195 196 public void clearCache() { 197 } 198 199 public void clearFormData() { 200 } 201 202 public void clearHistory() { 203 } 204 205 public void clearSslPreferences() { 206 } 207 208 public static String findAddress(String addr) { 209 return null; 210 } 211 212 public void documentHasImages(Message response) { 213 } 214 215 public void setWebViewClient(WebViewClient client) { 216 } 217 218 public void setDownloadListener(DownloadListener listener) { 219 } 220 221 public void setWebChromeClient(WebChromeClient client) { 222 } 223 224 public void addJavascriptInterface(Object obj, String interfaceName) { 225 } 226 227 public View getZoomControls() { 228 return null; 229 } 230 231 public boolean zoomIn() { 232 return false; 233 } 234 235 public boolean zoomOut() { 236 return false; 237 } 238} 239