8cd01f58d371194025bf801bc557ad17e496466a
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_context.h
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.
4
5 #ifndef ewk_context_h
6 #define ewk_context_h
7
8 #include <Evas.h>
9
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"
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /// Extensible API enum is not supported in chromium.
25 typedef void* Ewk_Extensible_API;
26
27 typedef struct Ewk_Context Ewk_Context;
28 typedef struct Ewk_Context_Exceeded_Quota Ewk_Context_Exceeded_Quota;
29
30 typedef void (*Ewk_Context_Notification_Show_Callback)(
31     Ewk_Context*,
32     Ewk_Notification*,
33     void*);
34 typedef void (*Ewk_Context_Notification_Cancel_Callback)(
35     Ewk_Context*,
36     uint64_t,
37     void*);
38
39 /**
40  * Deletes Ewk_Context.
41  *
42  * @param context Ewk_Context to delete
43  */
44 EXPORT_API void ewk_context_delete(Ewk_Context* context);
45
46 /**
47  * Notify low memory to free unused memory.
48  *
49  * @param o context object to notify low memory.
50  *
51  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
52  */
53 EXPORT_API Eina_Bool ewk_context_notify_low_memory(Ewk_Context* ewkContext);
54
55 /**
56  * Sets the given proxy URI to network backend of specific context.
57  *
58  * @param ewkContext context object to set proxy URI.
59  * @param proxy URI to set
60  */
61 EXPORT_API void ewk_context_proxy_uri_set(Ewk_Context* ewkContext, const char* proxy);
62
63 /**
64  * Gets the proxy URI from the network backend of specific context.
65  *
66  * It returns an internal string and should not
67  * be modified. The string is guaranteed to be stringshared.
68  *
69  * @param ewkContext context object to get proxy URI.
70  *
71  * @return current proxy URI or @c 0 if it's not set
72  */
73 EXPORT_API const char* ewk_context_proxy_uri_get(Ewk_Context* ewkContext);
74
75 /**
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()
78  */
79 typedef void (*Ewk_Local_File_System_Origins_Get_Callback)(Eina_List *origins, void *user_data);
80
81 /**
82  * Callback for ewk_context_application_cache_origins_get
83  *
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
86  */
87 typedef void (*Ewk_Web_Application_Cache_Origins_Get_Callback)(Eina_List* origins, void* user_data);
88
89 /**
90  * Callback for ewk_context_application_cache_quota_get.
91  *
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
94  */
95 typedef void (*Ewk_Web_Application_Cache_Quota_Get_Callback)(int64_t quota, void* user_data);
96
97 /**
98  * Callback for ewk_context_application_cache_usage_for_origin_get.
99  *
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
102  */
103 typedef void (*Ewk_Web_Application_Cache_Usage_For_Origin_Get_Callback)(int64_t usage, void* user_data);
104
105 /**
106  * Callback for ewk_context_application_cache_path_get.
107  *
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
110  */
111 //typedef void (*Ewk_Web_Application_Cache_Path_Get_Callback)(const char* path, void* user_data);
112
113 /**
114  * Callback for ewk_context_web_database_origins_get.
115  *
116  * @param origins web database origins
117  * @param user_data user_data will be passsed when ewk_context_web_database_origins_get is called
118  */
119 typedef void (*Ewk_Web_Database_Origins_Get_Callback)(Eina_List* origins, void* user_data);
120
121 /**
122  * Callback for ewk_context_web_database_quota_for_origin_get.
123  *
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
126  */
127 typedef void (*Ewk_Web_Database_Quota_Get_Callback)(uint64_t quota, void* user_data);
128
129 /**
130  * Callback for ewk_context_web_database_usage_for_origin_get.
131  *
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
134  */
135 typedef void (*Ewk_Web_Database_Usage_Get_Callback)(uint64_t usage, void* user_data);
136
137 /**
138  * Callback for ewk_context_web_database_path_get.
139  *
140  * @param path web database directory
141  * @param user_data user_data will be passsed when ewk_context_web_database_path_get is called
142  */
143 //typedef void (*Ewk_Web_Database_Path_Get_Callback)(const char* path, void* user_data);
144
145 /**
146  * Callback for ewk_context_web_storage_origins_get.
147  *
148  * @param origins web storage origins
149  * @param user_data user_data will be passsed when ewk_context_web_storage_origins_get is called
150  */
151 typedef void (*Ewk_Web_Storage_Origins_Get_Callback)(Eina_List* origins, void* user_data);
152
153 /**
154  * Callback for ewk_context_web_storage_usage_for_origin_get.
155  *
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
158  */
159 typedef void (*Ewk_Web_Storage_Usage_Get_Callback)(uint64_t usage, void* user_data);
160
161 /**
162  * Callback for didStartDownload
163  *
164  * @param download_url url to download
165  * @param user_data user_data will be passsed when download is started
166  */
167 typedef void (*Ewk_Context_Did_Start_Download_Callback)(const char* download_url, void* user_data);
168
169 /**
170  * Callback for overriding default mime type
171  *
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
180  */
181 typedef Eina_Bool (*Ewk_Context_Override_Mime_For_Url_Callback)(const char* url, const char *mime, char **new_mime, void* user_data);
182
183 /*
184  * Callback for changed profiles.
185  *
186  * @param user_data user_data will be passsed when download is started
187  */
188 typedef void (*Ewk_Context_Form_Autofill_Profile_Changed_Callback)(void *data);
189
190 /**
191  * Requests for freeing origins.
192  *
193  * @param origins list of origins
194  *
195  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
196  */
197 EXPORT_API Eina_Bool ewk_context_origins_free(Eina_List* origins);
198
199 /**
200  * Requests for deleting all web application caches.
201  *
202  * @param context context object
203  *
204  * @return @c EINA_TRUE on successful request or @c EINA FALSE on failure
205  */
206 EXPORT_API Eina_Bool ewk_context_application_cache_delete_all(Ewk_Context* context);
207
208 /**
209  * Requests for deleting web application cache for origin.
210  *
211  * @param context context object
212  * @param origin application cache origin
213  *
214  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
215  */
216 EXPORT_API Eina_Bool ewk_context_application_cache_delete(Ewk_Context* context, Ewk_Security_Origin* origin);
217
218 /**
219  * Requests for getting web application cache origins.
220  *
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
224  *
225  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
226  *
227  * @see ewk_context_origins_free
228  */
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);
230
231 /**
232  * Requests for setting application cache quota for origin.
233  *
234  * @param context context object
235  * @param origin serucity origin
236  * @param quota size of quota
237  *
238  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
239  */
240 EXPORT_API Eina_Bool ewk_context_application_cache_quota_for_origin_set(Ewk_Context* context, const Ewk_Security_Origin* origin, int64_t quota);
241
242 /**
243  * Requests for getting application cache usage for origin.
244  *
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
250  *
251  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
252  */
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);
254
255 /**
256  * Requests setting of the favicon database path.
257  *
258  * @param context context object
259  * @param path database path.
260  *
261  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
262  */
263 EXPORT_API Eina_Bool ewk_context_icon_database_path_set(Ewk_Context* context, const char* path);
264
265 /**
266  * Requests to get image representing the given URL.
267  *
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
271  *
272  * @return newly allocated Evas_Object instance or @c 0 on
273  *         errors. Delete the object with evas_object_del().
274  */
275 EXPORT_API Evas_Object* ewk_context_icon_database_icon_object_add(Ewk_Context* context, const char* uri, Evas* canvas);
276
277 /**
278  * Requests for deleting all local file systems.
279  *
280  * @param context context object
281  *
282  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
283  */
284 EXPORT_API Eina_Bool ewk_context_local_file_system_all_delete(Ewk_Context *context);
285
286 /**
287  * Requests for deleting local file system for origin.
288  *
289  * @param context context object
290  * @param origin local file system origin
291  *
292  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
293  */
294 EXPORT_API Eina_Bool ewk_context_local_file_system_delete(Ewk_Context *context, Ewk_Security_Origin *origin);
295
296  /**
297  * Requests for getting local file system origins.
298  *
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
303  *
304  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
305  *
306  * @see ewk_context_origins_free
307  */
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);
309
310 /**
311  * Requests for deleting all web databases.
312  *
313  * @param context context object
314  *
315  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
316  */
317 EXPORT_API Eina_Bool ewk_context_web_database_delete_all(Ewk_Context* context);
318
319 /**
320  * Requests for deleting web databases for origin.
321  *
322  * @param context context object
323  * @param origin database origin
324  *
325  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
326  */
327 EXPORT_API Eina_Bool ewk_context_web_database_delete(Ewk_Context* context, Ewk_Security_Origin* origin);
328
329 /**
330  * Requests for getting web database origins.
331  *
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
336  *
337  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
338  *
339  * @see ewk_context_origins_free
340  */
341 EXPORT_API Eina_Bool ewk_context_web_database_origins_get( Ewk_Context* context, Ewk_Web_Database_Origins_Get_Callback callback, void* user_data);
342
343 /**
344  * Requests for getting web database quota for origin.
345  *
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
351  *
352  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
353  */
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);
355
356 /**
357  * Requests for setting web database quota for origin.
358  *
359  * @param context context object
360  * @param origin database origin
361  * @param quota size of quota
362  *
363  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
364  */
365 EXPORT_API Eina_Bool ewk_context_web_database_quota_for_origin_set(Ewk_Context* context, Ewk_Security_Origin* origin, uint64_t quota);
366
367 /**
368  * Requests for getting web database usage for origin.
369  *
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
375  *
376  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
377  */
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);
379
380 /**
381  * Requests for deleting all web indexed databases.
382  *
383  * @param context context object
384  *
385  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
386  */
387 EXPORT_API Eina_Bool ewk_context_web_indexed_database_delete_all(Ewk_Context* context);
388 /**
389  * Deletes all web storage.
390  *
391  * @param context context object
392  *
393  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
394  */
395 EXPORT_API Eina_Bool ewk_context_web_storage_delete_all(Ewk_Context* context);
396
397 /**
398  * Deletes origin that is stored in web storage db.
399  *
400  * @param context context object
401  * @param origin origin of db
402  *
403  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
404  */
405 EXPORT_API Eina_Bool ewk_context_web_storage_origin_delete(Ewk_Context* context, Ewk_Security_Origin* origin);
406
407 /**
408  * Gets list of origins that is stored in web storage db.
409  *
410  * This function allocates memory for context structure made from callback and user_data.
411  *
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
416  *
417  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
418  *
419  * @See ewk_context_origins_free()
420  */
421 EXPORT_API Eina_Bool ewk_context_web_storage_origins_get(Ewk_Context* context, Ewk_Web_Storage_Origins_Get_Callback callback, void* user_data);
422 /**
423  * Gets usage of web storage for certain origin.
424  *
425  * This function allocates memory for context structure made from callback and user_data.
426  *
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
432  *
433  * @return @c EINA_TRUE on success, @c EINA_FALSE on failure
434  */
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);
436
437 /**
438  * Requests for setting soup data path(soup data include cookie and cache).
439  *
440  * @param context context object
441  * @param path soup data path to set
442  *
443  * @return @c EINA_TRUE on successful request or @c EINA_FALSE on failure
444  */
445 EXPORT_API Eina_Bool ewk_context_soup_data_directory_set(Ewk_Context* context, const char* path);
446
447 /**
448 * Requests to set the cache model
449 *
450 * @param context context object
451 * @param model cache model
452 *
453 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
454 */
455 EXPORT_API Eina_Bool ewk_context_cache_model_set(Ewk_Context* context, Ewk_Cache_Model model);
456
457 /**
458 * Returns the cache model type
459 *
460 * @param context context object
461 *
462 * @return Ewk_Cache_Model
463 */
464 EXPORT_API Ewk_Cache_Model ewk_context_cache_model_get(Ewk_Context* context);
465
466 /**
467 * Toggles the cache enable and disable
468 *
469 * @param context context object
470 * @param enable or disable cache
471 *
472 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
473 */
474 EXPORT_API Eina_Bool ewk_context_cache_disabled_set(Ewk_Context* ewkContext, Eina_Bool cacheDisabled);
475
476 /**
477 * Queries if the cache is enabled
478 *
479 * @param context context object
480 *
481 * @return @c EINA_TRUE is cache is enabled or @c EINA_FALSE otherwise
482 */
483 EXPORT_API Eina_Bool ewk_context_cache_disabled_get(const Ewk_Context* ewkContext);
484
485 /**
486  * Request to set certifcate file
487  *
488  * @param context context object
489  * @param certificate_file is path where certificate file is stored
490  *
491  * @return @c EINA_TRUE is cache is enabled or @c EINA_FALSE otherwise
492  */
493 EXPORT_API Eina_Bool ewk_context_certificate_file_set(Ewk_Context *context, const char *certificate_file);
494
495 /**
496 * Request to get certifcate file
497 *
498 * @param context context object
499 *
500 * @return @c certificate_file is path which is set during ewk_context_certificate_file_set or @c NULL otherwise
501 */
502 EXPORT_API const char* ewk_context_certificate_file_get(const Ewk_Context *context);
503
504 /**
505  * Requests to clear cache
506  *
507  * @param context context object
508  *
509  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
510  */
511 EXPORT_API Eina_Bool ewk_context_cache_clear(Ewk_Context* ewkContext);
512
513 /**
514  * Sets callback for started download.
515  *
516  * @param context context object
517  * @param callback callback for started download
518  * @param user_data user data
519  */
520 EXPORT_API void ewk_context_did_start_download_callback_set(Ewk_Context* context, Ewk_Context_Did_Start_Download_Callback callback, void* user_data);
521
522 /**
523  * Sets callback for overriding mime type
524  *
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
528  */
529 EXPORT_API void ewk_context_mime_override_callback_set(Ewk_Context* context, Ewk_Context_Override_Mime_For_Url_Callback callback, void* user_data);
530
531 /**
532  * Deprecated, this function dose nothing, it's left to allow legacy applications to work with current builds
533  * Starts memory sampler.
534  *
535  * @param context context object
536  * @param interval time gap to fire the timer
537  */
538 EINA_DEPRECATED EXPORT_API void ewk_context_memory_sampler_start(Ewk_Context* context, double timer_interval);
539
540 /**
541  * Deprecated, this function dose nothing, it's left to allow legacy applications to work with current builds
542  * Stops memory sampler.
543  *
544  * @param context context object
545  */
546 EINA_DEPRECATED EXPORT_API void ewk_context_memory_sampler_stop(Ewk_Context* context);
547
548 /**
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.
552  */
553 typedef void (*Ewk_Vibration_Client_Vibrate_Cb)(uint64_t vibration_time, void *user_data);
554
555 /**
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.
559  */
560 typedef void (*Ewk_Vibration_Client_Vibration_Cancel_Cb)(void *user_data);
561
562 /**
563  * Increases the reference count of the given object.
564  *
565  * @param context context object to increase the reference count
566  *
567  * @return Ewk_Context object on success or @c NULL on failure
568  */
569 EXPORT_API Ewk_Context *ewk_context_ref(Ewk_Context *context);
570
571 /**
572  * Decreases the reference count of the given object, possibly freeing it.
573  *
574  * When the reference count it's reached 0, the Ewk_Context is freed.
575  *
576  * @param context context object to decrease the reference count
577  */
578 EXPORT_API void ewk_context_unref(Ewk_Context *context);
579 /**
580  * Gets default Ewk_Context instance.
581  *
582  * The returned Ewk_Context object @b should not be unref'ed if application
583  * does not call ewk_context_ref() for that.
584  *
585  * @return Ewk_Context object.
586  */
587 EXPORT_API Ewk_Context *ewk_context_default_get(void);
588
589 /**
590  * Creates a new Ewk_Context.
591  *
592  * The returned Ewk_Context object @b should be unref'ed after use.
593  *
594  * @return Ewk_Context object on success or @c NULL on failure
595  *
596  * @see ewk_context_unref
597  * @see ewk_context_new_with_injected_bundle_path
598  */
599 EXPORT_API Ewk_Context *ewk_context_new(void);
600
601 /**
602  * Creates a new Ewk_Context.
603  *
604  * The returned Ewk_Context object @b should be unref'ed after use.
605  *
606  * Ewk view based on chromium engine does not support this API
607  * Avoid using this API
608  *
609  * @param path path of injected bundle library
610  *
611  * @return Ewk_Context object on success or @c NULL on failure
612  *
613  * @see ewk_context_unref
614  * @see ewk_context_new
615  */
616 EXPORT_API Ewk_Context *ewk_context_new_with_injected_bundle_path(const char *path);
617
618 /*
619  * Gets the cookie manager instance for this @a context.
620  *
621  * @param context context object to query.
622  *
623  * @return Ewk_Cookie_Manager object instance or @c NULL in case of failure.
624  */
625 EXPORT_API Ewk_Cookie_Manager *ewk_context_cookie_manager_get(const Ewk_Context *context);
626
627 /**
628  * Sets additional plugin directory.
629  *
630  * @param context context object
631  * @param path the directory to be set
632  *
633  * @return @c EINA_TRUE if the directory was set, @c EINA_FALSE otherwise
634  */
635 EXPORT_API Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context *context, const char *path);
636
637 /**
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.
640  *
641  * To stop listening for vibration events, you may call this function with @c
642  * NULL for the callbacks.
643  *
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).
650  */
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);
652
653 /**
654  * Sets memory saving mode.
655  *
656  * @param context context object
657  * @param enable or disable memory saving mode
658  *
659  */
660 EXPORT_API void ewk_context_memory_saving_mode_set(Ewk_Context *context, Eina_Bool mode);
661
662 struct Ewk_Password_Data {
663     char* url;
664     Eina_Bool useFingerprint;
665 };
666
667 /**
668  * Deletes whole password data from DB
669  *
670  * @param context context object
671  *
672  */
673 EXPORT_API void ewk_context_form_password_data_delete_all(Ewk_Context* context);
674
675 /**
676  * Deletes password data from DB for given URL
677  *
678  * The API will delete the a password data from DB.
679  *
680  * @param const char* with url
681  *
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
685  */
686 EXPORT_API void ewk_context_form_password_data_delete(Ewk_Context* context, const char* url);
687
688 /**
689  * Get all password url list
690  *
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
693  *
694  * @param Eina_List with Ewk_Password_Data
695  *
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
699  */
700 EXPORT_API Eina_List* ewk_context_form_password_data_list_get(Ewk_Context* context);
701
702 /**
703  * Deletes a given password data list
704  *
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
707  *
708  * @param Eina_List with Ewk_Password_Data
709  *
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
713  */
714 EXPORT_API void ewk_context_form_password_data_list_free(Ewk_Context* context, Eina_List* list);
715
716 /**
717  * Clear candidate data
718  *
719  * @param context context object
720  *
721  */
722 EXPORT_API void ewk_context_form_candidate_data_delete_all(Ewk_Context* context);
723
724 /**
725  * Sets callback for profiles change notification.
726  *
727  * @param callback pointer to callback function
728  * @param user_data user data returned on callback
729  *
730  */
731 EXPORT_API void ewk_context_form_autofill_profile_changed_callback_set(
732     Ewk_Context_Form_Autofill_Profile_Changed_Callback callback,
733     void* user_data);
734
735 /**
736  * Gets a list of all existing profiles
737  *
738  * The obtained profile must be deleted by ewk_autofill_profile_delete.
739  * @param context context object
740  *
741  * @return @c Eina_List of Ewk_Autofill_Profile @c NULL otherwise
742  * @see ewk_autofill_profile_delete
743  */
744 EXPORT_API Eina_List* ewk_context_form_autofill_profile_get_all(Ewk_Context* context);
745
746 /**
747  * Gets the existing profile for given index
748  *
749  * The obtained profile must be deleted by ewk_autofill_profile_delete.
750  *
751  * @param context context object
752  * @param profile id
753  *
754  * @return @c Ewk_Autofill_Profile if profile exists, @c NULL otherwise
755  * @see ewk_autofill_profile_delete
756  */
757 EXPORT_API Ewk_Autofill_Profile* ewk_context_form_autofill_profile_get(Ewk_Context* context, unsigned id);
758
759 /**
760  * Sets the given profile for the given id
761  *
762  * Data can be added to the created profile by ewk_autofill_profile_data_set.
763  *
764  * @param context context object
765  * @param profile id
766  * @param profile Ewk_Autofill_Profile
767  *
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
771  */
772 EXPORT_API Eina_Bool ewk_context_form_autofill_profile_set(Ewk_Context* context, unsigned id, Ewk_Autofill_Profile* profile);
773
774 /**
775  * Saves the created profile into permenant storage
776  *
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.
779  *
780  * @param context context object
781  * @param profile Ewk_Autofill_Profile
782  *
783  * @return @c EINA_TRUE if the profile data is saved successfully, @c EINA_FALSE otherwise
784  * @see ewk_autofill_profile_new
785  */
786 EXPORT_API Eina_Bool ewk_context_form_autofill_profile_add(Ewk_Context* context, Ewk_Autofill_Profile* profile);
787
788 /**
789  * Removes Autofill Form profile completely
790  *
791  * @param context context object
792  * @param index profile id
793  *
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
796  */
797 EXPORT_API Eina_Bool ewk_context_form_autofill_profile_remove(Ewk_Context* context, unsigned id);
798
799 /**
800  * Get tizen extensible api enable state
801  *
802  * @param context context object
803  * @param extensible_api extensible API name of every kind
804  *
805  * @return @c EINA_TRUE if the extensibleAPI set as true or @c EINA_FALSE otherwise
806  */
807 EXPORT_API Eina_Bool ewk_context_tizen_extensible_api_string_get(Ewk_Context* context,  const char* extensible_api);
808
809 /**
810  * Toggles tizen extensible api enable and disable
811  *
812  * @param context context object
813  * @param extensible_api extensible API name of every kind
814  * @param enable enable or disable tizen extensible api
815  *
816  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
817  */
818 EXPORT_API Eina_Bool ewk_context_tizen_extensible_api_string_set(Ewk_Context *context,  const char *extensible_api, Eina_Bool enable);
819
820 /**
821  * Toggles tizen extensible api enable and disable
822  *
823  * @param context context object
824  * @param extensibleAPI extensible API of every kind
825  * @param enable enable or disable tizen extensible api
826  *
827  * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
828  */
829 EXPORT_API Eina_Bool ewk_context_tizen_extensible_api_set(Ewk_Context *context, Ewk_Extensible_API extensible_api, Eina_Bool enable);
830
831 /**
832  * Get tizen extensible api enable state
833  *
834  * @param context context object
835  * @param extensibleAPI extensible API of every kind
836  *  *
837  * @return @c EINA_TRUE if the extensibleAPI set as true or @c EINA_FALSE otherwise
838  */
839 EXPORT_API Eina_Bool ewk_context_tizen_extensible_api_get(Ewk_Context *ewkContext, Ewk_Extensible_API extensibleAPI);
840
841 /**
842  * Reset storage path such as web storage, web database, application cache and so on
843  *
844  * @param context context object
845  *
846  */
847 EXPORT_API void ewk_context_storage_path_reset(Ewk_Context* ewkContext);
848
849 /**
850  * Sets the given id for the pixmap
851  *
852  * @param context context object
853  * @param pixmap id
854  *
855  * @return @c EINA_TRUE if the pixmap set successfully, @c EINA_FALSE otherwise
856  */
857 EXPORT_API Eina_Bool ewk_context_pixmap_set(Ewk_Context* context, int pixmap);
858
859 /**
860  * Start the inspector server
861  *
862  * @param context context object
863  * @param port number
864  *
865  * @return @c return the port number
866  */
867 EXPORT_API unsigned int ewk_context_inspector_server_start(Ewk_Context* context, unsigned int port);
868
869 /**
870  * Stop the inspector server
871  *
872  * @param context context object
873   *
874  * @return @c EINA_TRUE if the inspector server stop set successfully, @c EINA_FALSE otherwise
875  */
876 EXPORT_API Eina_Bool ewk_context_inspector_server_stop(Ewk_Context* context);
877
878
879 ///------- belows are extension of chromium-ewk ---------------------------
880
881 /**
882  * Gets the id for the pixmap
883  *
884  * @param context context object
885  *
886  * @return @c id for the pixmap. On error default return is 0.
887  */
888 EXPORT_API int ewk_context_pixmap_get(Ewk_Context *context);
889
890 EXPORT_API void ewk_send_widget_info(Ewk_Context *context, const char* tizen_id, double scale, const char *theme, const char *encodedBundle);
891
892 /**
893  * Gets the application cache manager instance for this @a context.
894  *
895  * @param context context object to query.
896  *
897  * @return Ewk_Cookie_Manager object instance or @c NULL in case of failure.
898  */
899 EXPORT_API Ewk_Application_Cache_Manager *ewk_context_application_cache_manager_get(const Ewk_Context *context);
900
901 /**
902  * Gets the favicon database instance for this @a context.
903  *
904  * @param context context object to query.
905  *
906  * @return Ewk_Favicon_Database object instance or @c NULL in case of failure.
907  */
908 EXPORT_API Ewk_Favicon_Database *ewk_context_favicon_database_get(const Ewk_Context *context);
909
910 /**
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.
913  *
914  * @param context context object to clear all resource caches
915  */
916 EXPORT_API void ewk_context_resource_cache_clear(Ewk_Context *context);
917
918 /**
919  * Sets the favicon database directory for this @a context.
920  *
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.
924  *
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.
929  *
930  * @param context context object to update
931  * @param directory_path database directory path to set
932  *
933  * @return @c EINA_TRUE if successful, @c EINA_FALSE otherwise
934  */
935 EXPORT_API Eina_Bool ewk_context_favicon_database_directory_set(Ewk_Context *context, const char *directory_path);
936
937 /**
938  * Sets the list of preferred languages.
939  *
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.
943  *
944  * @param languages the list of preferred languages (char* as data) or @c NULL
945  *
946  * @note all contexts will be affected.
947  */
948 EXPORT_API void ewk_context_preferred_languages_set(Eina_List *languages);
949
950 /**
951  * Gets the storage manager instance for this @a context.
952  *
953  * @param context context object to query.
954  *
955  * @return Ewk_Storage_Manager object instance or @c NULL in case of failure.
956  */
957 EXPORT_API Ewk_Storage_Manager *ewk_context_storage_manager_get(const Ewk_Context *context);
958
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);
962
963 EXPORT_API Eina_Bool ewk_context_notification_callbacks_reset(Ewk_Context* context);
964
965 #ifdef __cplusplus
966 }
967 #endif
968
969 #endif // ewk_context_h