The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 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 | |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 19 | import android.os.Message; |
Selim Gurun | 0ea6dad | 2012-03-29 18:19:01 -0700 | [diff] [blame] | 20 | import android.os.Build; |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 21 | |
| 22 | /** |
| 23 | * Manages settings state for a WebView. When a WebView is first created, it |
| 24 | * obtains a set of default settings. These default settings will be returned |
| 25 | * from any getter call. A WebSettings object obtained from |
| 26 | * WebView.getSettings() is tied to the life of the WebView. If a WebView has |
| 27 | * been destroyed, any method call on WebSettings will throw an |
| 28 | * IllegalStateException. |
| 29 | */ |
Jonathan Dixon | d3101b1 | 2012-04-12 20:51:51 +0100 | [diff] [blame] | 30 | // This is an abstract base class: concrete WebViewProviders must |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 31 | // create a class derived from this, and return an instance of it in the |
| 32 | // WebViewProvider.getWebSettingsProvider() method implementation. |
Selim Gurun | 0ea6dad | 2012-03-29 18:19:01 -0700 | [diff] [blame] | 33 | public abstract class WebSettings { |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 34 | /** |
| 35 | * Enum for controlling the layout of html. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 36 | * <ul> |
| 37 | * <li>NORMAL means no rendering changes.</li> |
| 38 | * <li>SINGLE_COLUMN moves all content into one column that is the width of the |
| 39 | * view.</li> |
| 40 | * <li>NARROW_COLUMNS makes all columns no wider than the screen if possible.</li> |
| 41 | * </ul> |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 42 | */ |
| 43 | // XXX: These must match LayoutAlgorithm in Settings.h in WebCore. |
| 44 | public enum LayoutAlgorithm { |
| 45 | NORMAL, |
John Reck | 5a1ef413 | 2011-10-26 10:37:00 -0700 | [diff] [blame] | 46 | /** |
| 47 | * @deprecated This algorithm is now obsolete. |
| 48 | */ |
| 49 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 50 | SINGLE_COLUMN, |
| 51 | NARROW_COLUMNS |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Enum for specifying the text size. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 56 | * <ul> |
| 57 | * <li>SMALLEST is 50%</li> |
| 58 | * <li>SMALLER is 75%</li> |
| 59 | * <li>NORMAL is 100%</li> |
| 60 | * <li>LARGER is 150%</li> |
| 61 | * <li>LARGEST is 200%</li> |
| 62 | * </ul> |
| 63 | * |
John Reck | caeb120 | 2011-06-17 11:50:15 -0700 | [diff] [blame] | 64 | * @deprecated Use {@link WebSettings#setTextZoom(int)} and {@link WebSettings#getTextZoom()} instead. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 65 | */ |
| 66 | public enum TextSize { |
| 67 | SMALLEST(50), |
| 68 | SMALLER(75), |
| 69 | NORMAL(100), |
| 70 | LARGER(150), |
| 71 | LARGEST(200); |
| 72 | TextSize(int size) { |
| 73 | value = size; |
| 74 | } |
| 75 | int value; |
| 76 | } |
Grace Kloba | 0d8b77c | 2009-06-25 11:20:51 -0700 | [diff] [blame] | 77 | |
| 78 | /** |
| 79 | * Enum for specifying the WebView's desired density. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 80 | * <ul> |
| 81 | * <li>FAR makes 100% looking like in 240dpi</li> |
| 82 | * <li>MEDIUM makes 100% looking like in 160dpi</li> |
| 83 | * <li>CLOSE makes 100% looking like in 120dpi</li> |
| 84 | * </ul> |
Grace Kloba | 0d8b77c | 2009-06-25 11:20:51 -0700 | [diff] [blame] | 85 | */ |
| 86 | public enum ZoomDensity { |
| 87 | FAR(150), // 240dpi |
| 88 | MEDIUM(100), // 160dpi |
| 89 | CLOSE(75); // 120dpi |
| 90 | ZoomDensity(int size) { |
| 91 | value = size; |
| 92 | } |
| 93 | int value; |
| 94 | } |
| 95 | |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 96 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 97 | * Default cache usage pattern. Use with {@link #setCacheMode}. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 98 | */ |
| 99 | public static final int LOAD_DEFAULT = -1; |
| 100 | |
| 101 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 102 | * Normal cache usage pattern. Use with {@link #setCacheMode}. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 103 | */ |
| 104 | public static final int LOAD_NORMAL = 0; |
| 105 | |
| 106 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 107 | * Use cache if content is there, even if expired (eg, history nav). |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 108 | * If it is not in the cache, load from network. |
| 109 | * Use with {@link #setCacheMode}. |
| 110 | */ |
| 111 | public static final int LOAD_CACHE_ELSE_NETWORK = 1; |
| 112 | |
| 113 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 114 | * Don't use the cache, load from network. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 115 | * Use with {@link #setCacheMode}. |
| 116 | */ |
| 117 | public static final int LOAD_NO_CACHE = 2; |
Michael Kolb | a172e7d | 2010-06-30 12:35:26 -0700 | [diff] [blame] | 118 | |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 119 | /** |
| 120 | * Don't use the network, load from cache only. |
| 121 | * Use with {@link #setCacheMode}. |
| 122 | */ |
| 123 | public static final int LOAD_CACHE_ONLY = 3; |
| 124 | |
| 125 | public enum RenderPriority { |
| 126 | NORMAL, |
| 127 | HIGH, |
| 128 | LOW |
| 129 | } |
| 130 | |
Patrick Scott | 300f2e9 | 2010-03-22 10:20:45 -0400 | [diff] [blame] | 131 | /** |
| 132 | * The plugin state effects how plugins are treated on a page. ON means |
| 133 | * that any object will be loaded even if a plugin does not exist to handle |
| 134 | * the content. ON_DEMAND means that if there is a plugin installed that |
| 135 | * can handle the content, a placeholder is shown until the user clicks on |
| 136 | * the placeholder. Once clicked, the plugin will be enabled on the page. |
| 137 | * OFF means that all plugins will be turned off and any fallback content |
| 138 | * will be used. |
| 139 | */ |
| 140 | public enum PluginState { |
| 141 | ON, |
| 142 | ON_DEMAND, |
| 143 | OFF |
| 144 | } |
| 145 | |
Ben Murdoch | e9e3ccd | 2010-10-06 14:33:02 +0100 | [diff] [blame] | 146 | /** |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 147 | * Hidden constructor to prevent clients from creating a new settings |
| 148 | * instance or deriving the class. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 149 | * |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 150 | * @hide |
Ben Murdoch | e9e3ccd | 2010-10-06 14:33:02 +0100 | [diff] [blame] | 151 | */ |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 152 | protected WebSettings() { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 153 | } |
Michael Kolb | a172e7d | 2010-06-30 12:35:26 -0700 | [diff] [blame] | 154 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 155 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 156 | * Enables dumping the pages navigation cache to a text file. The default |
| 157 | * is false. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 158 | * |
Kristian Monsen | fc77165 | 2011-05-10 16:44:05 +0100 | [diff] [blame] | 159 | * @deprecated This method is now obsolete. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 160 | */ |
Kristian Monsen | fc77165 | 2011-05-10 16:44:05 +0100 | [diff] [blame] | 161 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 162 | public void setNavDump(boolean enabled) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 163 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 167 | * Gets whether dumping the navigation cache is enabled. |
| 168 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 169 | * @return whether dumping the navigation cache is enabled |
| 170 | * @see #setNavDump |
Kristian Monsen | fc77165 | 2011-05-10 16:44:05 +0100 | [diff] [blame] | 171 | * @deprecated This method is now obsolete. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 172 | */ |
Kristian Monsen | fc77165 | 2011-05-10 16:44:05 +0100 | [diff] [blame] | 173 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 174 | public boolean getNavDump() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 175 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | /** |
Mikhail Naganov | b533fb4 | 2012-04-05 14:50:02 +0100 | [diff] [blame] | 179 | * Sets whether the WebView should support zooming using its on-screen zoom |
| 180 | * controls and gestures. The particular zoom mechanisms that should be used |
| 181 | * can be set with {@link #setBuiltInZoomControls}. This setting does not |
| 182 | * affect zooming performed using the {@link WebView#zoomIn()} and |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 183 | * {@link WebView#zoomOut()} methods. The default is true. |
| 184 | * |
| 185 | * @param support whether the WebView should support zoom |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 186 | */ |
| 187 | public void setSupportZoom(boolean support) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 188 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 192 | * Gets whether the WebView supports zoom. |
| 193 | * |
| 194 | * @return true if the WebView supports zoom |
| 195 | * @see #setSupportZoom |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 196 | */ |
| 197 | public boolean supportZoom() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 198 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | /** |
Steve Block | 06d268e | 2012-04-16 14:10:54 +0100 | [diff] [blame] | 202 | * Sets whether the WebView should use its built-in zoom mechanisms. The |
| 203 | * built-in zoom mechanisms comprise on-screen zoom controls, which are |
| 204 | * displayed over the WebView's content, and the use of a pinch gesture to |
| 205 | * control zooming. Whether or not these on-screen controls are displayed |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 206 | * can be set with {@link #setDisplayZoomControls}. The default is false. |
Steve Block | 06d268e | 2012-04-16 14:10:54 +0100 | [diff] [blame] | 207 | * <p> |
| 208 | * The built-in mechanisms are the only currently supported zoom |
| 209 | * mechanisms, so it is recommended that this setting is always enabled. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 210 | * |
| 211 | * @param enabled whether the WebView should use its built-in zoom mechanisms |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 212 | */ |
Steve Block | 06d268e | 2012-04-16 14:10:54 +0100 | [diff] [blame] | 213 | // This method was intended to select between the built-in zoom mechanisms |
| 214 | // and the separate zoom controls. The latter were obtained using |
| 215 | // {@link WebView#getZoomControls}, which is now hidden. |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 216 | public void setBuiltInZoomControls(boolean enabled) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 217 | throw new MustOverrideException(); |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 218 | } |
Michael Kolb | a172e7d | 2010-06-30 12:35:26 -0700 | [diff] [blame] | 219 | |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 220 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 221 | * Gets whether the zoom mechanisms built into WebView are being used. |
| 222 | * |
| 223 | * @return true if the zoom mechanisms built into WebView are being used |
| 224 | * @see #setBuiltInZoomControls |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 225 | */ |
| 226 | public boolean getBuiltInZoomControls() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 227 | throw new MustOverrideException(); |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 228 | } |
Michael Kolb | a172e7d | 2010-06-30 12:35:26 -0700 | [diff] [blame] | 229 | |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 230 | /** |
Mikhail Naganov | b533fb4 | 2012-04-05 14:50:02 +0100 | [diff] [blame] | 231 | * Sets whether the WebView should display on-screen zoom controls when |
| 232 | * using the built-in zoom mechanisms. See {@link #setBuiltInZoomControls}. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 233 | * The default is true. |
| 234 | * |
| 235 | * @param enabled whether the WebView should display on-screen zoom controls |
Michael Kolb | 6fe3b42 | 2010-08-19 12:41:24 -0700 | [diff] [blame] | 236 | */ |
| 237 | public void setDisplayZoomControls(boolean enabled) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 238 | throw new MustOverrideException(); |
Michael Kolb | 6fe3b42 | 2010-08-19 12:41:24 -0700 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 242 | * Gets whether the WebView displays on-screen zoom controls when using |
Mikhail Naganov | b533fb4 | 2012-04-05 14:50:02 +0100 | [diff] [blame] | 243 | * the built-in zoom mechanisms. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 244 | * |
| 245 | * @return true if the WebView displays on-screen zoom controls when using |
| 246 | * the built-in zoom mechanisms |
| 247 | * @see #setDisplayZoomControls |
Michael Kolb | 6fe3b42 | 2010-08-19 12:41:24 -0700 | [diff] [blame] | 248 | */ |
| 249 | public boolean getDisplayZoomControls() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 250 | throw new MustOverrideException(); |
Michael Kolb | 6fe3b42 | 2010-08-19 12:41:24 -0700 | [diff] [blame] | 251 | } |
| 252 | |
| 253 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 254 | * Enables or disables file access within WebView. File access is enabled by |
Patrick Scott | d1737ed | 2011-01-05 11:36:48 -0500 | [diff] [blame] | 255 | * default. Note that this enables or disables file system access only. |
| 256 | * Assets and resources are still accessible using file:///android_asset and |
| 257 | * file:///android_res. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 258 | */ |
| 259 | public void setAllowFileAccess(boolean allow) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 260 | throw new MustOverrideException(); |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 264 | * Gets whether this WebView supports file access. |
| 265 | * |
| 266 | * @see #setAllowFileAccess |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 267 | */ |
| 268 | public boolean getAllowFileAccess() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 269 | throw new MustOverrideException(); |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 273 | * Enables or disables content URL access within WebView. Content URL |
| 274 | * access allows WebView to load content from a content provider installed |
| 275 | * in the system. The default is enabled. |
Patrick Scott | d1737ed | 2011-01-05 11:36:48 -0500 | [diff] [blame] | 276 | */ |
| 277 | public void setAllowContentAccess(boolean allow) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 278 | throw new MustOverrideException(); |
Patrick Scott | d1737ed | 2011-01-05 11:36:48 -0500 | [diff] [blame] | 279 | } |
| 280 | |
| 281 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 282 | * Gets whether this WebView supports content URL access. |
| 283 | * |
| 284 | * @see #setAllowContentAccess |
Patrick Scott | d1737ed | 2011-01-05 11:36:48 -0500 | [diff] [blame] | 285 | */ |
| 286 | public boolean getAllowContentAccess() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 287 | throw new MustOverrideException(); |
Patrick Scott | d1737ed | 2011-01-05 11:36:48 -0500 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 291 | * Sets whether the WebView loads pages in overview mode. The default is |
| 292 | * false. |
Grace Kloba | e397a88 | 2009-08-06 12:04:14 -0700 | [diff] [blame] | 293 | */ |
| 294 | public void setLoadWithOverviewMode(boolean overview) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 295 | throw new MustOverrideException(); |
Grace Kloba | e397a88 | 2009-08-06 12:04:14 -0700 | [diff] [blame] | 296 | } |
| 297 | |
| 298 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 299 | * Gets whether this WebView loads pages in overview mode. |
| 300 | * |
| 301 | * @return whether this WebView loads pages in overview mode |
| 302 | * @see #setLoadWithOverviewMode |
Grace Kloba | e397a88 | 2009-08-06 12:04:14 -0700 | [diff] [blame] | 303 | */ |
| 304 | public boolean getLoadWithOverviewMode() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 305 | throw new MustOverrideException(); |
Grace Kloba | e397a88 | 2009-08-06 12:04:14 -0700 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 309 | * Sets whether the WebView will enable smooth transition while panning or |
Adam Powell | e00e8a78 | 2011-09-11 17:48:42 -0700 | [diff] [blame] | 310 | * zooming or while the window hosting the WebView does not have focus. |
| 311 | * If it is true, WebView will choose a solution to maximize the performance. |
| 312 | * e.g. the WebView's content may not be updated during the transition. |
| 313 | * If it is false, WebView will keep its fidelity. The default value is false. |
Grace Kloba | f9b731d | 2010-06-21 19:23:57 -0700 | [diff] [blame] | 314 | */ |
| 315 | public void setEnableSmoothTransition(boolean enable) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 316 | throw new MustOverrideException(); |
Grace Kloba | f9b731d | 2010-06-21 19:23:57 -0700 | [diff] [blame] | 317 | } |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 318 | |
Grace Kloba | f9b731d | 2010-06-21 19:23:57 -0700 | [diff] [blame] | 319 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 320 | * Gets whether the WebView enables smooth transition while panning or |
Grace Kloba | f9b731d | 2010-06-21 19:23:57 -0700 | [diff] [blame] | 321 | * zooming. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 322 | * |
| 323 | * @see #setEnableSmoothTransition |
Grace Kloba | f9b731d | 2010-06-21 19:23:57 -0700 | [diff] [blame] | 324 | */ |
| 325 | public boolean enableSmoothTransition() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 326 | throw new MustOverrideException(); |
Grace Kloba | f9b731d | 2010-06-21 19:23:57 -0700 | [diff] [blame] | 327 | } |
| 328 | |
| 329 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 330 | * Sets whether the WebView uses its background for over scroll background. |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 331 | * If true, it will use the WebView's background. If false, it will use an |
| 332 | * internal pattern. Default is true. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 333 | * |
Kristian Monsen | fc77165 | 2011-05-10 16:44:05 +0100 | [diff] [blame] | 334 | * @deprecated This method is now obsolete. |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 335 | */ |
Kristian Monsen | fc77165 | 2011-05-10 16:44:05 +0100 | [diff] [blame] | 336 | @Deprecated |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 337 | public void setUseWebViewBackgroundForOverscrollBackground(boolean view) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 338 | throw new MustOverrideException(); |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 339 | } |
| 340 | |
| 341 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 342 | * Gets whether this WebView uses WebView's background instead of |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 343 | * internal pattern for over scroll background. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 344 | * |
| 345 | * @see #setUseWebViewBackgroundForOverscrollBackground |
Kristian Monsen | fc77165 | 2011-05-10 16:44:05 +0100 | [diff] [blame] | 346 | * @deprecated This method is now obsolete. |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 347 | */ |
Kristian Monsen | fc77165 | 2011-05-10 16:44:05 +0100 | [diff] [blame] | 348 | @Deprecated |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 349 | public boolean getUseWebViewBackgroundForOverscrollBackground() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 350 | throw new MustOverrideException(); |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 351 | } |
| 352 | |
| 353 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 354 | * Sets whether the WebView should save form data. The default is true, |
| 355 | * unless in private browsing mode, when the value is always false. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 356 | */ |
| 357 | public void setSaveFormData(boolean save) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 358 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 362 | * Gets whether the WebView saves form data. Always false in private |
| 363 | * browsing mode. |
| 364 | * |
| 365 | * @return whether the WebView saves form data |
| 366 | * @see #setSaveFormData |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 367 | */ |
| 368 | public boolean getSaveFormData() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 369 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 370 | } |
| 371 | |
| 372 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 373 | * Sets whether the WebView should save passwords. The default is true. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 374 | */ |
| 375 | public void setSavePassword(boolean save) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 376 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 377 | } |
| 378 | |
| 379 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 380 | * Gets whether the WebView saves passwords. |
| 381 | * |
| 382 | * @return whether the WebView saves passwords |
| 383 | * @see #setSavePassword |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 384 | */ |
| 385 | public boolean getSavePassword() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 386 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 390 | * Sets the text zoom of the page in percent. The default is 100. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 391 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 392 | * @param textZoom the text zoom in percent |
John Reck | ff56bcd | 2011-06-16 17:12:08 -0700 | [diff] [blame] | 393 | */ |
| 394 | public synchronized void setTextZoom(int textZoom) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 395 | throw new MustOverrideException(); |
John Reck | ff56bcd | 2011-06-16 17:12:08 -0700 | [diff] [blame] | 396 | } |
| 397 | |
| 398 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 399 | * Gets the text zoom of the page in percent. |
| 400 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 401 | * @return the text zoom of the page in percent |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 402 | * @see #setTextSizeZoom |
John Reck | ff56bcd | 2011-06-16 17:12:08 -0700 | [diff] [blame] | 403 | */ |
| 404 | public synchronized int getTextZoom() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 405 | throw new MustOverrideException(); |
John Reck | ff56bcd | 2011-06-16 17:12:08 -0700 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 409 | * Sets the text size of the page. The default is {@link TextSize#NORMAL}. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 410 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 411 | * @param t the text size as a {@link TextSize} value |
| 412 | * @deprecated Use {@link #setTextZoom} instead. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 413 | */ |
| 414 | public synchronized void setTextSize(TextSize t) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 415 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 416 | } |
| 417 | |
| 418 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 419 | * Gets the text size of the page. If the text size was previously specified |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 420 | * in percent using {@link #setTextZoom}, this will return the closest |
| 421 | * matching {@link TextSize}. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 422 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 423 | * @return the text size as a {@link TextSize} value |
| 424 | * @see #setTextSize |
| 425 | * @deprecated Use {@link #getTextZoom} instead. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 426 | */ |
| 427 | public synchronized TextSize getTextSize() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 428 | throw new MustOverrideException(); |
Mangesh Ghiware | edb528e | 2011-10-12 14:25:41 -0700 | [diff] [blame] | 429 | } |
| 430 | |
| 431 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 432 | * Sets the default zoom density of the page. This must be called from the UI |
| 433 | * thread. The default is {@link ZoomDensity#MEDIUM}. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 434 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 435 | * @param zoom the zoom density |
Grace Kloba | 0d8b77c | 2009-06-25 11:20:51 -0700 | [diff] [blame] | 436 | */ |
| 437 | public void setDefaultZoom(ZoomDensity zoom) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 438 | throw new MustOverrideException(); |
Grace Kloba | 0d8b77c | 2009-06-25 11:20:51 -0700 | [diff] [blame] | 439 | } |
| 440 | |
| 441 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 442 | * Gets the default zoom density of the page. This should be called from |
| 443 | * the UI thread. |
| 444 | * |
| 445 | * @return the zoom density |
| 446 | * @see #setDefaultZoom |
Grace Kloba | 0d8b77c | 2009-06-25 11:20:51 -0700 | [diff] [blame] | 447 | */ |
| 448 | public ZoomDensity getDefaultZoom() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 449 | throw new MustOverrideException(); |
Grace Kloba | 0d8b77c | 2009-06-25 11:20:51 -0700 | [diff] [blame] | 450 | } |
| 451 | |
| 452 | /** |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 453 | * Enables using light touches to make a selection and activate mouseovers. |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 454 | * The default is false. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 455 | */ |
| 456 | public void setLightTouchEnabled(boolean enabled) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 457 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 458 | } |
| 459 | |
| 460 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 461 | * Gets whether light touches are enabled. |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 462 | * |
| 463 | * @return whether light touches are enabled |
| 464 | * @see #setLightTouchEnabled |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 465 | */ |
| 466 | public boolean getLightTouchEnabled() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 467 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 468 | } |
| 469 | |
| 470 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 471 | * Controlled a rendering optimization that is no longer present. Setting |
| 472 | * it now has no effect. |
| 473 | * |
| 474 | * @deprecated This setting now has no effect. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 475 | */ |
Mike Hearn | adcd2ed | 2009-01-21 16:44:36 +0100 | [diff] [blame] | 476 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 477 | public synchronized void setUseDoubleTree(boolean use) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 478 | // Specified to do nothing, so no need for derived classes to override. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 479 | } |
| 480 | |
| 481 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 482 | * Controlled a rendering optimization that is no longer present. Setting |
| 483 | * it now has no effect. |
| 484 | * |
| 485 | * @deprecated This setting now has no effect. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 486 | */ |
Mike Hearn | adcd2ed | 2009-01-21 16:44:36 +0100 | [diff] [blame] | 487 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 488 | public synchronized boolean getUseDoubleTree() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 489 | // Returns false unconditionally, so no need for derived classes to override. |
Mike Hearn | adcd2ed | 2009-01-21 16:44:36 +0100 | [diff] [blame] | 490 | return false; |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 491 | } |
| 492 | |
| 493 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 494 | * Sets the user-agent string using an integer code. |
| 495 | * <ul> |
| 496 | * <li>0 means the WebView should use an Android user-agent string</li> |
| 497 | * <li>1 means the WebView should use a desktop user-agent string</li> |
| 498 | * </ul> |
| 499 | * Other values are ignored. The default is an Android user-agent string, |
| 500 | * i.e. code value 0. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 501 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 502 | * @param ua the integer code for the user-agent string |
| 503 | * @deprecated Please use {@link #setUserAgentString} instead. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 504 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 505 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 506 | public synchronized void setUserAgent(int ua) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 507 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 508 | } |
| 509 | |
| 510 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 511 | * Gets the user-agent as an integer code. |
| 512 | * <ul> |
| 513 | * <li>-1 means the WebView is using a custom user-agent string set with |
| 514 | * {@link #setUserAgentString}</li> |
| 515 | * <li>0 means the WebView should use an Android user-agent string</li> |
| 516 | * <li>1 means the WebView should use a desktop user-agent string</li> |
| 517 | * </ul> |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 518 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 519 | * @return the integer code for the user-agent string |
| 520 | * @see #setUserAgent |
| 521 | * @deprecated Please use {@link #getUserAgentString} instead. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 522 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 523 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 524 | public synchronized int getUserAgent() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 525 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 526 | } |
| 527 | |
| 528 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 529 | * Tells the WebView to use a wide viewport. The default is false. |
| 530 | * |
| 531 | * @param use whether to use a wide viewport |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 532 | */ |
| 533 | public synchronized void setUseWideViewPort(boolean use) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 534 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 535 | } |
| 536 | |
| 537 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 538 | * Gets whether the WebView is using a wide viewport. |
| 539 | * |
| 540 | * @return true if the WebView is using a wide viewport |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 541 | * @see #setUseWideViewPort |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 542 | */ |
| 543 | public synchronized boolean getUseWideViewPort() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 544 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 545 | } |
| 546 | |
| 547 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 548 | * Sets whether the WebView whether supports multiple windows. If set to |
| 549 | * true, {@link WebChromeClient#onCreateWindow} must be implemented by the |
| 550 | * host application. The default is false. |
| 551 | * |
| 552 | * @param support whether to suport multiple windows |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 553 | */ |
| 554 | public synchronized void setSupportMultipleWindows(boolean support) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 555 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 556 | } |
| 557 | |
| 558 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 559 | * Gets whether the WebView supports multiple windows. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 560 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 561 | * @return true if the WebView supports multiple windows |
| 562 | * @see #setSupportMultipleWindows |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 563 | */ |
| 564 | public synchronized boolean supportMultipleWindows() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 565 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 566 | } |
| 567 | |
| 568 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 569 | * Sets the underlying layout algorithm. This will cause a relayout of the |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 570 | * WebView. The default is {@link LayoutAlgorithm#NARROW_COLUMNS}. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 571 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 572 | * @param l the layout algorithm to use, as a {@link LayoutAlgorithm} value |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 573 | */ |
| 574 | public synchronized void setLayoutAlgorithm(LayoutAlgorithm l) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 575 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 576 | } |
| 577 | |
| 578 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 579 | * Gets the current layout algorithm. |
| 580 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 581 | * @return the layout algorithm in use, as a {@link LayoutAlgorithm} value |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 582 | * @see #setLayoutAlgorithm |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 583 | */ |
| 584 | public synchronized LayoutAlgorithm getLayoutAlgorithm() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 585 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 586 | } |
| 587 | |
| 588 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 589 | * Sets the standard font family name. The default is "sans-serif". |
| 590 | * |
| 591 | * @param font a font family name |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 592 | */ |
| 593 | public synchronized void setStandardFontFamily(String font) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 594 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 595 | } |
| 596 | |
| 597 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 598 | * Gets the standard font family name. |
| 599 | * |
| 600 | * @return the standard font family name as a string |
| 601 | * @see #setStandardFontFamily |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 602 | */ |
| 603 | public synchronized String getStandardFontFamily() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 604 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 605 | } |
| 606 | |
| 607 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 608 | * Sets the fixed font family name. The default is "monospace". |
| 609 | * |
| 610 | * @param font a font family name |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 611 | */ |
| 612 | public synchronized void setFixedFontFamily(String font) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 613 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 614 | } |
| 615 | |
| 616 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 617 | * Gets the fixed font family name. |
| 618 | * |
| 619 | * @return the fixed font family name as a string |
| 620 | * @see #setFixedFontFamily |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 621 | */ |
| 622 | public synchronized String getFixedFontFamily() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 623 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 624 | } |
| 625 | |
| 626 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 627 | * Sets the sans-serif font family name. The default is "sans-serif". |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 628 | * |
| 629 | * @param font a font family name |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 630 | */ |
| 631 | public synchronized void setSansSerifFontFamily(String font) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 632 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 633 | } |
| 634 | |
| 635 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 636 | * Gets the sans-serif font family name. |
| 637 | * |
| 638 | * @return the sans-serif font family name as a string |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 639 | * @see #setSansSerifFontFamily |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 640 | */ |
| 641 | public synchronized String getSansSerifFontFamily() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 642 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 643 | } |
| 644 | |
| 645 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 646 | * Sets the serif font family name. The default is "sans-serif". |
| 647 | * |
| 648 | * @param font a font family name |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 649 | */ |
| 650 | public synchronized void setSerifFontFamily(String font) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 651 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 652 | } |
| 653 | |
| 654 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 655 | * Gets the serif font family name. The default is "serif". |
| 656 | * |
| 657 | * @return the serif font family name as a string |
| 658 | * @see #setSerifFontFamily |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 659 | */ |
| 660 | public synchronized String getSerifFontFamily() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 661 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 662 | } |
| 663 | |
| 664 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 665 | * Sets the cursive font family name. The default is "cursive". |
| 666 | * |
| 667 | * @param font a font family name |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 668 | */ |
| 669 | public synchronized void setCursiveFontFamily(String font) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 670 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 671 | } |
| 672 | |
| 673 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 674 | * Gets the cursive font family name. |
| 675 | * |
| 676 | * @return the cursive font family name as a string |
| 677 | * @see #setCursiveFontFamily |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 678 | */ |
| 679 | public synchronized String getCursiveFontFamily() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 680 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 681 | } |
| 682 | |
| 683 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 684 | * Sets the fantasy font family name. The default is "fantasy". |
| 685 | * |
| 686 | * @param font a font family name |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 687 | */ |
| 688 | public synchronized void setFantasyFontFamily(String font) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 689 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 690 | } |
| 691 | |
| 692 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 693 | * Gets the fantasy font family name. |
| 694 | * |
| 695 | * @return the fantasy font family name as a string |
| 696 | * @see #setFantasyFontFamily |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 697 | */ |
| 698 | public synchronized String getFantasyFontFamily() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 699 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 700 | } |
| 701 | |
| 702 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 703 | * Sets the minimum font size. The default is 8. |
| 704 | * |
| 705 | * @param size a non-negative integer between 1 and 72. Any number outside |
| 706 | * the specified range will be pinned. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 707 | */ |
| 708 | public synchronized void setMinimumFontSize(int size) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 709 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 710 | } |
| 711 | |
| 712 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 713 | * Gets the minimum font size. |
| 714 | * |
| 715 | * @return a non-negative integer between 1 and 72 |
| 716 | * @see #setMinimumFontSize |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 717 | */ |
| 718 | public synchronized int getMinimumFontSize() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 719 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 720 | } |
| 721 | |
| 722 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 723 | * Sets the minimum logical font size. The default is 8. |
| 724 | * |
| 725 | * @param size a non-negative integer between 1 and 72. Any number outside |
| 726 | * the specified range will be pinned. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 727 | */ |
| 728 | public synchronized void setMinimumLogicalFontSize(int size) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 729 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 730 | } |
| 731 | |
| 732 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 733 | * Gets the minimum logical font size. |
| 734 | * |
| 735 | * @return a non-negative integer between 1 and 72 |
| 736 | * @see #setMinimumLogicalFontSize |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 737 | */ |
| 738 | public synchronized int getMinimumLogicalFontSize() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 739 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 740 | } |
| 741 | |
| 742 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 743 | * Sets the default font size. The default is 16. |
| 744 | * |
| 745 | * @param size a non-negative integer between 1 and 72. Any number outside |
| 746 | * the specified range will be pinned. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 747 | */ |
| 748 | public synchronized void setDefaultFontSize(int size) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 749 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 750 | } |
| 751 | |
| 752 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 753 | * Gets the default font size. |
| 754 | * |
| 755 | * @return a non-negative integer between 1 and 72 |
| 756 | * @see #setDefaultFontSize |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 757 | */ |
| 758 | public synchronized int getDefaultFontSize() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 759 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 760 | } |
| 761 | |
| 762 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 763 | * Sets the default fixed font size. The default is 16. |
| 764 | * |
| 765 | * @param size a non-negative integer between 1 and 72. Any number outside |
| 766 | * the specified range will be pinned. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 767 | */ |
| 768 | public synchronized void setDefaultFixedFontSize(int size) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 769 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 770 | } |
| 771 | |
| 772 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 773 | * Gets the default fixed font size. |
| 774 | * |
| 775 | * @return a non-negative integer between 1 and 72 |
| 776 | * @see #setDefaultFixedFontSize |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 777 | */ |
| 778 | public synchronized int getDefaultFixedFontSize() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 779 | throw new MustOverrideException(); |
Grace Kloba | 097b1e77 | 2009-11-24 14:23:18 -0800 | [diff] [blame] | 780 | } |
| 781 | |
| 782 | /** |
Mikhail Naganov | 605a491 | 2012-02-03 16:53:10 +0000 | [diff] [blame] | 783 | * Sets whether the WebView should load image resources. Note that this method |
| 784 | * controls loading of all images, including those embedded using the data |
| 785 | * URI scheme. Use {@link #setBlockNetworkImage} to control loading only |
| 786 | * of images specified using network URI schemes. Note that if the value of this |
| 787 | * setting is changed from false to true, all images resources referenced |
| 788 | * by content currently displayed by the WebView are loaded automatically. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 789 | * The default is true. |
| 790 | * |
| 791 | * @param flag whether the WebView should load image resources |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 792 | */ |
| 793 | public synchronized void setLoadsImagesAutomatically(boolean flag) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 794 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 795 | } |
| 796 | |
| 797 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 798 | * Gets whether the WebView loads image resources. This includes |
| 799 | * images embedded using the data URI scheme. |
| 800 | * |
| 801 | * @return true if the WebView loads image resources |
| 802 | * @see #setLoadsImagesAutomatically |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 803 | */ |
| 804 | public synchronized boolean getLoadsImagesAutomatically() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 805 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 806 | } |
| 807 | |
| 808 | /** |
Mikhail Naganov | 605a491 | 2012-02-03 16:53:10 +0000 | [diff] [blame] | 809 | * Sets whether the WebView should not load image resources from the |
| 810 | * network (resources accessed via http and https URI schemes). Note |
| 811 | * that this method has no effect unless |
| 812 | * {@link #getLoadsImagesAutomatically} returns true. Also note that |
| 813 | * disabling all network loads using {@link #setBlockNetworkLoads} |
| 814 | * will also prevent network images from loading, even if this flag is set |
| 815 | * to false. When the value of this setting is changed from true to false, |
| 816 | * network images resources referenced by content currently displayed by |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 817 | * the WebView are fetched automatically. The default is false. |
| 818 | * |
| 819 | * @param flag whether the WebView should not load image resources from the |
| 820 | * network |
Patrick Scott | f43113f | 2010-02-18 09:13:12 -0500 | [diff] [blame] | 821 | * @see #setBlockNetworkLoads |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 822 | */ |
| 823 | public synchronized void setBlockNetworkImage(boolean flag) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 824 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 825 | } |
| 826 | |
| 827 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 828 | * Gets whether the WebView does not load image resources from the network. |
| 829 | * |
| 830 | * @return true if the WebView does not load image resources from the network |
| 831 | * @see #setBlockNetworkImage |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 832 | */ |
| 833 | public synchronized boolean getBlockNetworkImage() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 834 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 835 | } |
Mike Hearn | adcd2ed | 2009-01-21 16:44:36 +0100 | [diff] [blame] | 836 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 837 | /** |
Mikhail Naganov | 605a491 | 2012-02-03 16:53:10 +0000 | [diff] [blame] | 838 | * Sets whether the WebView should not load resources from the network. |
| 839 | * Use {@link #setBlockNetworkImage} to only avoid loading |
| 840 | * image resources. Note that if the value of this setting is |
| 841 | * changed from true to false, network resources referenced by content |
| 842 | * currently displayed by the WebView are not fetched until |
| 843 | * {@link android.webkit.WebView#reload} is called. |
| 844 | * If the application does not have the |
| 845 | * {@link android.Manifest.permission#INTERNET} permission, attempts to set |
| 846 | * a value of false will cause a {@link java.lang.SecurityException} |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 847 | * to be thrown. The default value is false if the application has the |
| 848 | * {@link android.Manifest.permission#INTERNET} permission, otherwise it is |
| 849 | * true. |
| 850 | * |
| 851 | * @param flag whether the WebView should not load any resources from the |
| 852 | * network |
Patrick Scott | f43113f | 2010-02-18 09:13:12 -0500 | [diff] [blame] | 853 | * @see android.webkit.WebView#reload |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 854 | */ |
| 855 | public synchronized void setBlockNetworkLoads(boolean flag) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 856 | throw new MustOverrideException(); |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 857 | } |
| 858 | |
| 859 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 860 | * Gets whether the WebView does not load any resources from the network. |
| 861 | * |
| 862 | * @return true if the WebView does not load any resources from the network |
| 863 | * @see #setBlockNetworkLoads |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 864 | */ |
| 865 | public synchronized boolean getBlockNetworkLoads() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 866 | throw new MustOverrideException(); |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 867 | } |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 868 | |
| 869 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 870 | * Tells the WebView to enable JavaScript execution. |
| 871 | * <b>The default is false.</b> |
| 872 | * |
| 873 | * @param flag true if the WebView should execute JavaScript |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 874 | */ |
| 875 | public synchronized void setJavaScriptEnabled(boolean flag) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 876 | throw new MustOverrideException(); |
Teng-Hui Zhu | da7378e | 2011-02-16 11:25:03 -0800 | [diff] [blame] | 877 | } |
| 878 | |
| 879 | /** |
Steve Block | ef16315 | 2012-04-23 18:08:06 +0100 | [diff] [blame] | 880 | * Sets whether JavaScript running in the context of a file scheme URL |
| 881 | * should be allowed to access content from any origin. This includes |
| 882 | * access to content from other file scheme URLs. See |
| 883 | * {@link #setAllowFileAccessFromFileURLs}. To enable the most restrictive, |
| 884 | * and therefore secure policy, this setting should be disabled. |
| 885 | * <p> |
| 886 | * The default value is true for API level |
| 887 | * {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1} and below, |
| 888 | * and false for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN} |
| 889 | * and above. |
Selim Gurun | 0ea6dad | 2012-03-29 18:19:01 -0700 | [diff] [blame] | 890 | * |
Steve Block | ef16315 | 2012-04-23 18:08:06 +0100 | [diff] [blame] | 891 | * @param flag whether JavaScript running in the context of a file scheme |
| 892 | * URL should be allowed to access content from any origin |
Selim Gurun | 0ea6dad | 2012-03-29 18:19:01 -0700 | [diff] [blame] | 893 | */ |
| 894 | public abstract void setAllowUniversalAccessFromFileURLs(boolean flag); |
| 895 | |
| 896 | /** |
Steve Block | ef16315 | 2012-04-23 18:08:06 +0100 | [diff] [blame] | 897 | * Sets whether JavaScript running in the context of a file scheme URL |
| 898 | * should be allowed to access content from other file scheme URLs. To |
| 899 | * enable the most restrictive, and therefore secure policy, this setting |
| 900 | * should be disabled. Note that the value of this setting is ignored if |
| 901 | * the value of {@link #getAllowUniversalAccessFromFileURLs} is true. |
| 902 | * <p> |
| 903 | * The default value is true for API level |
| 904 | * {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1} and below, |
| 905 | * and false for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN} |
| 906 | * and above. |
Selim Gurun | 0ea6dad | 2012-03-29 18:19:01 -0700 | [diff] [blame] | 907 | * |
Steve Block | ef16315 | 2012-04-23 18:08:06 +0100 | [diff] [blame] | 908 | * @param flag whether JavaScript running in the context of a file scheme |
| 909 | * URL should be allowed to access content from other file |
| 910 | * scheme URLs |
Selim Gurun | 0ea6dad | 2012-03-29 18:19:01 -0700 | [diff] [blame] | 911 | */ |
| 912 | public abstract void setAllowFileAccessFromFileURLs(boolean flag); |
| 913 | |
| 914 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 915 | * Sets whether the WebView should enable plugins. The default is false. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 916 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 917 | * @param flag true if plugins should be enabled |
Patrick Scott | 300f2e9 | 2010-03-22 10:20:45 -0400 | [diff] [blame] | 918 | * @deprecated This method has been deprecated in favor of |
| 919 | * {@link #setPluginState} |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 920 | */ |
Michael Kolb | a172e7d | 2010-06-30 12:35:26 -0700 | [diff] [blame] | 921 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 922 | public synchronized void setPluginsEnabled(boolean flag) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 923 | throw new MustOverrideException(); |
Patrick Scott | 300f2e9 | 2010-03-22 10:20:45 -0400 | [diff] [blame] | 924 | } |
| 925 | |
| 926 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 927 | * Tells the WebView to enable, disable, or have plugins on demand. On |
Patrick Scott | 300f2e9 | 2010-03-22 10:20:45 -0400 | [diff] [blame] | 928 | * demand mode means that if a plugin exists that can handle the embedded |
| 929 | * content, a placeholder icon will be shown instead of the plugin. When |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 930 | * the placeholder is clicked, the plugin will be enabled. The default is |
| 931 | * {@link PluginState#OFF}. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 932 | * |
| 933 | * @param state a PluginState value |
Patrick Scott | 300f2e9 | 2010-03-22 10:20:45 -0400 | [diff] [blame] | 934 | */ |
| 935 | public synchronized void setPluginState(PluginState state) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 936 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 937 | } |
| 938 | |
| 939 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 940 | * Sets a custom path to plugins used by the WebView. This method is |
Derek Sollenberger | fdbdeb3 | 2010-08-12 11:20:13 -0400 | [diff] [blame] | 941 | * obsolete since each plugin is now loaded from its own package. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 942 | * |
| 943 | * @param pluginsPath a String path to the directory containing plugins |
Derek Sollenberger | fdbdeb3 | 2010-08-12 11:20:13 -0400 | [diff] [blame] | 944 | * @deprecated This method is no longer used as plugins are loaded from |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 945 | * their own APK via the system's package manager. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 946 | */ |
Jason Chen | 9dc2e75 | 2010-09-01 19:11:14 -0700 | [diff] [blame] | 947 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 948 | public synchronized void setPluginsPath(String pluginsPath) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 949 | // Specified to do nothing, so no need for derived classes to override. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 950 | } |
| 951 | |
| 952 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 953 | * Sets the path to where database storage API databases should be saved. |
Steve Block | 72ca7a4 | 2012-06-13 22:00:30 +0100 | [diff] [blame] | 954 | * In order for the database storage API to function correctly, this method |
| 955 | * must be called with a path to which the application can write. This |
| 956 | * method should only be called once: repeated calls are ignored. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 957 | * |
Steve Block | 72ca7a4 | 2012-06-13 22:00:30 +0100 | [diff] [blame] | 958 | * @param databasePath a path to the directory where databases should be |
| 959 | * saved. |
Ben Murdoch | 7df1985 | 2009-04-22 13:07:58 +0100 | [diff] [blame] | 960 | */ |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 961 | // This will update WebCore when the Sync runs in the C++ side. |
Steve Block | 72ca7a4 | 2012-06-13 22:00:30 +0100 | [diff] [blame] | 962 | // Note that the WebCore Database Tracker only allows the path to be set |
| 963 | // once. |
Ben Murdoch | 7df1985 | 2009-04-22 13:07:58 +0100 | [diff] [blame] | 964 | public synchronized void setDatabasePath(String databasePath) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 965 | throw new MustOverrideException(); |
Ben Murdoch | 7df1985 | 2009-04-22 13:07:58 +0100 | [diff] [blame] | 966 | } |
| 967 | |
| 968 | /** |
Steve Block | 72ca7a4 | 2012-06-13 22:00:30 +0100 | [diff] [blame] | 969 | * Sets the path where the Geolocation databases should be saved. In order |
| 970 | * for Geolocation permissions and cached positions to be persisted, this |
| 971 | * method must be called with a path to which the application can write. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 972 | * |
Steve Block | 72ca7a4 | 2012-06-13 22:00:30 +0100 | [diff] [blame] | 973 | * @param databasePath a path to the directory where databases should be |
| 974 | * saved. |
Steve Block | 9d3273f | 2009-08-21 13:16:27 +0100 | [diff] [blame] | 975 | */ |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 976 | // This will update WebCore when the Sync runs in the C++ side. |
Steve Block | 9d3273f | 2009-08-21 13:16:27 +0100 | [diff] [blame] | 977 | public synchronized void setGeolocationDatabasePath(String databasePath) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 978 | throw new MustOverrideException(); |
Steve Block | 9d3273f | 2009-08-21 13:16:27 +0100 | [diff] [blame] | 979 | } |
| 980 | |
| 981 | /** |
Steve Block | 72ca7a4 | 2012-06-13 22:00:30 +0100 | [diff] [blame] | 982 | * Sets whether the Application Caches API should be enabled. The default |
| 983 | * is false. Note that in order for the Application Caches API to be |
| 984 | * enabled, a valid database path must also be supplied to |
| 985 | * {@link #setAppCachePath}. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 986 | * |
| 987 | * @param flag true if the WebView should enable Application Caches |
Andrei Popescu | 60a9a7d | 2009-04-17 10:43:42 +0100 | [diff] [blame] | 988 | */ |
| 989 | public synchronized void setAppCacheEnabled(boolean flag) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 990 | throw new MustOverrideException(); |
Andrei Popescu | 60a9a7d | 2009-04-17 10:43:42 +0100 | [diff] [blame] | 991 | } |
| 992 | |
| 993 | /** |
Steve Block | 72ca7a4 | 2012-06-13 22:00:30 +0100 | [diff] [blame] | 994 | * Sets the path to the Application Caches files. In order for the |
| 995 | * Application Caches API to be enabled, this method must be called with a |
| 996 | * path to which the application can write. This method should only be |
| 997 | * called once: repeated calls are ignored. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 998 | * |
| 999 | * @param appCachePath a String path to the directory containing |
Steve Block | 72ca7a4 | 2012-06-13 22:00:30 +0100 | [diff] [blame] | 1000 | * Application Caches files. |
| 1001 | * @see setAppCacheEnabled |
Andrei Popescu | 60a9a7d | 2009-04-17 10:43:42 +0100 | [diff] [blame] | 1002 | */ |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1003 | public synchronized void setAppCachePath(String appCachePath) { |
| 1004 | throw new MustOverrideException(); |
Andrei Popescu | 60a9a7d | 2009-04-17 10:43:42 +0100 | [diff] [blame] | 1005 | } |
| 1006 | |
| 1007 | /** |
Selim Gurun | b632adf | 2012-06-28 11:21:05 -0700 | [diff] [blame^] | 1008 | * Sets the maximum size for the Application Cache content. The passed size |
| 1009 | * will be rounded to the nearest value that the database can support, so |
| 1010 | * this should be viewed as a guide, not a hard limit. Setting the |
| 1011 | * size to a value less than current database size does not cause the |
| 1012 | * database to be trimmed. The default size is {@link Long.MAX_VALUE}. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1013 | * |
| 1014 | * @param appCacheMaxSize the maximum size in bytes |
Andrei Popescu | 1c82920 | 2009-07-22 16:47:52 +0100 | [diff] [blame] | 1015 | */ |
| 1016 | public synchronized void setAppCacheMaxSize(long appCacheMaxSize) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1017 | throw new MustOverrideException(); |
Andrei Popescu | 1c82920 | 2009-07-22 16:47:52 +0100 | [diff] [blame] | 1018 | } |
| 1019 | |
| 1020 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1021 | * Sets whether the database storage API is enabled. The default value is |
| 1022 | * false. See also {@link #setDatabasePath} for how to correctly set up the |
| 1023 | * database storage API. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1024 | * |
| 1025 | * @param flag true if the WebView should use the database storage API |
Ben Murdoch | 7df1985 | 2009-04-22 13:07:58 +0100 | [diff] [blame] | 1026 | */ |
| 1027 | public synchronized void setDatabaseEnabled(boolean flag) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1028 | throw new MustOverrideException(); |
Ben Murdoch | 7df1985 | 2009-04-22 13:07:58 +0100 | [diff] [blame] | 1029 | } |
| 1030 | |
| 1031 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1032 | * Sets whether the DOM storage API is enabled. The default value is false. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1033 | * |
| 1034 | * @param flag true if the WebView should use the DOM storage API |
Ben Murdoch | 274680d | 2009-05-28 13:44:44 +0100 | [diff] [blame] | 1035 | */ |
| 1036 | public synchronized void setDomStorageEnabled(boolean flag) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1037 | throw new MustOverrideException(); |
Ben Murdoch | 274680d | 2009-05-28 13:44:44 +0100 | [diff] [blame] | 1038 | } |
| 1039 | |
| 1040 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1041 | * Gets whether the DOM Storage APIs are enabled. |
| 1042 | * |
| 1043 | * @return true if the DOM Storage APIs are enabled |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1044 | * @see #setDomStorageEnabled |
Ben Murdoch | 274680d | 2009-05-28 13:44:44 +0100 | [diff] [blame] | 1045 | */ |
| 1046 | public synchronized boolean getDomStorageEnabled() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1047 | throw new MustOverrideException(); |
Ben Murdoch | 274680d | 2009-05-28 13:44:44 +0100 | [diff] [blame] | 1048 | } |
Ben Murdoch | 274680d | 2009-05-28 13:44:44 +0100 | [diff] [blame] | 1049 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1050 | * Gets the path to where database storage API databases are saved. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1051 | * |
| 1052 | * @return the String path to the database storage API databases |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1053 | * @see #setDatabasePath |
Ben Murdoch | 7df1985 | 2009-04-22 13:07:58 +0100 | [diff] [blame] | 1054 | */ |
| 1055 | public synchronized String getDatabasePath() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1056 | throw new MustOverrideException(); |
Ben Murdoch | 7df1985 | 2009-04-22 13:07:58 +0100 | [diff] [blame] | 1057 | } |
| 1058 | |
| 1059 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1060 | * Gets whether the database storage API is enabled. |
| 1061 | * |
| 1062 | * @return true if the database storage API is enabled |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1063 | * @see #setDatabaseEnabled |
Ben Murdoch | 7df1985 | 2009-04-22 13:07:58 +0100 | [diff] [blame] | 1064 | */ |
| 1065 | public synchronized boolean getDatabaseEnabled() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1066 | throw new MustOverrideException(); |
Andrei Popescu | c27a9ac | 2009-08-03 15:59:24 +0100 | [diff] [blame] | 1067 | } |
| 1068 | |
| 1069 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1070 | * Sets whether Geolocation is enabled. The default is true. See also |
| 1071 | * {@link #setGeolocationDatabasePath} for how to correctly set up |
| 1072 | * Geolocation. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1073 | * |
| 1074 | * @param flag whether Geolocation should be enabled |
Steve Block | 06cd751 | 2009-08-21 10:26:37 +0100 | [diff] [blame] | 1075 | */ |
| 1076 | public synchronized void setGeolocationEnabled(boolean flag) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1077 | throw new MustOverrideException(); |
Elliott Slaughter | 5dc0c82 | 2010-06-22 11:31:54 -0700 | [diff] [blame] | 1078 | } |
| 1079 | |
| 1080 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1081 | * Gets whether JavaScript is enabled. |
| 1082 | * |
| 1083 | * @return true if JavaScript is enabled |
| 1084 | * @see #setJavaScriptEnabled |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1085 | */ |
| 1086 | public synchronized boolean getJavaScriptEnabled() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1087 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1088 | } |
| 1089 | |
| 1090 | /** |
Steve Block | ef16315 | 2012-04-23 18:08:06 +0100 | [diff] [blame] | 1091 | * Gets whether JavaScript running in the context of a file scheme URL can |
| 1092 | * access content from any origin. This includes access to content from |
| 1093 | * other file scheme URLs. |
Selim Gurun | 0ea6dad | 2012-03-29 18:19:01 -0700 | [diff] [blame] | 1094 | * |
Steve Block | ef16315 | 2012-04-23 18:08:06 +0100 | [diff] [blame] | 1095 | * @return whether JavaScript running in the context of a file scheme URL |
| 1096 | * can access content from any origin |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1097 | * @see #setAllowUniversalAccessFromFileURLs |
Selim Gurun | 0ea6dad | 2012-03-29 18:19:01 -0700 | [diff] [blame] | 1098 | */ |
| 1099 | public abstract boolean getAllowUniversalAccessFromFileURLs(); |
| 1100 | |
| 1101 | /** |
Steve Block | ef16315 | 2012-04-23 18:08:06 +0100 | [diff] [blame] | 1102 | * Gets whether JavaScript running in the context of a file scheme URL can |
| 1103 | * access content from other file scheme URLs. |
Selim Gurun | 0ea6dad | 2012-03-29 18:19:01 -0700 | [diff] [blame] | 1104 | * |
Steve Block | ef16315 | 2012-04-23 18:08:06 +0100 | [diff] [blame] | 1105 | * @return whether JavaScript running in the context of a file scheme URL |
| 1106 | * can access content from other file scheme URLs |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1107 | * @see #setAllowFileAccessFromFileURLs |
Selim Gurun | 0ea6dad | 2012-03-29 18:19:01 -0700 | [diff] [blame] | 1108 | */ |
| 1109 | public abstract boolean getAllowFileAccessFromFileURLs(); |
| 1110 | |
| 1111 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1112 | * Gets whether plugins are enabled. |
| 1113 | * |
| 1114 | * @return true if plugins are enabled |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1115 | * @see #setPluginsEnabled |
Patrick Scott | 300f2e9 | 2010-03-22 10:20:45 -0400 | [diff] [blame] | 1116 | * @deprecated This method has been replaced by {@link #getPluginState} |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1117 | */ |
Michael Kolb | a172e7d | 2010-06-30 12:35:26 -0700 | [diff] [blame] | 1118 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1119 | public synchronized boolean getPluginsEnabled() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1120 | throw new MustOverrideException(); |
Patrick Scott | 300f2e9 | 2010-03-22 10:20:45 -0400 | [diff] [blame] | 1121 | } |
| 1122 | |
| 1123 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1124 | * Gets the current state regarding whether plugins are enabled. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1125 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1126 | * @return the plugin state as a {@link PluginState} value |
| 1127 | * @see #setPluginState |
Patrick Scott | 300f2e9 | 2010-03-22 10:20:45 -0400 | [diff] [blame] | 1128 | */ |
| 1129 | public synchronized PluginState getPluginState() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1130 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1131 | } |
| 1132 | |
| 1133 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1134 | * Gets the directory that contains the plugin libraries. This method is |
Derek Sollenberger | fdbdeb3 | 2010-08-12 11:20:13 -0400 | [diff] [blame] | 1135 | * obsolete since each plugin is now loaded from its own package. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1136 | * |
| 1137 | * @return an empty string |
Derek Sollenberger | fdbdeb3 | 2010-08-12 11:20:13 -0400 | [diff] [blame] | 1138 | * @deprecated This method is no longer used as plugins are loaded from |
| 1139 | * their own APK via the system's package manager. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1140 | */ |
Jason Chen | 9dc2e75 | 2010-09-01 19:11:14 -0700 | [diff] [blame] | 1141 | @Deprecated |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1142 | public synchronized String getPluginsPath() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1143 | // Unconditionally returns empty string, so no need for derived classes to override. |
Grace Kloba | 658ab7d | 2009-05-14 14:45:26 -0700 | [diff] [blame] | 1144 | return ""; |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1145 | } |
| 1146 | |
| 1147 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1148 | * Tells JavaScript to open windows automatically. This applies to the |
| 1149 | * JavaScript function window.open(). The default is false. |
| 1150 | * |
| 1151 | * @param flag true if JavaScript can open windows automatically |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1152 | */ |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1153 | public synchronized void setJavaScriptCanOpenWindowsAutomatically(boolean flag) { |
| 1154 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1155 | } |
| 1156 | |
| 1157 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1158 | * Gets whether JavaScript can open windows automatically. |
| 1159 | * |
| 1160 | * @return true if JavaScript can open windows automatically during |
| 1161 | * window.open() |
| 1162 | * @see #setJavaScriptCanOpenWindowsAutomatically |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1163 | */ |
| 1164 | public synchronized boolean getJavaScriptCanOpenWindowsAutomatically() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1165 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1166 | } |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1167 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1168 | * Sets the default text encoding name to use when decoding html pages. |
| 1169 | * The default is "Latin-1". |
| 1170 | * |
| 1171 | * @param encoding the text encoding name |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1172 | */ |
| 1173 | public synchronized void setDefaultTextEncodingName(String encoding) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1174 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1175 | } |
| 1176 | |
| 1177 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1178 | * Gets the default text encoding name. |
| 1179 | * |
| 1180 | * @return the default text encoding name as a string |
| 1181 | * @see #setDefaultTextEncodingName |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1182 | */ |
| 1183 | public synchronized String getDefaultTextEncodingName() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1184 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1185 | } |
| 1186 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1187 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1188 | * Sets the WebView's user-agent string. If the string is null or empty, |
| 1189 | * the system default value will be used. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1190 | */ |
| 1191 | public synchronized void setUserAgentString(String ua) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1192 | throw new MustOverrideException(); |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1193 | } |
| 1194 | |
| 1195 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1196 | * Gets the WebView's user-agent string. |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1197 | * |
| 1198 | * @return the WebView's user-agent string |
| 1199 | * @see #setUserAgentString |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1200 | */ |
| 1201 | public synchronized String getUserAgentString() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1202 | throw new MustOverrideException(); |
Shimeng (Simon) Wang | c55886a | 2010-10-28 13:46:02 -0700 | [diff] [blame] | 1203 | } |
| 1204 | |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1205 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1206 | * Tells the WebView whether it needs to set a node to have focus when |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1207 | * {@link WebView#requestFocus(int, android.graphics.Rect)} is called. The |
| 1208 | * default value is true. |
Michael Kolb | a172e7d | 2010-06-30 12:35:26 -0700 | [diff] [blame] | 1209 | * |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1210 | * @param flag whether the WebView needs to set a node |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1211 | */ |
| 1212 | public void setNeedInitialFocus(boolean flag) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1213 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1214 | } |
| 1215 | |
| 1216 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1217 | * Sets the priority of the Render thread. Unlike the other settings, this |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1218 | * one only needs to be called once per process. The default value is |
| 1219 | * {@link RenderPriority#NORMAL}. |
Mike Hearn | adcd2ed | 2009-01-21 16:44:36 +0100 | [diff] [blame] | 1220 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1221 | * @param priority the priority |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1222 | */ |
| 1223 | public synchronized void setRenderPriority(RenderPriority priority) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1224 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1225 | } |
Michael Kolb | a172e7d | 2010-06-30 12:35:26 -0700 | [diff] [blame] | 1226 | |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1227 | /** |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1228 | * Overrides the way the cache is used. The way the cache is used is based |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1229 | * on the navigation type. For a normal page load, the cache is checked |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1230 | * and content is re-validated as needed. When navigating back, content is |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1231 | * not revalidated, instead the content is just retrieved from the cache. |
| 1232 | * This method allows the client to override this behavior by specifying |
| 1233 | * one of {@link #LOAD_DEFAULT}, {@link #LOAD_NORMAL}, |
| 1234 | * {@link #LOAD_CACHE_ELSE_NETWORK}, {@link #LOAD_NO_CACHE} or |
| 1235 | * {@link #LOAD_CACHE_ONLY}. The default value is {@link #LOAD_DEFAULT}. |
Steve Block | 4e584df | 2012-04-24 23:12:47 +0100 | [diff] [blame] | 1236 | * |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1237 | * @param mode the mode to use |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1238 | */ |
| 1239 | public void setCacheMode(int mode) { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1240 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1241 | } |
Michael Kolb | a172e7d | 2010-06-30 12:35:26 -0700 | [diff] [blame] | 1242 | |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1243 | /** |
Steve Block | b0e0f33 | 2012-06-13 22:01:11 +0100 | [diff] [blame] | 1244 | * Gets the current setting for overriding the cache mode. |
| 1245 | * |
| 1246 | * @return the current setting for overriding the cache mode |
| 1247 | * @see #setCacheMode |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1248 | */ |
| 1249 | public int getCacheMode() { |
Jonathan Dixon | 3c90952 | 2012-02-28 18:45:06 +0000 | [diff] [blame] | 1250 | throw new MustOverrideException(); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1251 | } |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1252 | } |