1 // Copyright 2013-2015 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
10 #include "ewk_autofill_profile.h"
11 #include "ewk_cookie_manager.h"
12 #include "ewk_enums.h"
13 #include "ewk_export.h"
14 #include "ewk_notification.h"
15 #include "ewk_security_origin.h"
16 #include "ewk_application_cache_manager.h"
17 #include "ewk_favicon_database.h"
18 #include "ewk_storage_manager.h"
24 /// Extensible API enum is not supported in chromium.
25 typedef void* Ewk_Extensible_API;
27 typedef struct Ewk_Context Ewk_Context;
28 typedef struct Ewk_Context_Exceeded_Quota Ewk_Context_Exceeded_Quota;
30 typedef void (*Ewk_Context_Notification_Show_Callback)(
34 typedef void (*Ewk_Context_Notification_Cancel_Callback)(
40 * Deletes Ewk_Context.
42 * @param context Ewk_Context to delete
44 EXPORT_API void ewk_context_delete(Ewk_Context* context);
47 * Notify low memory to free unused memory.
49 * @param o context object to notify low memory.
51 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
53 EXPORT_API Eina_Bool ewk_context_notify_low_memory(Ewk_Context* ewkContext);
56 * Sets the given proxy URI to network backend of specific context.
58 * @param ewkContext context object to set proxy URI.
59 * @param proxy URI to set
61 EXPORT_API void ewk_context_proxy_uri_set(Ewk_Context* ewkContext, const char* proxy);
64 * Gets the proxy URI from the network backend of specific context.
66 * It returns an internal string and should not
67 * be modified. The string is guaranteed to be stringshared.
69 * @param ewkContext context object to get proxy URI.
71 * @return current proxy URI or @c 0 if it's not set
73 EXPORT_API const char* ewk_context_proxy_uri_get(Ewk_Context* ewkContext);
76 * @typedef Ewk_Local_File_System_Origins_Get_Callback Ewk_Local_File_System_Origins_Get_Callback
77 * @brief Type definition for use with ewk_context_local_file_system_origins_get()
79 typedef void (*Ewk_Local_File_System_Origins_Get_Callback)(Eina_List *origins, void *user_data);
82 * Callback for ewk_context_application_cache_origins_get
84 * @param origins web application cache origins
85 * @param user_data user_data will be passsed when ewk_context_application_cache_origins_get is called
87 typedef void (*Ewk_Web_Application_Cache_Origins_Get_Callback)(Eina_List* origins, void* user_data);
90 * Callback for ewk_context_application_cache_quota_get.
92 * @param quota web application cache quota
93 * @param user_data user_data will be passsed when ewk_context_application_cache_quota_get is called
95 typedef void (*Ewk_Web_Application_Cache_Quota_Get_Callback)(int64_t quota, void* user_data);
98 * Callback for ewk_context_application_cache_usage_for_origin_get.
100 * @param usage web application cache usage for origin
101 * @param user_data user_data will be passsed when ewk_context_application_cache_usage_for_origin_get is called
103 typedef void (*Ewk_Web_Application_Cache_Usage_For_Origin_Get_Callback)(int64_t usage, void* user_data);
106 * Callback for ewk_context_application_cache_path_get.
108 * @param path web application cache directory
109 * @param user_data user_data will be passsed when ewk_context_application_cache_path_get is called
111 //typedef void (*Ewk_Web_Application_Cache_Path_Get_Callback)(const char* path, void* user_data);
114 * Callback for ewk_context_web_database_origins_get.
116 * @param origins web database origins
117 * @param user_data user_data will be passsed when ewk_context_web_database_origins_get is called
119 typedef void (*Ewk_Web_Database_Origins_Get_Callback)(Eina_List* origins, void* user_data);
122 * Callback for ewk_context_web_database_quota_for_origin_get.
124 * @param quota web database quota
125 * @param user_data user_data will be passsed when ewk_context_web_database_quota_for_origin_get is called
127 typedef void (*Ewk_Web_Database_Quota_Get_Callback)(uint64_t quota, void* user_data);
130 * Callback for ewk_context_web_database_usage_for_origin_get.
132 * @param usage web database usage
133 * @param user_data user_data will be passsed when ewk_context_web_database_usage_for_origin_get is called
135 typedef void (*Ewk_Web_Database_Usage_Get_Callback)(uint64_t usage, void* user_data);
138 * Callback for ewk_context_web_database_path_get.
140 * @param path web database directory
141 * @param user_data user_data will be passsed when ewk_context_web_database_path_get is called
143 //typedef void (*Ewk_Web_Database_Path_Get_Callback)(const char* path, void* user_data);
146 * Callback for ewk_context_web_storage_origins_get.
148 * @param origins web storage origins
149 * @param user_data user_data will be passsed when ewk_context_web_storage_origins_get is called
151 typedef void (*Ewk_Web_Storage_Origins_Get_Callback)(Eina_List* origins, void* user_data);
154 * Callback for ewk_context_web_storage_usage_for_origin_get.
156 * @param usage usage of web storage
157 * @param user_data user_data will be passsed when ewk_context_web_storage_usage_for_origin_get is called
159 typedef void (*Ewk_Web_Storage_Usage_Get_Callback)(uint64_t usage, void* user_data);
162 * Callback for didStartDownload
164 * @param download_url url to download
165 * @param user_data user_data will be passsed when download is started
167 typedef void (*Ewk_Context_Did_Start_Download_Callback)(const char* download_url, void* user_data);
170 * Callback for overriding default mime type
172 * @param url url for which the mime type can be overridden
173 * @param mime current mime type assumed by the web engine
174 * @param new_mime string with a new mime type for content pointer by url. Should be allocated
175 * dynamically by malloc or calloc. If callback returns EINA_TRUE, the browser will take ownership
176 * of the allocated memory and free it when it's no longer needed using the free() function
177 * @return true in case mime should be overridden by the contents of new_mime, false otherwise.
178 * If false will be returned, the browser won't free the new_mime
179 * @param user_data user_data will be passsed when ewk_context_mime_override_callback_set is called
181 typedef Eina_Bool (*Ewk_Context_Override_Mime_For_Url_Callback)(const char* url, const char *mime, char **new_mime, void* user_data);
184 * Callback for changed profiles.
186 * @param user_data user_data will be passsed when download is started
188 typedef void (*Ewk_Context_Form_Autofill_Profile_Changed_Callback)(void *data);
191 * Requests for freeing origins.
193 * @param origins list of origins
195 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
197 EXPORT_API Eina_Bool ewk_context_origins_free(Eina_List* origins);
200 * Requests for deleting all web application caches.
202 * @param context context object
204 * @return @c EINA_TRUE on successful request or @c EINA FALSE on failure
206 EXPORT_API Eina_Bool ewk_context_application_cache_delete_all(Ewk_Context* context);
209 * Requests for deleting web application cache for origin.
211 * @param context context object
212 * @param origin application cache origin
214 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
216 EXPORT_API Eina_Bool ewk_context_application_cache_delete(Ewk_Context* context, Ewk_Security_Origin* origin);
219 * Requests for getting web application cache origins.
221 * @param context context object
222 * @param result_callback callback to get web application cache origins
223 * @param user_data user_data will be passsed when result_callback is called
225 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
227 * @see ewk_context_origins_free
229 EXPORT_API Eina_Bool ewk_context_application_cache_origins_get(Ewk_Context* context, Ewk_Web_Application_Cache_Origins_Get_Callback callback, void* user_data);
232 * Requests for setting application cache quota for origin.
234 * @param context context object
235 * @param origin serucity origin
236 * @param quota size of quota
238 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
240 EXPORT_API Eina_Bool ewk_context_application_cache_quota_for_origin_set(Ewk_Context* context, const Ewk_Security_Origin* origin, int64_t quota);
243 * Requests for getting application cache usage for origin.
245 * @param context context object
246 * @param origin security origin
247 * @param result_callback callback to get web database usage
248 * @param user_data user_data will be passed when result_callback is called
249 * -I.e., user data will be kept until callback is called
251 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
253 EXPORT_API 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* user_data);
256 * Requests setting of the favicon database path.
258 * @param context context object
259 * @param path database path.
261 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
263 EXPORT_API Eina_Bool ewk_context_icon_database_path_set(Ewk_Context* context, const char* path);
266 * Requests to get image representing the given URL.
268 * @param context context object
269 * @param url which url to query icon, must not be @c 0
270 * @param canvas evas instance where to add resulting object, must not be @c 0
272 * @return newly allocated Evas_Object instance or @c 0 on
273 * errors. Delete the object with evas_object_del().
275 EXPORT_API Evas_Object* ewk_context_icon_database_icon_object_add(Ewk_Context* context, const char* uri, Evas* canvas);
278 * Requests for deleting all local file systems.
280 * @param context context object
282 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
284 EXPORT_API Eina_Bool ewk_context_local_file_system_all_delete(Ewk_Context *context);
287 * Requests for deleting local file system for origin.
289 * @param context context object
290 * @param origin local file system origin
292 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
294 EXPORT_API Eina_Bool ewk_context_local_file_system_delete(Ewk_Context *context, Ewk_Security_Origin *origin);
297 * Requests for getting local file system origins.
299 * @param context context object
300 * @param result_callback callback to get local file system origins
301 * @param user_data user_data will be passed when result_callback is called
302 * -I.e., user data will be kept until callback is called
304 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
306 * @see ewk_context_origins_free
308 EXPORT_API Eina_Bool ewk_context_local_file_system_origins_get(const Ewk_Context *context, Ewk_Local_File_System_Origins_Get_Callback callback, void *user_data);
311 * Requests for deleting all web databases.
313 * @param context context object
315 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
317 EXPORT_API Eina_Bool ewk_context_web_database_delete_all(Ewk_Context* context);
320 * Requests for deleting web databases for origin.
322 * @param context context object
323 * @param origin database origin
325 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
327 EXPORT_API Eina_Bool ewk_context_web_database_delete(Ewk_Context* context, Ewk_Security_Origin* origin);
330 * Requests for getting web database origins.
332 * @param context context object
333 * @param result_callback callback to get web database origins
334 * @param user_data user_data will be passed when result_callback is called
335 * -I.e., user data will be kept until callback is called
337 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
339 * @see ewk_context_origins_free
341 EXPORT_API Eina_Bool ewk_context_web_database_origins_get( Ewk_Context* context, Ewk_Web_Database_Origins_Get_Callback callback, void* user_data);
344 * Requests for getting web database quota for origin.
346 * @param context context object
347 * @param result_callback callback to get web database quota
348 * @param user_data user_data will be passed when result_callback is called
349 * -I.e., user data will be kept until callback is called
350 * @param origin database origin
352 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
354 EXPORT_API 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);
357 * Requests for setting web database quota for origin.
359 * @param context context object
360 * @param origin database origin
361 * @param quota size of quota
363 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
365 EXPORT_API Eina_Bool ewk_context_web_database_quota_for_origin_set(Ewk_Context* context, Ewk_Security_Origin* origin, uint64_t quota);
368 * Requests for getting web database usage for origin.
370 * @param context context object
371 * @param result_callback callback to get web database usage
372 * @param user_data user_data will be passed when result_callback is called
373 * -I.e., user data will be kept until callback is called
374 * @param origin database origin
376 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
378 EXPORT_API 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);
381 * Requests for deleting all web indexed databases.
383 * @param context context object
385 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
387 EXPORT_API Eina_Bool ewk_context_web_indexed_database_delete_all(Ewk_Context* context);
389 * Deletes all web storage.
391 * @param context context object
393 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
395 EXPORT_API Eina_Bool ewk_context_web_storage_delete_all(Ewk_Context* context);
398 * Deletes origin that is stored in web storage db.
400 * @param context context object
401 * @param origin origin of db
403 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
405 EXPORT_API Eina_Bool ewk_context_web_storage_origin_delete(Ewk_Context* context, Ewk_Security_Origin* origin);
408 * Gets list of origins that is stored in web storage db.
410 * This function allocates memory for context structure made from callback and user_data.
412 * @param context context object
413 * @param result_callback callback to get web storage origins
414 * @param user_data user_data will be passed when result_callback is called
415 * -I.e., user data will be kept until callback is called
417 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
419 * @See ewk_context_origins_free()
421 EXPORT_API Eina_Bool ewk_context_web_storage_origins_get(Ewk_Context* context, Ewk_Web_Storage_Origins_Get_Callback callback, void* user_data);
423 * Gets usage of web storage for certain origin.
425 * This function allocates memory for context structure made from callback and user_data.
427 * @param context context object
428 * @param origin security origin
429 * @param callback callback to get web storage usage
430 * @param user_data user_data will be passed when result_callback is called
431 * -I.e., user data will be kept until callback is called
433 * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
435 EXPORT_API 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);
438 * Requests for setting soup data path(soup data include cookie and cache).
440 * @param context context object
441 * @param path soup data path to set
443 * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
445 EXPORT_API Eina_Bool ewk_context_soup_data_directory_set(Ewk_Context* context, const char* path);
448 * Requests to set the cache model
450 * @param context context object
451 * @param model cache model
453 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
455 EXPORT_API Eina_Bool ewk_context_cache_model_set(Ewk_Context* context, Ewk_Cache_Model model);
458 * Returns the cache model type
460 * @param context context object
462 * @return Ewk_Cache_Model
464 EXPORT_API Ewk_Cache_Model ewk_context_cache_model_get(Ewk_Context* context);
467 * Toggles the cache enable and disable
469 * @param context context object
470 * @param enable or disable cache
472 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
474 EXPORT_API Eina_Bool ewk_context_cache_disabled_set(Ewk_Context* ewkContext, Eina_Bool cacheDisabled);
477 * Queries if the cache is enabled
479 * @param context context object
481 * @return @c EINA_TRUE is cache is enabled or @c EINA_FALSE otherwise
483 EXPORT_API Eina_Bool ewk_context_cache_disabled_get(const Ewk_Context* ewkContext);
486 * Request to set certifcate file
488 * @param context context object
489 * @param certificate_file is path where certificate file is stored
491 * @return @c EINA_TRUE is cache is enabled or @c EINA_FALSE otherwise
493 EXPORT_API Eina_Bool ewk_context_certificate_file_set(Ewk_Context *context, const char *certificate_file);
496 * Request to get certifcate file
498 * @param context context object
500 * @return @c certificate_file is path which is set during ewk_context_certificate_file_set or @c NULL otherwise
502 EXPORT_API const char* ewk_context_certificate_file_get(const Ewk_Context *context);
505 * Requests to clear cache
507 * @param context context object
509 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
511 EXPORT_API Eina_Bool ewk_context_cache_clear(Ewk_Context* ewkContext);
514 * Sets callback for started download.
516 * @param context context object
517 * @param callback callback for started download
518 * @param user_data user data
520 EXPORT_API void ewk_context_did_start_download_callback_set(Ewk_Context* context, Ewk_Context_Did_Start_Download_Callback callback, void* user_data);
523 * Sets callback for overriding mime type
525 * @param context context object
526 * @param callback callback to be invoked whenver the mime type can be overridden
527 * @param user_data user data
529 EXPORT_API void ewk_context_mime_override_callback_set(Ewk_Context* context, Ewk_Context_Override_Mime_For_Url_Callback callback, void* user_data);
532 * Deprecated, this function dose nothing, it's left to allow legacy applications to work with current builds
533 * Starts memory sampler.
535 * @param context context object
536 * @param interval time gap to fire the timer
538 EINA_DEPRECATED EXPORT_API void ewk_context_memory_sampler_start(Ewk_Context* context, double timer_interval);
541 * Deprecated, this function dose nothing, it's left to allow legacy applications to work with current builds
542 * Stops memory sampler.
544 * @param context context object
546 EINA_DEPRECATED EXPORT_API void ewk_context_memory_sampler_stop(Ewk_Context* context);
549 * @typedef Ewk_Vibration_Client_Vibrate_Cb Ewk_Vibration_Client_Vibrate_Cb
550 * @brief Type definition for a function that will be called back when vibrate
551 * request receiveed from the vibration controller.
553 typedef void (*Ewk_Vibration_Client_Vibrate_Cb)(uint64_t vibration_time, void *user_data);
556 * @typedef Ewk_Vibration_Client_Vibration_Cancel_Cb Ewk_Vibration_Client_Vibration_Cancel_Cb
557 * @brief Type definition for a function that will be called back when cancel
558 * vibration request receiveed from the vibration controller.
560 typedef void (*Ewk_Vibration_Client_Vibration_Cancel_Cb)(void *user_data);
563 * Increases the reference count of the given object.
565 * @param context context object to increase the reference count
567 * @return Ewk_Context object on success or @c NULL on failure
569 EXPORT_API Ewk_Context *ewk_context_ref(Ewk_Context *context);
572 * Decreases the reference count of the given object, possibly freeing it.
574 * When the reference count it's reached 0, the Ewk_Context is freed.
576 * @param context context object to decrease the reference count
578 EXPORT_API void ewk_context_unref(Ewk_Context *context);
580 * Gets default Ewk_Context instance.
582 * The returned Ewk_Context object @b should not be unref'ed if application
583 * does not call ewk_context_ref() for that.
585 * @return Ewk_Context object.
587 EXPORT_API Ewk_Context *ewk_context_default_get(void);
590 * Creates a new Ewk_Context.
592 * The returned Ewk_Context object @b should be unref'ed after use.
594 * @return Ewk_Context object on success or @c NULL on failure
596 * @see ewk_context_unref
597 * @see ewk_context_new_with_injected_bundle_path
599 EXPORT_API Ewk_Context *ewk_context_new(void);
602 * Creates a new Ewk_Context.
604 * The returned Ewk_Context object @b should be unref'ed after use.
606 * Ewk view based on chromium engine does not support this API
607 * Avoid using this API
609 * @param path path of injected bundle library
611 * @return Ewk_Context object on success or @c NULL on failure
613 * @see ewk_context_unref
614 * @see ewk_context_new
616 EXPORT_API Ewk_Context *ewk_context_new_with_injected_bundle_path(const char *path);
619 * Gets the cookie manager instance for this @a context.
621 * @param context context object to query.
623 * @return Ewk_Cookie_Manager object instance or @c NULL in case of failure.
625 EXPORT_API Ewk_Cookie_Manager *ewk_context_cookie_manager_get(const Ewk_Context *context);
628 * Sets additional plugin directory.
630 * @param context context object
631 * @param path the directory to be set
633 * @return @c EINA_TRUE if the directory was set, @c EINA_FALSE otherwise
635 EXPORT_API Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context *context, const char *path);
638 * Sets vibration client callbacks to handle the tactile feedback in the form of
639 * vibration in the client application when the content asks for vibration.
641 * To stop listening for vibration events, you may call this function with @c
642 * NULL for the callbacks.
644 * @param context context object to set vibration client callbacks.
645 * @param vibrate The function to call when the vibrate request received from the
646 * controller (may be @c NULL).
647 * @param cancel The function to call when the cancel vibration request received
648 * from the controller (may be @c NULL).
649 * @param data User data (may be @c NULL).
651 EXPORT_API 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);
654 * Sets memory saving mode.
656 * @param context context object
657 * @param enable or disable memory saving mode
660 EXPORT_API void ewk_context_memory_saving_mode_set(Ewk_Context *context, Eina_Bool mode);
662 struct Ewk_Password_Data {
664 Eina_Bool useFingerprint;
668 * Deletes whole password data from DB
670 * @param context context object
673 EXPORT_API void ewk_context_form_password_data_delete_all(Ewk_Context* context);
676 * Deletes password data from DB for given URL
678 * The API will delete the a password data from DB.
680 * @param const char* with url
682 * @see ewk_context_form_password_data_update
683 * @see ewk_context_form_password_data_list_free
684 * @see ewk_context_form_password_data_list_get
686 EXPORT_API void ewk_context_form_password_data_delete(Ewk_Context* context, const char* url);
689 * Get all password url list
691 * The API will delete the a password data list only from the memory.
692 * To remove the password data for URL permenantly, use ewk_context_form_password_data_delete
694 * @param Eina_List with Ewk_Password_Data
696 * @see ewk_context_form_password_data_update
697 * @see ewk_context_form_password_data_delete
698 * @see ewk_context_form_password_data_list_free
700 EXPORT_API Eina_List* ewk_context_form_password_data_list_get(Ewk_Context* context);
703 * Deletes a given password data list
705 * The API will delete the a password data list only from the memory.
706 * To remove the password data for URL permenantly, use ewk_context_form_password_data_delete
708 * @param Eina_List with Ewk_Password_Data
710 * @see ewk_context_form_password_data_update
711 * @see ewk_context_form_password_data_delete
712 * @see ewk_context_form_password_data_list_get
714 EXPORT_API void ewk_context_form_password_data_list_free(Ewk_Context* context, Eina_List* list);
717 * Clear candidate data
719 * @param context context object
722 EXPORT_API void ewk_context_form_candidate_data_delete_all(Ewk_Context* context);
725 * Sets callback for profiles change notification.
727 * @param callback pointer to callback function
728 * @param user_data user data returned on callback
731 EXPORT_API void ewk_context_form_autofill_profile_changed_callback_set(
732 Ewk_Context_Form_Autofill_Profile_Changed_Callback callback,
736 * Gets a list of all existing profiles
738 * The obtained profile must be deleted by ewk_autofill_profile_delete.
739 * @param context context object
741 * @return @c Eina_List of Ewk_Autofill_Profile @c NULL otherwise
742 * @see ewk_autofill_profile_delete
744 EXPORT_API Eina_List* ewk_context_form_autofill_profile_get_all(Ewk_Context* context);
747 * Gets the existing profile for given index
749 * The obtained profile must be deleted by ewk_autofill_profile_delete.
751 * @param context context object
754 * @return @c Ewk_Autofill_Profile if profile exists, @c NULL otherwise
755 * @see ewk_autofill_profile_delete
757 EXPORT_API Ewk_Autofill_Profile* ewk_context_form_autofill_profile_get(Ewk_Context* context, unsigned id);
760 * Sets the given profile for the given id
762 * Data can be added to the created profile by ewk_autofill_profile_data_set.
764 * @param context context object
766 * @param profile Ewk_Autofill_Profile
768 * @return @c EINA_TRUE if the profile data is set successfully, @c EINA_FALSE otherwise
769 * @see ewk_autofill_profile_new
770 * @see ewk_context_form_autofill_profile_add
772 EXPORT_API Eina_Bool ewk_context_form_autofill_profile_set(Ewk_Context* context, unsigned id, Ewk_Autofill_Profile* profile);
775 * Saves the created profile into permenant storage
777 * The profile used to save must be created by ewk_autofill_profile_new.
778 * Data can be added to the created profile by ewk_autofill_profile_data_set.
780 * @param context context object
781 * @param profile Ewk_Autofill_Profile
783 * @return @c EINA_TRUE if the profile data is saved successfully, @c EINA_FALSE otherwise
784 * @see ewk_autofill_profile_new
786 EXPORT_API Eina_Bool ewk_context_form_autofill_profile_add(Ewk_Context* context, Ewk_Autofill_Profile* profile);
789 * Removes Autofill Form profile completely
791 * @param context context object
792 * @param index profile id
794 * @return @c EINA_TRUE if the profile data is removed successfully, @c EINA_FALSE otherwise
795 * @see ewk_context_form_autofill_profile_get_all
797 EXPORT_API Eina_Bool ewk_context_form_autofill_profile_remove(Ewk_Context* context, unsigned id);
800 * Get tizen extensible api enable state
802 * @param context context object
803 * @param extensible_api extensible API name of every kind
805 * @return @c EINA_TRUE if the extensibleAPI set as true or @c EINA_FALSE otherwise
807 EXPORT_API Eina_Bool ewk_context_tizen_extensible_api_string_get(Ewk_Context* context, const char* extensible_api);
810 * Toggles tizen extensible api enable and disable
812 * @param context context object
813 * @param extensible_api extensible API name of every kind
814 * @param enable enable or disable tizen extensible api
816 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
818 EXPORT_API Eina_Bool ewk_context_tizen_extensible_api_string_set(Ewk_Context *context, const char *extensible_api, Eina_Bool enable);
821 * Toggles tizen extensible api enable and disable
823 * @param context context object
824 * @param extensibleAPI extensible API of every kind
825 * @param enable enable or disable tizen extensible api
827 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
829 EXPORT_API Eina_Bool ewk_context_tizen_extensible_api_set(Ewk_Context *context, Ewk_Extensible_API extensible_api, Eina_Bool enable);
832 * Get tizen extensible api enable state
834 * @param context context object
835 * @param extensibleAPI extensible API of every kind
837 * @return @c EINA_TRUE if the extensibleAPI set as true or @c EINA_FALSE otherwise
839 EXPORT_API Eina_Bool ewk_context_tizen_extensible_api_get(Ewk_Context *ewkContext, Ewk_Extensible_API extensibleAPI);
842 * Reset storage path such as web storage, web database, application cache and so on
844 * @param context context object
847 EXPORT_API void ewk_context_storage_path_reset(Ewk_Context* ewkContext);
850 * Sets the given id for the pixmap
852 * @param context context object
855 * @return @c EINA_TRUE if the pixmap set successfully, @c EINA_FALSE otherwise
857 EXPORT_API Eina_Bool ewk_context_pixmap_set(Ewk_Context* context, int pixmap);
860 * Start the inspector server
862 * @param context context object
865 * @return @c return the port number
867 EXPORT_API unsigned int ewk_context_inspector_server_start(Ewk_Context* context, unsigned int port);
870 * Stop the inspector server
872 * @param context context object
874 * @return @c EINA_TRUE if the inspector server stop set successfully, @c EINA_FALSE otherwise
876 EXPORT_API Eina_Bool ewk_context_inspector_server_stop(Ewk_Context* context);
879 ///------- belows are extension of chromium-ewk ---------------------------
882 * Gets the id for the pixmap
884 * @param context context object
886 * @return @c id for the pixmap. On error default return is 0.
888 EXPORT_API int ewk_context_pixmap_get(Ewk_Context *context);
890 EXPORT_API void ewk_send_widget_info(Ewk_Context *context, const char* tizen_id, double scale, const char *theme, const char *encodedBundle);
893 * Gets the application cache manager instance for this @a context.
895 * @param context context object to query.
897 * @return Ewk_Cookie_Manager object instance or @c NULL in case of failure.
899 EXPORT_API Ewk_Application_Cache_Manager *ewk_context_application_cache_manager_get(const Ewk_Context *context);
902 * Gets the favicon database instance for this @a context.
904 * @param context context object to query.
906 * @return Ewk_Favicon_Database object instance or @c NULL in case of failure.
908 EXPORT_API Ewk_Favicon_Database *ewk_context_favicon_database_get(const Ewk_Context *context);
911 * Clears HTTP caches in local storage and all resources cached in memory
912 * such as images, CSS, JavaScript, XSL, and fonts for @a context.
914 * @param context context object to clear all resource caches
916 EXPORT_API void ewk_context_resource_cache_clear(Ewk_Context *context);
919 * Sets the favicon database directory for this @a context.
921 * Sets the directory path to be used to store the favicons database
922 * for @a context on disk. Passing @c NULL as @a directory_path will
923 * result in using the default directory for the platform.
925 * Calling this method also means enabling the favicons database for
926 * its use from the applications, it is therefore expected to be
927 * called only once. Further calls for the same instance of
928 * @a context will not have any effect.
930 * @param context context object to update
931 * @param directory_path database directory path to set
933 * @return @c EINA_TRUE if successful, @c EINA_FALSE otherwise
935 EXPORT_API Eina_Bool ewk_context_favicon_database_directory_set(Ewk_Context *context, const char *directory_path);
938 * Sets the list of preferred languages.
940 * Sets the list of preferred langages. This list will be used to build the "Accept-Language"
941 * header that will be included in the network requests.
942 * Client can pass @c NULL for languages to clear what is set before.
944 * @param languages the list of preferred languages (char* as data) or @c NULL
946 * @note all contexts will be affected.
948 EXPORT_API void ewk_context_preferred_languages_set(Eina_List *languages);
951 * Gets the storage manager instance for this @a context.
953 * @param context context object to query.
955 * @return Ewk_Storage_Manager object instance or @c NULL in case of failure.
957 EXPORT_API Ewk_Storage_Manager *ewk_context_storage_manager_get(const Ewk_Context *context);
959 EXPORT_API Eina_Bool ewk_context_notification_callbacks_set(Ewk_Context* context,
960 Ewk_Context_Notification_Show_Callback show_callback,
961 Ewk_Context_Notification_Cancel_Callback cancel_callback, void* user_data);
963 EXPORT_API Eina_Bool ewk_context_notification_callbacks_reset(Ewk_Context* context);
969 #endif // ewk_context_h