2 Copyright (C) 2009-2010 ProFUSION embedded systems
3 Copyright (C) 2009-2010 Samsung Electronics
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #ifndef ewk_settings_h
22 #define ewk_settings_h
33 * @file ewk_settings.h
35 * @brief General purpose settings, not tied to any view object.
38 /* #if ENABLE(TIZEN_ORIGIN_DEL_FOR_APPCACHE) */
46 /* #if ENABLE(TIZEN_ORIGIN_DEL_FOR_APPCACHE) */
47 typedef struct _Ewk_Origin Ewk_Origin;
51 * Returns the default quota for Web Database databases. By default
54 * @return the current default database quota in bytes
56 EAPI uint64_t ewk_settings_web_database_default_quota_get(void);
59 * Sets the current path to the directory WebKit will write Web
62 * By default, the value is @c ~/.webkit
64 * @param path the new database directory path
66 EAPI void ewk_settings_web_database_path_set(const char *path);
69 * Returns directory path where web database is stored.
71 * By default, the value is @c ~/.webkit
73 * This is guaranteed to be eina_stringshare, so whenever possible
74 * save yourself some cpu cycles and use eina_stringshare_ref()
75 * instead of eina_stringshare_add() or strdup().
77 * @return database path or @c 0 if none or web database is not supported
79 EAPI const char *ewk_settings_web_database_path_get(void);
82 * Sets directory where to store icon database, opening or closing database.
84 * Icon database must be opened only once. If you try to set a path when the icon
85 * database is already open, this function returns @c EINA_FALSE.
87 * @param directory where to store icon database, must be
88 * write-able, if @c 0 is given, then database is closed
90 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
92 EAPI Eina_Bool ewk_settings_icon_database_path_set(const char *path);
95 * Returns directory path where icon database is stored.
97 * This is guaranteed to be eina_stringshare, so whenever possible
98 * save yourself some cpu cycles and use eina_stringshare_ref()
99 * instead of eina_stringshare_add() or strdup().
101 * @return database path or @c 0 if none is set or database is closed
103 EAPI const char *ewk_settings_icon_database_path_get(void);
106 * Removes all known icons from database.
108 * Database must be opened with ewk_settings_icon_database_path_set()
111 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise, like
114 EAPI Eina_Bool ewk_settings_icon_database_clear(void);
117 * Queries icon for given URL, returning associated cairo surface.
119 * @note In order to have this working, one must open icon database
120 * with ewk_settings_icon_database_path_set().
122 * @param url which url to query icon
124 * @return cairo surface if any, or @c 0 on failure
126 EAPI cairo_surface_t *ewk_settings_icon_database_icon_surface_get(const char *url);
129 * Creates Evas_Object of type image representing the given URL.
131 * This is an utility function that creates an Evas_Object of type
132 * image set to have fill always match object size
133 * (evas_object_image_filled_add()), saving some code to use it from Evas.
135 * @note In order to have this working, one must open icon database
136 * with ewk_settings_icon_database_path_set().
138 * @param url which url to query icon
139 * @param canvas evas instance where to add resulting object
141 * @return newly allocated Evas_Object instance or @c 0 on
142 * errors. Delete the object with evas_object_del().
144 EAPI Evas_Object *ewk_settings_icon_database_icon_object_add(const char *url, Evas *canvas);
148 * This API is moved to ewk_network.h
149 * Please use ewk_network_proxy_uri_set(const char* proxy)
151 EAPI void ewk_settings_proxy_uri_set(const char* proxy);
152 EAPI const char* ewk_settings_proxy_uri_get();
155 * Sets the path where the application cache will be stored.
157 * The Offline Application Caching APIs are part of HTML5 and allow applications to store data locally that is accessed
158 * when the network cannot be reached.
160 * By default, the path is @c ~/.webkit.
162 * @param path where to store cache, must be write-able.
164 * @sa ewk_view_setting_application_cache_set
166 EAPI void ewk_settings_application_cache_path_set(const char *path);
169 * Returns the path where the HTML5 application cache is stored.
171 * The Offline Application Caching APIs are part of HTML5 and allow applications to store data locally that is accessed
172 * when the network cannot be reached.
174 * By default, the path is @c ~/.webkit.
176 * @return eina_stringshare'd path value.
178 * @sa ewk_view_setting_application_cache_set
180 EAPI const char *ewk_settings_application_cache_path_get(void);
182 /* #if ENABLE(TIZEN_ORIGIN_DEL_FOR_APPCACHE) */
184 * Returns list of origins that is stored in cache db.
186 * @return list of origins.
188 EAPI Eina_List *ewk_settings_appcache_origins_get(void);
191 /* #if ENABLE(TIZEN_ORIGIN_DEL_FOR_APPCACHE) */
193 * Deletes origin that is stored in appcache db.
195 * @param origin db origin.
198 EAPI void ewk_settings_appcache_origin_delete(Ewk_Origin *origin);
201 /* #if ENABLE(TIZEN_ORIGIN_DEL_FOR_APPCACHE) */
203 * Returns db size of an origin that is stored in appcache db.
205 * @param origin db origin.
207 * @return size of db in bytes.
210 EAPI long long ewk_settings_appcache_size_get(Ewk_Origin *origin);
213 /* #if ENABLE(DOM_STORAGE) && ENABLE(TIZEN_ORIGIN_DEL_FOR_WEBSTORAGE) */
215 * Sets web storage db path.
217 * @param path absolute path where to store web storage db, must be write-able.
219 * @return @c EINA_TRUE on success, @c EINA_FALSE if path is NULL or
220 * web storage is not supported.
222 EAPI Eina_Bool ewk_settings_web_storage_path_set(const char *path);
225 /* #if ENABLE(DOM_STORAGE) && ENABLE(TIZEN_ORIGIN_DEL_FOR_WEBSTORAGE) */
227 * Returns web storage db path.
229 * @return web storage db path.
231 EAPI const char *ewk_settings_web_storage_path_get(void);
234 /* #if ENABLE(DOM_STORAGE) && ENABLE(TIZEN_ORIGIN_DEL_FOR_WEBSTORAGE) */
236 * Returns list of origin that is stored to web storage db.
238 * @return list of origin.
240 EAPI Eina_List *ewk_settings_web_storage_origins_get(void);
243 /* #if ENABLE(DOM_STORAGE) && ENABLE(TIZEN_ORIGIN_DEL_FOR_WEBSTORAGE) */
245 * Deletes origin that is stored to web storage db.
247 * @param origin origin of db.
250 EAPI void ewk_settings_web_storage_origin_delete(Ewk_Origin *origin);
253 /* #if ENABLE(DOM_STORAGE) && ENABLE(TIZEN_ORIGIN_DEL_FOR_WEBSTORAGE) */
255 * Returns size of db that is stored to web storage db.
257 * @param origin origin of db.
259 * @return size of db in bytes.
262 EAPI long long ewk_settings_web_storage_size_get(Ewk_Origin *origin);
265 /* #if ENABLE(TIZEN_ORIGIN_DEL_FOR_APPCACHE) || ENABLE(TIZEN_ORIGIN_DEL_FOR_WEBSTORAGE) */
267 * Frees origins allocated by get method of ewk_settings.
269 * @param origins list of origin that is stored to db.
272 EAPI void ewk_settings_origins_free(Eina_List *origins);
275 EAPI void ewk_settings_proxy_uri_set(const char* proxy);
276 EAPI const char* ewk_settings_proxy_uri_get(void);
280 * This API is moved to ewk_network.h
281 * Please use ewk_network_http_request_append(const char* proxy)
283 EAPI void ewk_settings_http_request_append(const char* name, const char* value);
286 * Returns the maximum size, in bytes, of the application cache for HTML5 Offline Web Applications.
288 * By default, applications are allowed unlimited storage space.
290 * @sa ewk_view_setting_offine_app_cache_set
292 EAPI int64_t ewk_settings_application_cache_max_quota_get(void);
295 * Sets the maximum size, in bytes, of the application cache for HTML5 Offline Web Applications.
297 * By default, applications are allowed unlimited storage space.
299 * Note that calling this function will delete all the entries currently in the app cache.
301 * @param maximum_size the new maximum size, in bytes.
303 * @sa ewk_view_setting_application_cache_enabled_set
305 EAPI void ewk_settings_application_cache_max_quota_set(int64_t maximum_size);
308 * Removes all entries from the HTML5 application cache.
310 * @sa ewk_view_setting_application_cache_enabled_set, ewk_settings_application_cache_path_set
312 EAPI void ewk_settings_application_cache_clear(void);
315 * Gets status of the memory cache of WebCore.
317 * @return @c EINA_TRUE if the cache is enabled or @c EINA_FALSE if not
319 EAPI Eina_Bool ewk_settings_cache_enable_get(void);
322 * Enables/disables the memory cache of WebCore, possibly clearing it.
324 * Disabling the cache will remove all resources from the cache.
325 * They may still live on if they are referenced by some Web page though.
327 * @param set @c EINA_TRUE to enable memory cache, @c EINA_FALSE to disable
329 EAPI void ewk_settings_cache_enable_set(Eina_Bool set);
332 * Sets capacity of memory cache of WebCore.
334 * WebCore sets default value of memory cache on 8192 * 1024 bytes.
336 * @param capacity the maximum number of bytes that the cache should consume overall
338 EAPI void ewk_settings_cache_capacity_set(unsigned capacity);
341 * Clears all memory caches.
343 * This function clears all memory caches, which include the object cache (for resources such as
344 * images, scripts and stylesheets), the page cache, the font cache and the Cross-Origin Preflight
347 EAPI void ewk_settings_memory_cache_clear(void);
350 * Sets values for repaint throttling.
352 * It allows to slow down page loading and
353 * should ensure displaying a content with many css/gif animations.
355 * These values can be used as a example for repaints throttling.
356 * 0, 0, 0, 0 - default WebCore's values, these do not delay any repaints
357 * 0.025, 0, 2.5, 0.5 - recommended values for dynamic content
358 * 0.01, 0, 1, 0.2 - minimal level
359 * 0.025, 1, 5, 0.5 - medium level
360 * 0.1, 2, 10, 1 - heavy level
362 * @param deferred_repaint_delay a normal delay
363 * @param initial_deferred_repaint_delay_during_loading negative value would mean that first few repaints happen without a delay
364 * @param max_deferred_repaint_delay_during_loading the delay grows on each repaint to this maximum value
365 * @param deferred_repaint_delay_increment_during_loading on each repaint the delay increses by this amount
367 EAPI void ewk_settings_repaint_throttling_set(double deferred_repaint_delay, double initial_deferred_repaint_delay_during_loading, double max_deferred_repaint_delay_during_loading, double deferred_repaint_delay_increment_during_loading);
370 * Gets the default interval for DOMTimers on all pages.
372 * DOMTimer processes javascript function registered by setInterval() based on interval value.
374 * @return default minimum interval for DOMTimers
376 EAPI double ewk_settings_default_timer_interval_get(void);
381 #endif // ewk_settings_h