Home | History | Annotate | Download | only in webkit
      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 
     17 package android.webkit;
     18 
     19 import com.android.layoutlib.bridge.MockView;
     20 
     21 import android.content.Context;
     22 import android.graphics.Bitmap;
     23 import android.graphics.Picture;
     24 import android.os.Bundle;
     25 import android.os.Message;
     26 import android.util.AttributeSet;
     27 import 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  */
     37 public 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 WebBackForwardList saveState(Bundle outState) {
    103         return null;
    104     }
    105 
    106     public WebBackForwardList restoreState(Bundle inState) {
    107         return null;
    108     }
    109 
    110     public void loadUrl(String url) {
    111     }
    112 
    113     public void loadData(String data, String mimeType, String encoding) {
    114     }
    115 
    116     public void loadDataWithBaseURL(String baseUrl, String data,
    117             String mimeType, String encoding, String failUrl) {
    118     }
    119 
    120     public void stopLoading() {
    121     }
    122 
    123     public void reload() {
    124     }
    125 
    126     public boolean canGoBack() {
    127         return false;
    128     }
    129 
    130     public void goBack() {
    131     }
    132 
    133     public boolean canGoForward() {
    134         return false;
    135     }
    136 
    137     public void goForward() {
    138     }
    139 
    140     public boolean canGoBackOrForward(int steps) {
    141         return false;
    142     }
    143 
    144     public void goBackOrForward(int steps) {
    145     }
    146 
    147     public boolean pageUp(boolean top) {
    148         return false;
    149     }
    150 
    151     public boolean pageDown(boolean bottom) {
    152         return false;
    153     }
    154 
    155     public void clearView() {
    156     }
    157 
    158     public Picture capturePicture() {
    159         return null;
    160     }
    161 
    162     public float getScale() {
    163         return 0;
    164     }
    165 
    166     public void setInitialScale(int scaleInPercent) {
    167     }
    168 
    169     public void invokeZoomPicker() {
    170     }
    171 
    172     public void requestFocusNodeHref(Message hrefMsg) {
    173     }
    174 
    175     public void requestImageRef(Message msg) {
    176     }
    177 
    178     public String getUrl() {
    179         return null;
    180     }
    181 
    182     public String getTitle() {
    183         return null;
    184     }
    185 
    186     public Bitmap getFavicon() {
    187         return null;
    188     }
    189 
    190     public int getProgress() {
    191         return 0;
    192     }
    193 
    194     public int getContentHeight() {
    195         return 0;
    196     }
    197 
    198     public void pauseTimers() {
    199     }
    200 
    201     public void resumeTimers() {
    202     }
    203 
    204     public void clearCache() {
    205     }
    206 
    207     public void clearFormData() {
    208     }
    209 
    210     public void clearHistory() {
    211     }
    212 
    213     public void clearSslPreferences() {
    214     }
    215 
    216     public WebBackForwardList copyBackForwardList() {
    217         return null;
    218     }
    219 
    220     public static String findAddress(String addr) {
    221         return null;
    222     }
    223 
    224     public void documentHasImages(Message response) {
    225     }
    226 
    227     public void setWebViewClient(WebViewClient client) {
    228     }
    229 
    230     public void setDownloadListener(DownloadListener listener) {
    231     }
    232 
    233     public void setWebChromeClient(WebChromeClient client) {
    234     }
    235 
    236     public void addJavascriptInterface(Object obj, String interfaceName) {
    237     }
    238 
    239     public WebSettings getSettings() {
    240         return null;
    241     }
    242 
    243     public View getZoomControls() {
    244         return null;
    245     }
    246 
    247     public boolean zoomIn() {
    248         return false;
    249     }
    250 
    251     public boolean zoomOut() {
    252         return false;
    253     }
    254 }
    255