EWebKit  1.0
ewk_context.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Samsung Electronics
3  *
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.
8  *
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.
13  *
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.
18  */
19 
37 #ifndef ewk_context_h
38 #define ewk_context_h
39 
41 #include "ewk_cookie_manager.h"
42 #include "ewk_database_manager.h"
43 #include "ewk_download_job.h"
44 #include "ewk_error.h"
45 #include "ewk_favicon_database.h"
46 #include "ewk_navigation_data.h"
47 #include "ewk_storage_manager.h"
48 #include "ewk_url_scheme_request.h"
49 #include <Evas.h>
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
57 
64 };
65 
71 #ifdef __cplusplus
72 typedef class EwkObject Ewk_Context;
73 #else
74 typedef struct EwkObject Ewk_Context;
75 #endif
76 
89 };
90 
93 
100  EWK_TLS_ERROR_POLICY_FAIL, // Fail on TLS errors.
101  EWK_TLS_ERROR_POLICY_IGNORE // Ignore TLS errors.
102 };
103 
104 // Creates a type name for the Ewk_TLS_Error_Policy.
106 
111 typedef void (*Ewk_Url_Scheme_Request_Cb) (Ewk_Url_Scheme_Request *request, void *user_data);
112 
117 typedef void (*Ewk_History_Navigation_Cb)(const Evas_Object *view, Ewk_Navigation_Data *navigation_data, void *user_data);
118 
123 typedef void (*Ewk_History_Client_Redirection_Cb)(const Evas_Object *view, const char *source_url, const char *destination_url, void *user_data);
124 
129 typedef void (*Ewk_History_Server_Redirection_Cb)(const Evas_Object *view, const char *source_url, const char *destination_url, void *user_data);
130 
135 typedef void (*Ewk_History_Title_Update_Cb)(const Evas_Object *view, const char *title, const char *url, void *user_data);
136 
141 typedef void (*Ewk_Download_Requested_Cb)(Ewk_Download_Job *download, void *user_data);
142 
147 typedef void (*Ewk_Download_Failed_Cb)(Ewk_Download_Job_Error *error, void *user_data);
148 
153 typedef void (*Ewk_Download_Cancelled_Cb)(Ewk_Download_Job *download, void *user_data);
154 
159 typedef void (*Ewk_Download_Finished_Cb)(Ewk_Download_Job *download, void *user_data);
160 
167 typedef void (*Ewk_History_Populate_Visited_Links_Cb)(void *user_data);
168 
179 typedef void (*Ewk_Context_Message_From_Extension_Cb)(const char *name, const Eina_Value *body, void *user_data);
180 
190 
201 EAPI Ewk_Context *ewk_context_new(void);
202 
218 EAPI Ewk_Context *ewk_context_new_with_extensions_path(const char *path);
219 
228 
237 
246 
264 EAPI Eina_Bool ewk_context_favicon_database_directory_set(Ewk_Context *context, const char *directory_path);
265 
274 
283 
324 EAPI Eina_Bool ewk_context_url_scheme_register(Ewk_Context *context, const char *scheme, Ewk_Url_Scheme_Request_Cb callback, void *user_data);
325 
342  Ewk_History_Navigation_Cb navigate_func,
343  Ewk_History_Client_Redirection_Cb client_redirect_func,
344  Ewk_History_Server_Redirection_Cb server_redirect_func,
345  Ewk_History_Title_Update_Cb title_update_func,
346  Ewk_History_Populate_Visited_Links_Cb populate_visited_links_func,
347  void *data);
348 
363  Ewk_Download_Requested_Cb download_requested_func,
364  Ewk_Download_Failed_Cb download_failed_func,
365  Ewk_Download_Cancelled_Cb download_cancelled_func,
366  Ewk_Download_Finished_Cb download_finished_func,
367  void* data);
368 
379 EAPI void ewk_context_visited_link_add(Ewk_Context *context, const char *visited_url);
380 
391 EAPI Eina_Bool ewk_context_cache_model_set(Ewk_Context *context, Ewk_Cache_Model cache_model);
392 
400 EAPI Ewk_Cache_Model ewk_context_cache_model_get(const Ewk_Context *context);
401 
410 EAPI Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context *context, const char *path);
411 
419 
433 EAPI Eina_Bool ewk_context_message_post_to_extensions(Ewk_Context *context, const char *name, const Eina_Value *body);
434 
445 
453 EAPI Ewk_TLS_Error_Policy ewk_context_tls_error_policy_get(const Ewk_Context *context);
454 
463 EAPI void ewk_context_tls_error_policy_set(Ewk_Context *context, Ewk_TLS_Error_Policy tls_error_policy);
464 
476 EAPI void ewk_context_preferred_languages_set(Eina_List *languages);
477 
478 
486 EAPI void ewk_context_tls_certificate_for_host_allow(Ewk_Context *context, const char *pem, const char *host);
487 
497 EAPI Eina_Bool ewk_context_web_process_count_limit_set(Ewk_Context *context, unsigned count);
498 
506 EAPI unsigned ewk_context_web_process_count_limit_get(const Ewk_Context *context);
507 
508 #ifdef __cplusplus
509 }
510 #endif
511 
512 #endif // ewk_context_h
EAPI Eina_Bool ewk_context_additional_plugin_path_set(Ewk_Context *context, const char *path)
Definition: ewk_context.cpp:497
void(* Ewk_Download_Requested_Cb)(Ewk_Download_Job *download, void *user_data)
Type definition for a function that will be called back when new download job is requested.
Definition: ewk_context.h:141
EAPI Ewk_Favicon_Database * ewk_context_favicon_database_get(const Ewk_Context *context)
Definition: ewk_context.cpp:327
Definition: ewk_database_manager_private.h:38
EAPI void ewk_context_download_callbacks_set(Ewk_Context *context, Ewk_Download_Requested_Cb download_requested_func, Ewk_Download_Failed_Cb download_failed_func, Ewk_Download_Cancelled_Cb download_cancelled_func, Ewk_Download_Finished_Cb download_finished_func, void *data)
Definition: ewk_context.cpp:466
Ewk_TLS_Error_Policy
Contains option for TLS error policy.
Definition: ewk_context.h:99
Structure containing details about a download failure.
Definition: ewk_context.h:61
Describes the Ewk Application Cache Manager API.
EAPI Ewk_TLS_Error_Policy ewk_context_tls_error_policy_get(const Ewk_Context *context)
Definition: ewk_context.cpp:546
EAPI Eina_Bool ewk_context_url_scheme_register(Ewk_Context *context, const char *scheme, Ewk_Url_Scheme_Request_Cb callback, void *user_data)
Definition: ewk_context.cpp:448
Describes the Ewk navigation data API.
EAPI Eina_Bool ewk_context_web_process_count_limit_set(Ewk_Context *context, unsigned count)
Definition: ewk_context.cpp:580
void(* Ewk_Download_Cancelled_Cb)(Ewk_Download_Job *download, void *user_data)
Type definition for a function that will be called back when a download job is cancelled.
Definition: ewk_context.h:153
Ewk_Error * error
Definition: ewk_context.h:63
EAPI Ewk_Context * ewk_context_new(void)
Definition: ewk_context.cpp:436
void(* Ewk_History_Client_Redirection_Cb)(const Evas_Object *view, const char *source_url, const char *destination_url, void *user_data)
Type definition for a function that will be called back when view performed a client redirect...
Definition: ewk_context.h:123
void(* Ewk_History_Navigation_Cb)(const Evas_Object *view, Ewk_Navigation_Data *navigation_data, void *user_data)
Type definition for a function that will be called back when view did navigation (loaded new URL)...
Definition: ewk_context.h:117
EAPI Eina_Bool ewk_context_message_post_to_extensions(Ewk_Context *context, const char *name, const Eina_Value *body)
Definition: ewk_context.cpp:519
EAPI unsigned ewk_context_web_process_count_limit_get(const Ewk_Context *context)
Definition: ewk_context.cpp:588
void(* Ewk_History_Server_Redirection_Cb)(const Evas_Object *view, const char *source_url, const char *destination_url, void *user_data)
Type definition for a function that will be called back when view performed a server redirect...
Definition: ewk_context.h:129
Definition: ewk_object_private.h:31
void(* Ewk_History_Title_Update_Cb)(const Evas_Object *view, const char *title, const char *url, void *user_data)
Type definition for a function that will be called back when history title is updated.
Definition: ewk_context.h:135
EAPI Ewk_Cookie_Manager * ewk_context_cookie_manager_get(const Ewk_Context *context)
Definition: ewk_context.cpp:306
Use the biggest cache capacity.
Definition: ewk_context.h:88
Definition: ewk_favicon_database_private.h:51
EAPI void ewk_context_tls_certificate_for_host_allow(Ewk_Context *context, const char *pem, const char *host)
Definition: ewk_context.cpp:573
Use bigger cache capacity than EWK_CACHE_MODEL_DOCUMENT_VIEWER.
Definition: ewk_context.h:86
Describes the Ewk Storage Manager API.
EAPI Ewk_Context * ewk_context_new_with_extensions_path(const char *path)
Definition: ewk_context.cpp:441
void(* Ewk_Download_Failed_Cb)(Ewk_Download_Job_Error *error, void *user_data)
Type definition for a function that will be called back when a download job has failed.
Definition: ewk_context.h:147
EAPI Eina_Bool ewk_context_cache_model_set(Ewk_Context *context, Ewk_Cache_Model cache_model)
Definition: ewk_context.cpp:481
EAPI void ewk_context_tls_error_policy_set(Ewk_Context *context, Ewk_TLS_Error_Policy tls_error_policy)
Definition: ewk_context.cpp:553
EAPI Ewk_Application_Cache_Manager * ewk_context_application_cache_manager_get(const Ewk_Context *context)
Definition: ewk_context.cpp:299
Describes the Ewk URL scheme request API.
Definition: ewk_storage_manager_private.h:36
Definition: ewk_application_cache_manager_private.h:33
EAPI Eina_Bool ewk_context_favicon_database_directory_set(Ewk_Context *context, const char *directory_path)
Definition: ewk_context.cpp:320
EAPI Ewk_Cache_Model ewk_context_cache_model_get(const Ewk_Context *context)
Definition: ewk_context.cpp:490
void(* Ewk_Context_Message_From_Extension_Cb)(const char *name, const Eina_Value *body, void *user_data)
Definition: ewk_context.h:179
Ewk_Cache_Model
Contains option for cache model.
Definition: ewk_context.h:82
EAPI Ewk_Database_Manager * ewk_context_database_manager_get(const Ewk_Context *context)
Definition: ewk_context.cpp:313
Definition: ewk_error_private.h:33
EAPI void ewk_context_preferred_languages_set(Eina_List *languages)
Definition: ewk_context.cpp:559
Describes the Ewk Favicon Database API.
Describes the Ewk Database Manager API.
Ewk_Download_Job * download_job
Definition: ewk_context.h:62
EAPI void ewk_context_visited_link_add(Ewk_Context *context, const char *visited_url)
Definition: ewk_context.cpp:473
EAPI Ewk_Storage_Manager * ewk_context_storage_manager_get(const Ewk_Context *context)
Definition: ewk_context.cpp:334
void(* Ewk_Download_Finished_Cb)(Ewk_Download_Job *download, void *user_data)
Type definition for a function that will be called back when a download job is finished.
Definition: ewk_context.h:159
Use the smallest cache capacity.
Definition: ewk_context.h:84
Describes the Download Job API.
Describes the Web Error API.
void(* Ewk_Url_Scheme_Request_Cb)(Ewk_Url_Scheme_Request *request, void *user_data)
Callback type for use with ewk_context_url_scheme_register().
Definition: ewk_context.h:111
EAPI void ewk_context_message_from_extensions_callback_set(Ewk_Context *context, Ewk_Context_Message_From_Extension_Cb callback, void *user_data)
Definition: ewk_context.cpp:539
EAPI void ewk_context_history_callbacks_set(Ewk_Context *context, Ewk_History_Navigation_Cb navigate_func, Ewk_History_Client_Redirection_Cb client_redirect_func, Ewk_History_Server_Redirection_Cb server_redirect_func, Ewk_History_Title_Update_Cb title_update_func, Ewk_History_Populate_Visited_Links_Cb populate_visited_links_func, void *data)
Definition: ewk_context.cpp:459
EAPI void ewk_context_resource_cache_clear(Ewk_Context *context)
Definition: ewk_context.cpp:512
EAPI Ewk_Context * ewk_context_default_get(void)
Definition: ewk_context.cpp:431