tizen beta release
[profile/ivi/webkit-efl.git] / Source / WebKit / efl / ewk / ewk_main.h
1 /*
2     Copyright (C) 2009-2010 ProFUSION embedded systems
3     Copyright (C) 2009-2010 Samsung Electronics
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Library General Public
7     License as published by the Free Software Foundation; either
8     version 2 of the License, or (at your option) any later version.
9
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13     Library General Public License for more details.
14
15     You should have received a copy of the GNU Library General Public License
16     along with this library; see the file COPYING.LIB.  If not, write to
17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18     Boston, MA 02110-1301, USA.
19 */
20
21 /**
22  * @file    ewk_main.h
23  * @brief   Collection of EWebkit entry API.
24  */
25
26 #ifndef ewk_main_h
27 #define ewk_main_h
28
29 #include <Eina.h>
30
31 //#include <EWebKit.h>
32 #include <Evas.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /**
39  * Initializes webkit's instance.
40  *
41  * - initializes components needed by Efl,
42  * - sets web database location,
43  * - sets page cache capacity,
44  * - increases a reference count of webkit's instance.
45  *
46  * @return a reference count of webkit's instance on success or 0 on failure
47  */
48 EAPI int ewk_init(void);
49
50 /**
51  * Decreases a reference count of webkit's instance, possibly destroying it.
52  *
53  * If the reference count reaches 0 webkit's instance is destroyed.
54  *
55  * @return a reference count of webkit's instance
56  */
57 EAPI int ewk_shutdown(void);
58
59 /* #if ENABLE(TIZEN_NETWORK_SIGNAL) */
60 /**
61  * callback function for receiving network events
62  * @param signal kind of network event, in case of DNET it is of type NetEvent_t
63  * @param device information about device which send network event, in case of DNET it is of type NetProfileType_t
64  *               if device value is -1, it means that we failed with reading device information 
65  */
66 typedef void (*ewk_network_signal_callback)(int signal, int device);
67
68 /**
69  * Allows to set callback function to receive network events.
70  */
71 EAPI void ewk_set_network_signal_callback(ewk_network_signal_callback callback, const void* data);
72 /* #endif TIZEN_NETWORK_SIGNAL*/
73
74 /* #if ENABLE(TIZEN_CERTIFICATE_HANDLING) */
75
76 typedef Eina_Bool (*ewk_certificate_confirmation_callback)(Eina_Bool isTrusted, const char* uri, char* certificate, int errors);
77
78 EAPI void ewk_set_certificate_confirmation_callback(ewk_certificate_confirmation_callback);
79
80 /**
81  * Sets crt file basing on this file certificate validation will be done
82  * @file crt file containing one or more trusted certificates, 
83  * e.g /usr/lib/ssl/certs/ca-certificates.crt
84  */
85 EAPI void ewk_set_certificate_file(const char* file);
86 /* #endif TIZEN_CERTIFICATE_HANDLING */
87
88 /**
89  * Verifies if the specified text encoding is supported by WebKit
90  * 
91  * @return EINA_TRUE if the specified encoding is valid, EINA_FALSE otherwise.
92  */
93 /* if ENABLE(TIZEN_TEXT_ENCODING) */
94 EAPI Eina_Bool ewk_text_encoding_is_valid(const char* name);
95 /* #endif */
96
97 /* #if ENABLE(TIZEN_PASTEBOARD_TEXT) */
98 EAPI void ewk_general_pasteboard_data_set(const char *data);
99 EAPI const char *ewk_general_pasteboard_data_get(void);
100 /* #endif */
101
102 #ifdef __cplusplus
103 }
104 #endif
105 #endif // ewk_main_h