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