2 * Copyright (C) 2012 Samsung Electronics
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
22 * @brief Describes the context API.
24 * @note ewk_context encapsulates all pages related to specific use of WebKit.
26 * Applications have the option of creating a context different than the default one
27 * and use it for a group of pages. All pages in the same context share the same
28 * preferences, visited link set, local storage, etc.
30 * A process model can be specified per context. The default one is the shared model
31 * where the web-engine process is shared among the pages in the context. The second
32 * model allows each page to use a separate web-engine process. This latter model is
33 * currently not supported by WebKit2/EFL.
40 #include "ewk_cookie_manager.h"
41 #include "ewk_favicon_database.h"
42 #include "ewk_navigation_data.h"
43 #include "ewk_url_scheme_request.h"
46 #include "ewk_security_origin.h"
53 /// Defines extensible api
54 enum Ewk_Extensible_API {
55 EWK_EXTENSIBLE_API_BACKGROUND_MUSIC,
56 EWK_EXTENSIBLE_API_CSP,
57 EWK_EXTENSIBLE_API_ENCRYPTION_DATABASE,
58 EWK_EXTENSIBLE_API_FULL_SCREEN,
59 EWK_EXTENSIBLE_API_MEDIA_STREAM_RECORD,
60 EWK_EXTENSIBLE_API_MEDIA_VOLUME_CONTROL,
61 EWK_EXTENSIBLE_API_PRERENDERING_FOR_ROTATION,
62 EWK_EXTENSIBLE_API_ROTATE_CAMERA_VIEW
64 /// Creates a type name for @a _Ewk_Extensible_API.
65 typedef enum Ewk_Extensible_API Ewk_Extensible_API;
67 /** Creates a type name for @a Ewk_Context. */
68 typedef struct Ewk_Context Ewk_Context;
69 typedef struct Ewk_Context_Exceeded_Quota Ewk_Context_Exceeded_Quota;
72 * Deletes Ewk_Context.
74 * @param context Ewk_Context to delete
76 EAPI void ewk_context_delete(Ewk_Context* context);
79 * Notify low memory to free unused memory.
81 * @param o context object to notify low memory.
83 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
85 EAPI Eina_Bool ewk_context_notify_low_memory(Ewk_Context* ewkContext);
88 * Sets the given proxy URI to network backend of specific context.
90 * @param ewkContext context object to set proxy URI.
91 * @param proxy URI to set
93 EAPI void ewk_context_proxy_uri_set(Ewk_Context* ewkContext, const char* proxy);
96 * Gets the proxy URI from the network backend of specific context.
98 * It returns an internal string and should not
99 * be modified. The string is guaranteed to be stringshared.
101 * @param ewkContext context object to get proxy URI.
103 * @return current proxy URI or @c 0 if it's not set
105 EAPI const char* ewk_context_proxy_uri_get(Ewk_Context* ewkContext);
108 * Cancels network session requests.
110 * @param context context object to cancel network session requests
112 EAPI void ewk_context_network_session_requests_cancel(Ewk_Context* context);
115 * @typedef Ewk_Local_File_System_Origins_Get_Callback Ewk_Local_File_System_Origins_Get_Callback
116 * @brief Type definition for use with ewk_context_local_file_system_origins_get()
118 typedef void (*Ewk_Local_File_System_Origins_Get_Callback)(Eina_List *origins, void *user_data);
121 * Callback for ewk_context_application_cache_origins_get
123 * @param origins web application cache origins
124 * @param user_data user_data will be passsed when ewk_context_application_cache_origins_get is called
126 typedef void (*Ewk_Web_Application_Cache_Origins_Get_Callback)(Eina_List* origins, void* user_data);
129 * Callback for ewk_context_application_cache_quota_get.
131 * @param quota web application cache quota
132 * @param user_data user_data will be passsed when ewk_context_application_cache_quota_get is called
134 typedef void (*Ewk_Web_Application_Cache_Quota_Get_Callback)(int64_t quota, void* user_data);
137 * Callback for ewk_context_application_cache_usage_for_origin_get.
139 * @param usage web application cache usage for origin
140 * @param user_data user_data will be passsed when ewk_context_application_cache_usage_for_origin_get is called
142 typedef void (*Ewk_Web_Application_Cache_Usage_For_Origin_Get_Callback)(int64_t usage, void* user_data);
145 * Callback for ewk_context_application_cache_path_get.
147 * @param path web application cache directory
148 * @param user_data user_data will be passsed when ewk_context_application_cache_path_get is called
150 typedef void (*Ewk_Web_Application_Cache_Path_Get_Callback)(const char* path, void* user_data);
153 * Callback for ewk_context_web_database_origins_get.
155 * @param origins web database origins
156 * @param user_data user_data will be passsed when ewk_context_web_database_origins_get is called
158 typedef void (*Ewk_Web_Database_Origins_Get_Callback)(Eina_List* origins, void* user_data);
161 * Callback for ewk_context_web_database_quota_for_origin_get.
163 * @param quota web database quota
164 * @param user_data user_data will be passsed when ewk_context_web_database_quota_for_origin_get is called
166 typedef void (*Ewk_Web_Database_Quota_Get_Callback)(uint64_t quota, void* user_data);
169 * Callback for ewk_context_web_database_usage_for_origin_get.
171 * @param usage web database usage
172 * @param user_data user_data will be passsed when ewk_context_web_database_usage_for_origin_get is called
174 typedef void (*Ewk_Web_Database_Usage_Get_Callback)(uint64_t usage, void* user_data);
177 * Callback for ewk_context_web_database_path_get.
179 * @param path web database directory
180 * @param user_data user_data will be passsed when ewk_context_web_database_path_get is called
182 typedef void (*Ewk_Web_Database_Path_Get_Callback)(const char* path, void* user_data);
185 * Callback for ewk_context_web_storage_origins_get.
187 * @param origins web storage origins
188 * @param user_data user_data will be passsed when ewk_context_web_storage_origins_get is called
190 typedef void (*Ewk_Web_Storage_Origins_Get_Callback)(Eina_List* origins, void* user_data);
193 * Callback for ewk_context_web_storage_usage_for_origin_get.
195 * @param usage usage of web storage
196 * @param user_data user_data will be passsed when ewk_context_web_storage_usage_for_origin_get is called
198 typedef void (*Ewk_Web_Storage_Usage_Get_Callback)(uint64_t usage, void* user_data);
201 * Callback for ewk_context_web_storage_path_get.
203 * @param path web storage directory
204 * @param user_data user_data will be passsed when ewk_context_web_storage_path_get is called
206 typedef void (*Ewk_Web_Storage_Path_Get_Callback)(const char* path, void* user_data);
209 * Callback for didReceiveMessageFromInjectedBundle and didReceiveSynchronousMessageFromInjectedBundle
211 * User should allocate new string for return_data before setting it.
212 * The return_data string will be freed in the WebKit side.
214 * @param name name of message from injected bundle
215 * @param body body of message from injected bundle
216 * @param return_data return_data string from application
217 * @param user_data user_data will be passsed when receiving message from injected bundle
219 typedef void (*Ewk_Context_Message_From_Injected_Bundle_Callback)(const char* name, const char* body, char** return_data, void* user_data);
222 * Callback for didStartDownload
224 * @param download_url url to download
225 * @param user_data user_data will be passsed when download is started
227 typedef void (*Ewk_Context_Did_Start_Download_Callback)(const char* download_url, void* user_data);
230 * Requests for freeing origins.
232 * @param origins list of origins
234 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
236 EAPI Eina_Bool ewk_context_origins_free(Eina_List* origins);
239 * Requests for deleting all web application caches.
241 * @param context context object
243 * @return @c EINA_TRUE on successful request or @c EINA FALSE on failure
245 EAPI Eina_Bool ewk_context_application_cache_delete_all(Ewk_Context* context);
248 * Requests for deleting web application cache for origin.
250 * @param context context object
251 * @param origin application cache origin
253 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
255 EAPI Eina_Bool ewk_context_application_cache_delete(Ewk_Context* context, Ewk_Security_Origin* origin);
258 * Requests for getting web application cache origins.
260 * @param context context object
261 * @param result_callback callback to get web application cache origins
262 * @param user_data user_data will be passsed when result_callback is called
264 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
266 * @see ewk_context_origins_free
268 EAPI Eina_Bool ewk_context_application_cache_origins_get(Ewk_Context* context, Ewk_Web_Application_Cache_Origins_Get_Callback callback, void* user_data);
271 * Requests for setting application cache path.
273 * @param context context object
274 * @param path application cache path to set
276 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
278 EAPI Eina_Bool ewk_context_application_cache_path_set(Ewk_Context* context, const char* path);
281 * Requests for getting application cache path.
283 * @param context context object
284 * @param callback callback to get web application cache directory
285 * @param userData will be passed when result_callback is called
286 * -I.e., user data will be kept until callback is called
288 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
290 EAPI Eina_Bool ewk_context_application_cache_path_get(Ewk_Context* ewkContext, Ewk_Web_Application_Cache_Path_Get_Callback callback, void* userData);
293 * Requests for getting application cache quota.
295 * @param context context object
296 * @param result_callback callback to get web database quota
297 * @param user_data user_data will be passed when result_callback is called
298 * -I.e., user data will be kept until callback is called
300 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
302 EAPI Eina_Bool ewk_context_application_cache_quota_get(Ewk_Context* context, Ewk_Web_Application_Cache_Quota_Get_Callback callback, void* user_data);
305 * Requests for setting application cache quota.
307 * @param context context object
308 * @param quota size of quota
310 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
312 EAPI Eina_Bool ewk_context_application_cache_quota_set(Ewk_Context* context, int64_t quota);
315 * Requests for setting application cache quota for origin.
317 * @param context context object
318 * @param origin serucity origin
319 * @param quota size of quota
321 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
323 EAPI Eina_Bool ewk_context_application_cache_quota_for_origin_set(Ewk_Context* context, const Ewk_Security_Origin* origin, int64_t quota);
326 * Requests for getting application cache usage for origin.
328 * @param context context object
329 * @param origin security origin
330 * @param result_callback callback to get web database usage
331 * @param user_data user_data will be passed when result_callback is called
332 * -I.e., user data will be kept until callback is called
334 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
336 Eina_Bool ewk_context_application_cache_usage_for_origin_get(Ewk_Context* context, const Ewk_Security_Origin* origin, Ewk_Web_Application_Cache_Usage_For_Origin_Get_Callback callback, void* userData);
339 * Requests setting of the favicon database path.
341 * @param context context object
342 * @param path database path.
344 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
346 EAPI Eina_Bool ewk_context_icon_database_path_set(Ewk_Context* context, const char* path);
349 * Requests to get image representing the given URL.
351 * @param context context object
352 * @param url which url to query icon, must not be @c 0
353 * @param canvas evas instance where to add resulting object, must not be @c 0
355 * @return newly allocated Evas_Object instance or @c 0 on
356 * errors. Delete the object with evas_object_del().
358 EAPI Evas_Object* ewk_context_icon_database_icon_object_add(Ewk_Context* context, const char* uri, Evas* canvas);
361 * Deletes all known icons from database.
363 * @param context context object
365 EAPI void ewk_context_icon_database_delete_all(Ewk_Context* context);
368 * Requests for setting local file system path.
370 * @param context context object
371 * @param path local file system path
373 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
375 EAPI Eina_Bool ewk_context_local_file_system_path_set(Ewk_Context* context, const char* path);
378 * Requests for deleting all local file systems.
380 * @param context context object
382 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
384 EAPI Eina_Bool ewk_context_local_file_system_all_delete(Ewk_Context *context);
387 * Requests for deleting local file system for origin.
389 * @param context context object
390 * @param origin local file system origin
392 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
394 EAPI Eina_Bool ewk_context_local_file_system_delete(Ewk_Context *context, Ewk_Security_Origin *origin);
397 * Requests for getting local file system origins.
399 * @param context context object
400 * @param result_callback callback to get local file system origins
401 * @param user_data user_data will be passed when result_callback is called
402 * -I.e., user data will be kept until callback is called
404 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
406 * @see ewk_context_origins_free
408 EAPI Eina_Bool ewk_context_local_file_system_origins_get(const Ewk_Context *context, Ewk_Local_File_System_Origins_Get_Callback callback, void *user_data);
411 * Requests for getting security origin of exceeded database quota data
413 * @param exceeded_qouta data of exceeded database quota
415 * @return security origin of exceeded database quota
417 EAPI Ewk_Security_Origin* ewk_context_web_database_exceeded_quota_security_origin_get(Ewk_Context_Exceeded_Quota* exceeded_quota);
420 * Requests for getting database name of exceeded database quota data
422 * @param exceeded_qouta data of exceeded database quota
424 * @return database name of exceeded database quota
426 EAPI const char* ewk_context_web_database_exceeded_quota_database_name_get(Ewk_Context_Exceeded_Quota* exceeded_quota);
429 * Requests for getting display name of exceeded database quota data
431 * @param exceeded_qouta data of exceeded database quota
433 * @return display name of exceeded database quota
435 EAPI const char* ewk_context_web_database_exceeded_quota_display_name_get(Ewk_Context_Exceeded_Quota* exceeded_quota);
438 * Requests for getting current quota of exceeded database quota data
440 * @param exceeded_qouta data of exceeded database quota
442 * @return current quota of exceeded database quota
444 EAPI unsigned long long ewk_context_web_database_exceeded_quota_current_quota_get(Ewk_Context_Exceeded_Quota* exceeded_quota);
447 * Requests for getting current origin usage of exceeded database quota data
449 * @param exceeded_qouta data of exceeded database quota
451 * @return current origin usage of exceeded database quota
453 EAPI unsigned long long ewk_context_web_database_exceeded_quota_current_origin_usage_get(Ewk_Context_Exceeded_Quota* exceeded_quota);
456 * Requests for getting current database usage of exceeded database quota data
458 * @param exceeded_qouta data of exceeded database quota
460 * @return current database usage of exceeded database quota
462 EAPI unsigned long long ewk_context_web_database_exceeded_quota_current_database_usage_get(Ewk_Context_Exceeded_Quota* exceeded_quota);
465 * Requests for getting expected usage of exceeded database quota data
467 * @param exceeded_qouta data of exceeded database quota
469 * @return expected usage of exceeded database quota
471 EAPI unsigned long long ewk_context_web_database_exceeded_quota_expected_usage_get(Ewk_Context_Exceeded_Quota* exceeded_quota);
474 * Requests for setting new quota of exceeded database quota data
476 * @param exceeded_qouta data of exceeded database quota
477 * @param quota new size of database quota
479 EAPI void ewk_context_web_database_exceeded_quota_new_quota_set(Ewk_Context_Exceeded_Quota* exceeded_quota, unsigned long long quota);
482 * Requests for deleting all web databases.
484 * @param context context object
486 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
488 EAPI Eina_Bool ewk_context_web_database_delete_all(Ewk_Context* context);
491 * Requests for deleting web databases for origin.
493 * @param context context object
494 * @param origin database origin
496 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
498 EAPI Eina_Bool ewk_context_web_database_delete(Ewk_Context* context, Ewk_Security_Origin* origin);
501 * Requests for getting web database origins.
503 * @param context context object
504 * @param result_callback callback to get web database origins
505 * @param user_data user_data will be passed when result_callback is called
506 * -I.e., user data will be kept until callback is called
508 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
510 * @see ewk_context_origins_free
512 EAPI Eina_Bool ewk_context_web_database_origins_get(Ewk_Context* context, Ewk_Web_Database_Origins_Get_Callback callback, void* user_data);
515 * Requests for setting web database path.
517 * @param context context object
518 * @param path web database path to set
520 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
522 EAPI Eina_Bool ewk_context_web_database_path_set(Ewk_Context* context, const char* path);
525 * Requests for getting web database path.
527 * @param context context object
528 * @param callback callback to get web database directory
529 * @param userData will be passed when result_callback is called
530 * -I.e., user data will be kept until callback is called
532 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
534 EAPI Eina_Bool ewk_context_web_database_path_get(Ewk_Context* context, Ewk_Web_Database_Path_Get_Callback callback, void* user_data);
537 * Requests for getting web database quota for origin.
539 * @param context context object
540 * @param result_callback callback to get web database quota
541 * @param user_data user_data will be passed when result_callback is called
542 * -I.e., user data will be kept until callback is called
543 * @param origin database origin
545 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
547 EAPI Eina_Bool ewk_context_web_database_quota_for_origin_get(Ewk_Context* context, Ewk_Web_Database_Quota_Get_Callback callback, void* user_data, Ewk_Security_Origin* origin);
550 * Requests for setting web database default quota.
552 * @param context context object
553 * @param quota size of quota
555 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
557 EAPI Eina_Bool ewk_context_web_database_default_quota_set(Ewk_Context* context, uint64_t quota);
560 * Requests for setting web database quota for origin.
562 * @param context context object
563 * @param origin database origin
564 * @param quota size of quota
566 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
568 EAPI Eina_Bool ewk_context_web_database_quota_for_origin_set(Ewk_Context* context, Ewk_Security_Origin* origin, uint64_t quota);
571 * Requests for getting web database usage for origin.
573 * @param context context object
574 * @param result_callback callback to get web database usage
575 * @param user_data user_data will be passed when result_callback is called
576 * -I.e., user data will be kept until callback is called
577 * @param origin database origin
579 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
581 EAPI Eina_Bool ewk_context_web_database_usage_for_origin_get(Ewk_Context* context, Ewk_Web_Database_Usage_Get_Callback callback, void* user_data, Ewk_Security_Origin* origin);
584 * Requests for deleting all web indexed databases.
586 * @param context context object
588 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
590 EAPI Eina_Bool ewk_context_web_indexed_database_delete_all(Ewk_Context* context);
593 * Deletes all web storage.
595 * @param context context object
597 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
599 EAPI Eina_Bool ewk_context_web_storage_delete_all(Ewk_Context* context);
602 * Deletes origin that is stored in web storage db.
604 * @param context context object
605 * @param origin origin of db
607 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
609 EAPI Eina_Bool ewk_context_web_storage_origin_delete(Ewk_Context* context, Ewk_Security_Origin* origin);
612 * Gets list of origins that is stored in web storage db.
614 * This function allocates memory for context structure made from callback and user_data.
616 * @param context context object
617 * @param result_callback callback to get web storage origins
618 * @param user_data user_data will be passed when result_callback is called
619 * -I.e., user data will be kept until callback is called
621 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
623 * @See ewk_context_origins_free()
625 EAPI Eina_Bool ewk_context_web_storage_origins_get(Ewk_Context* context, Ewk_Web_Storage_Origins_Get_Callback callback, void* user_data);
628 * Requests for setting web storage path.
630 * @param context context object
631 * @param path web storage path to set
633 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
635 EAPI Eina_Bool ewk_context_web_storage_path_set(Ewk_Context* context, const char* path);
638 * Requests for getting web storage path.
640 * @param context context object
641 * @param callback callback to get web storage directory
642 * @param userData will be passed when result_callback is called
643 * -I.e., user data will be kept until callback is called
645 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
647 EAPI Eina_Bool ewk_context_web_storage_path_get(Ewk_Context* context, Ewk_Web_Storage_Path_Get_Callback callback, void* user_data);
650 * Gets usage of web storage for certain origin.
652 * This function allocates memory for context structure made from callback and user_data.
654 * @param context context object
655 * @param origin security origin
656 * @param callback callback to get web storage usage
657 * @param user_data user_data will be passed when result_callback is called
658 * -I.e., user data will be kept until callback is called
660 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
662 EAPI Eina_Bool ewk_context_web_storage_usage_for_origin_get(Ewk_Context* context, Ewk_Security_Origin* origin, Ewk_Web_Storage_Usage_Get_Callback callback, void* user_data);
664 //#if ENABLE(TIZEN_SOUP_COOKIE_CACHE_FOR_WEBKIT2)
666 * Requests for setting soup data path(soup data include cookie and cache).
668 * @param context context object
669 * @param path soup data path to set
671 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
673 EAPI Eina_Bool ewk_context_soup_data_directory_set(Ewk_Context* context, const char* path);
677 * \enum Ewk_Cache_Model
679 * @brief Contains option for cache model
681 enum Ewk_Cache_Model {
682 /// Use the smallest cache capacity.
683 EWK_CACHE_MODEL_DOCUMENT_VIEWER,
684 /// Use bigger cache capacity than EWK_CACHE_MODEL_DOCUMENT_VIEWER.
685 EWK_CACHE_MODEL_DOCUMENT_BROWSER,
686 /// Use the biggest cache capacity.
687 EWK_CACHE_MODEL_PRIMARY_WEBBROWSER
690 /// Creates a type name for the Ewk_Cache_Model.
691 typedef enum Ewk_Cache_Model Ewk_Cache_Model;
694 * Requests to set the cache model
696 * @param context context object
697 * @param model cache model
699 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
701 EAPI Eina_Bool ewk_context_cache_model_set(Ewk_Context* context, Ewk_Cache_Model model);
704 * Returns the cache model type
706 * @param context context object
708 * @return Ewk_Cache_Model
710 EAPI Ewk_Cache_Model ewk_context_cache_model_get(Ewk_Context* context);
713 * Toggles the cache enable and disable
715 * @param context context object
716 * @param enable or disable cache
718 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
720 EAPI Eina_Bool ewk_context_cache_disabled_set(Ewk_Context* ewkContext, Eina_Bool cacheDisabled);
723 * Queries if the cache is enabled
725 * @param context context object
727 * @return @c EINA_TRUE is cache is enabled or @c EINA_FALSE otherwise
729 EAPI Eina_Bool ewk_context_cache_disabled_get(const Ewk_Context* ewkContext);
732 * Request to set certifcate file
734 * @param context context object
735 * @param certificate_file is path where certificate file is stored
737 * @return @c EINA_TRUE is cache is enabled or @c EINA_FALSE otherwise
739 EAPI Eina_Bool ewk_context_certificate_file_set(Ewk_Context *context, const char *certificate_file);
742 * Request to get certifcate file
744 * @param context context object
746 * @return @c certificate_file is path which is set during ewk_context_certificate_file_set or @c NULL otherwise
748 EAPI const char* ewk_context_certificate_file_get(const Ewk_Context *context);
751 * Requests to clear cache
753 * @param context context object
755 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
757 EAPI Eina_Bool ewk_context_cache_clear(Ewk_Context* context);
760 * Posts message to injected bundle.
762 * @param context context object
763 * @param name message name
764 * @param body message body
766 EAPI void ewk_context_message_post_to_injected_bundle(Ewk_Context* context, const char* name, const char* body);
769 * Sets callback for received injected bundle message.
771 * @param context context object
772 * @param callback callback for received injected bundle message
773 * @param user_data user data
775 EAPI void ewk_context_message_from_injected_bundle_callback_set(Ewk_Context* context, Ewk_Context_Message_From_Injected_Bundle_Callback callback, void* user_data);
778 * Sets callback for started download.
780 * @param context context object
781 * @param callback callback for started download
782 * @param user_data user data
784 EAPI void ewk_context_did_start_download_callback_set(Ewk_Context* context, Ewk_Context_Did_Start_Download_Callback callback, void* user_data);
786 //#if ENABLE(MEMORY_SAMPLER)
788 * start memory sampler.
790 * @param context context object
791 * @param interval time gap to fire the timer
793 EAPI void ewk_context_memory_sampler_start(Ewk_Context* context, double timer_interval);
796 * stop memory sampler.
798 * @param context context object
800 EAPI void ewk_context_memory_sampler_stop(Ewk_Context* context);
804 * @typedef Ewk_Url_Scheme_Request_Cb Ewk_Url_Scheme_Request_Cb
805 * @brief Callback type for use with ewk_context_url_scheme_register().
807 typedef void (*Ewk_Url_Scheme_Request_Cb) (Ewk_Url_Scheme_Request *request, void *user_data);
810 * @typedef Ewk_Vibration_Client_Vibrate_Cb Ewk_Vibration_Client_Vibrate_Cb
811 * @brief Type definition for a function that will be called back when vibrate
812 * request receiveed from the vibration controller.
814 typedef void (*Ewk_Vibration_Client_Vibrate_Cb)(uint64_t vibration_time, void *user_data);
817 * @typedef Ewk_Vibration_Client_Vibration_Cancel_Cb Ewk_Vibration_Client_Vibration_Cancel_Cb
818 * @brief Type definition for a function that will be called back when cancel
819 * vibration request receiveed from the vibration controller.
821 typedef void (*Ewk_Vibration_Client_Vibration_Cancel_Cb)(void *user_data);
824 * @typedef Ewk_History_Navigation_Cb Ewk_History_Navigation_Cb
825 * @brief Type definition for a function that will be called back when @a view did navigation (loaded new URL).
827 typedef void (*Ewk_History_Navigation_Cb)(const Evas_Object *view, Ewk_Navigation_Data *navigation_data, void *user_data);
830 * @typedef Ewk_History_Client_Redirection_Cb Ewk_History_Client_Redirection_Cb
831 * @brief Type definition for a function that will be called back when @a view performed a client redirect.
833 typedef void (*Ewk_History_Client_Redirection_Cb)(const Evas_Object *view, const char *source_url, const char *destination_url, void *user_data);
836 * @typedef Ewk_History_Server_Redirection_Cb Ewk_History_Server_Redirection_Cb
837 * @brief Type definition for a function that will be called back when @a view performed a server redirect.
839 typedef void (*Ewk_History_Server_Redirection_Cb)(const Evas_Object *view, const char *source_url, const char *destination_url, void *user_data);
842 * @typedef Ewk_History_Title_Update_Cb Ewk_History_Title_Update_Cb
843 * @brief Type definition for a function that will be called back when history title is updated.
845 typedef void (*Ewk_History_Title_Update_Cb)(const Evas_Object *view, const char *title, const char *url, void *user_data);
848 * @typedef Ewk_Context_History_Client_Visited_Links_Populate_Cb Ewk_Context_History_Client_Visited_Links_Populate_Cb
849 * @brief Type definition for a function that will be called back when client is asked to provide visited links from a client-managed storage.
851 * @see ewk_context_visited_link_add
853 typedef void (*Ewk_History_Populate_Visited_Links_Cb)(void *user_data);
856 * Increases the reference count of the given object.
858 * @param context context object to increase the reference count
860 * @return Ewk_Context object on success or @c NULL on failure
862 EAPI Ewk_Context *ewk_context_ref(Ewk_Context *context);
865 * Decreases the reference count of the given object, possibly freeing it.
867 * When the reference count it's reached 0, the Ewk_Context is freed.
869 * @param context context object to decrease the reference count
871 EAPI void ewk_context_unref(Ewk_Context *context);
874 * Gets default Ewk_Context instance.
876 * The returned Ewk_Context object @b should not be unref'ed if application
877 * does not call ewk_context_ref() for that.
879 * @return Ewk_Context object.
881 EAPI Ewk_Context *ewk_context_default_get(void);
884 * Creates a new Ewk_Context.
886 * The returned Ewk_Context object @b should be unref'ed after use.
888 * @return Ewk_Context object on success or @c NULL on failure
890 * @see ewk_context_unref
891 * @see ewk_context_new_with_injected_bundle_path
893 EAPI Ewk_Context *ewk_context_new(void);
896 * Creates a new Ewk_Context.
898 * The returned Ewk_Context object @b should be unref'ed after use.
900 * @param path path of injected bundle library
902 * @return Ewk_Context object on success or @c NULL on failure
904 * @see ewk_context_unref
905 * @see ewk_context_new
907 EAPI Ewk_Context *ewk_context_new_with_injected_bundle_path(const char *path);
910 * Gets the cookie manager instance for this @a context.
912 * @param context context object to query.
914 * @return Ewk_Cookie_Manager object instance or @c NULL in case of failure.
916 EAPI Ewk_Cookie_Manager *ewk_context_cookie_manager_get(const Ewk_Context *context);
919 * Gets the favicon database instance for this @a context.
921 * @param context context object to query.
923 * @return Ewk_Favicon_Database object instance or @c NULL in case of failure.
925 EAPI Ewk_Favicon_Database *ewk_context_favicon_database_get(const Ewk_Context *context);
928 * Register @a scheme in @a context.
930 * When an URL request with @a scheme is made in the #Ewk_Context, the callback
931 * function provided will be called with a #Ewk_Url_Scheme_Request.
933 * It is possible to handle URL scheme requests asynchronously, by calling ewk_url_scheme_ref() on the
934 * #Ewk_Url_Scheme_Request and calling ewk_url_scheme_request_finish() later when the data of
935 * the request is available.
937 * @param context a #Ewk_Context object.
938 * @param scheme the network scheme to register
939 * @param callback the function to be called when an URL request with @a scheme is made.
940 * @param user_data data to pass to callback function
943 * static void about_url_scheme_request_cb(Ewk_Url_Scheme_Request *request, void *user_data)
946 * char *contents_data = NULL;
947 * unsigned int contents_length = 0;
949 * path = ewk_url_scheme_request_path_get(request);
950 * if (!strcmp(path, "plugins")) {
951 * // Initialize contents_data with the contents of plugins about page, and set its length to contents_length
952 * } else if (!strcmp(path, "memory")) {
953 * // Initialize contents_data with the contents of memory about page, and set its length to contents_length
954 * } else if (!strcmp(path, "applications")) {
955 * // Initialize contents_data with the contents of application about page, and set its length to contents_length
957 * Eina_Strbuf *buf = eina_strbuf_new();
958 * eina_strbuf_append_printf(buf, "<html><body><p>Invalid about:%s page</p></body></html>", path);
959 * contents_data = eina_strbuf_string_steal(buf);
960 * contents_length = strlen(contents);
961 * eina_strbuf_free(buf);
963 * ewk_url_scheme_request_finish(request, contents_data, contents_length, "text/html");
964 * free(contents_data);
968 EAPI Eina_Bool ewk_context_url_scheme_register(Ewk_Context *context, const char *scheme, Ewk_Url_Scheme_Request_Cb callback, void *user_data);
970 // #if ENABLE(TIZEN_SUPPORT_PLUGINS)
972 * Sets a additional plugin directory.
974 * @param context context object
975 * @param path the directory to be set
977 * @return @c EINA_TRUE if the directory was set, @c EINA_FALSE otherwise
979 EAPI Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context *context, const char *path);
983 * Sets vibration client callbacks to handle the tactile feedback in the form of
984 * vibration in the client application when the content asks for vibration.
986 * To stop listening for vibration events, you may call this function with @c
987 * NULL for the callbacks.
989 * @param context context object to set vibration client callbacks.
990 * @param vibrate The function to call when the vibrate request received from the
991 * controller (may be @c NULL).
992 * @param cancel The function to call when the cancel vibration request received
993 * from the controller (may be @c NULL).
994 * @param data User data (may be @c NULL).
996 EAPI void ewk_context_vibration_client_callbacks_set(Ewk_Context *context, Ewk_Vibration_Client_Vibrate_Cb vibrate, Ewk_Vibration_Client_Vibration_Cancel_Cb cancel, void *data);
999 * Sets history callbacks for the given @a context.
1001 * To stop listening for history events, you may call this function with @c
1002 * NULL for the callbacks.
1004 * @param context context object to set history callbacks
1005 * @param navigate_func The function to call when @c ewk_view did navigation (may be @c NULL).
1006 * @param client_redirect_func The function to call when @c ewk_view performed a client redirect (may be @c NULL).
1007 * @param server_redirect_func The function to call when @c ewk_view performed a server redirect (may be @c NULL).
1008 * @param title_update_func The function to call when history title is updated (may be @c NULL).
1009 * @param populate_visited_links_func The function is called when client is asked to provide visited links from a
1010 * client-managed storage (may be @c NULL).
1011 * @param data User data (may be @c NULL).
1013 EAPI void ewk_context_history_callbacks_set(Ewk_Context *context,
1014 Ewk_History_Navigation_Cb navigate_func,
1015 Ewk_History_Client_Redirection_Cb client_redirect_func,
1016 Ewk_History_Server_Redirection_Cb server_redirect_func,
1017 Ewk_History_Title_Update_Cb title_update_func,
1018 Ewk_History_Populate_Visited_Links_Cb populate_visited_links_func,
1022 * Registers the given @a visited_url as visited link in @a context visited link cache.
1024 * This function shall be invoked as a response to @c populateVisitedLinks callback of the history cient.
1026 * @param context context object to add visited link data
1027 * @param visited_url visited url
1029 * @see Ewk_Context_History_Client
1031 EAPI void ewk_context_visited_link_add(Ewk_Context *context, const char *visited_url);
1033 //#if ENABLE(TIZEN_WEBKIT2_MEMORY_SAVING_MODE)
1035 * Sets memory saving mode.
1037 * @param context context object
1038 * @param enable or disable memory saving mode
1041 EAPI void ewk_context_memory_saving_mode_set(Ewk_Context *context, Eina_Bool mode);
1044 //#if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
1046 * Clear password data
1048 * @param context context object
1051 EAPI void ewk_context_form_password_data_clear(Ewk_Context* context);
1054 * Clear candidate data
1056 * @param context context object
1059 EAPI void ewk_context_form_candidate_data_clear(Ewk_Context* context);
1062 //#if ENABLE(TIZEN_EXTENSIBLE_API)
1064 * Toggles tizen extensible api enable and disable
1066 * @param context context object
1067 * @param extensibleAPI extensible API of every kind
1068 * @param enable enable or disable tizen extensible api
1070 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
1072 EAPI Eina_Bool ewk_context_tizen_extensible_api_set(Ewk_Context *ewkContext, Ewk_Extensible_API extensibleAPI, Eina_Bool enable);
1075 //#if ENABLE(TIZEN_RESET_PATH)
1077 * Reset storage path such as web storage, web database, application cache and so on
1079 * @param context context object
1082 EAPI void ewk_context_storage_path_reset(Ewk_Context* ewkContext);
1089 #endif // ewk_context_h