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.
39 * Returns the default quota for Web Database databases. By default
42 * @return the current default database quota in bytes
44 EAPI uint64_t ewk_settings_web_database_default_quota_get(void);
47 * Sets the current path to the directory WebKit will write Web
50 * @param path the new database directory path
52 EAPI void ewk_settings_web_database_path_set(const char *path);
55 * Returns directory path where web database is stored.
57 * This is guaranteed to be eina_stringshare, so whenever possible
58 * save yourself some cpu cycles and use eina_stringshare_ref()
59 * instead of eina_stringshare_add() or strdup().
61 * @return database path or @c 0 if none or web database is not supported
63 EAPI const char *ewk_settings_web_database_path_get(void);
66 * Sets directory where to store icon database, opening or closing database.
68 * Icon database must be opened only once. If you try to set a path when the icon
69 * database is already open, this function returns @c EINA_FALSE.
71 * @param directory where to store icon database, must be
72 * write-able, if @c 0 is given, then database is closed
74 * @return @c EINA_TRUE on success, @c EINA_FALSE on errors
76 EAPI Eina_Bool ewk_settings_icon_database_path_set(const char *path);
79 * Returns directory path where icon database is stored.
81 * This is guaranteed to be eina_stringshare, so whenever possible
82 * save yourself some cpu cycles and use eina_stringshare_ref()
83 * instead of eina_stringshare_add() or strdup().
85 * @return database path or @c 0 if none is set or database is closed
87 EAPI const char *ewk_settings_icon_database_path_get(void);
90 * Removes all known icons from database.
92 * Database must be opened with ewk_settings_icon_database_path_set()
95 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise, like
98 EAPI Eina_Bool ewk_settings_icon_database_clear(void);
101 * Queries icon for given URL, returning associated cairo surface.
103 * @note In order to have this working, one must open icon database
104 * with ewk_settings_icon_database_path_set().
106 * @param url which url to query icon
108 * @return cairo surface if any, or @c 0 on failure
110 EAPI cairo_surface_t *ewk_settings_icon_database_icon_surface_get(const char *url);
113 * Creates Evas_Object of type image representing the given URL.
115 * This is an utility function that creates an Evas_Object of type
116 * image set to have fill always match object size
117 * (evas_object_image_filled_add()), saving some code to use it from Evas.
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
123 * @param canvas evas instance where to add resulting object
125 * @return newly allocated Evas_Object instance or @c 0 on
126 * errors. Delete the object with evas_object_del().
128 EAPI Evas_Object *ewk_settings_icon_database_icon_object_add(const char *url, Evas *canvas);
131 * Sets cache directory.
133 * @param path where to store cache, must be write-able.
135 * @return @c EINA_TRUE on success, @c EINA_FALSE if path is NULL or offline
136 * web application is not supported.
138 EAPI Eina_Bool ewk_settings_cache_directory_path_set(const char *path);
141 * Return cache directory path.
143 * This is guaranteed to be eina_stringshare, so whenever possible
144 * save yourself some cpu cycles and use eina_stringshare_ref()
145 * instead of eina_stringshare_add() or strdup().
147 * @return cache directory path.
149 EAPI const char *ewk_settings_cache_directory_path_get(void);
152 * Gets status of the memory cache of WebCore.
154 * @return @c EINA_TRUE if the cache is enabled or @c EINA_FALSE if not
156 EAPI Eina_Bool ewk_settings_cache_enable_get(void);
159 * Enables/disables the memory cache of WebCore, possibly clearing it.
161 * Disabling the cache will remove all resources from the cache.
162 * They may still live on if they are referenced by some Web page though.
164 * @param set @c EINA_TRUE to enable memory cache, @c EINA_FALSE to disable
166 EAPI void ewk_settings_cache_enable_set(Eina_Bool set);
169 * Sets capacity of memory cache of WebCore.
171 * WebCore sets default value of memory cache on 8192 * 1024 bytes.
173 * @param capacity the maximum number of bytes that the cache should consume overall
175 EAPI void ewk_settings_cache_capacity_set(unsigned capacity);
178 * Sets values for repaint throttling.
180 * It allows to slow down page loading and
181 * should ensure displaying a content with many css/gif animations.
183 * These values can be used as a example for repaints throttling.
184 * 0, 0, 0, 0 - default WebCore's values, these do not delay any repaints
185 * 0.025, 0, 2.5, 0.5 - recommended values for dynamic content
186 * 0.01, 0, 1, 0.2 - minimal level
187 * 0.025, 1, 5, 0.5 - medium level
188 * 0.1, 2, 10, 1 - heavy level
190 * @param deferred_repaint_delay a normal delay
191 * @param initial_deferred_repaint_delay_during_loading negative value would mean that first few repaints happen without a delay
192 * @param max_deferred_repaint_delay_during_loading the delay grows on each repaint to this maximum value
193 * @param deferred_repaint_delay_increment_during_loading on each repaint the delay increses by this amount
195 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);
198 * Gets the default interval for DOMTimers on all pages.
200 * DOMTimer processes javascript function registered by setInterval() based on interval value.
202 * @return default minimum interval for DOMTimers
204 EAPI double ewk_settings_default_timer_interval_get(void);
209 #endif // ewk_settings_h