Create string tightly when retrive string from cbhm callback event
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_custom_handlers.h
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 library 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 library; 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
20 /**
21  * @file    ewk_custom_handlers.h
22  * @brief   Custom scheme and content handlers. (http://www.w3.org/TR/html5/timers.html#custom-handlers)
23  */
24
25 #ifndef ewk_custom_handlers_h
26 #define ewk_custom_handlers_h
27
28 #include <Eina.h>
29 #include <Evas.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 typedef struct _Ewk_Custom_Handlers_Data Ewk_Custom_Handlers_Data;
36
37 /// Defines the handler states.
38 enum _Ewk_Custom_Handlers_State {
39     /// Indicates that no attempt has been made to register the given handler.
40     EWK_CUSTOM_HANDLERS_NEW,
41     /// Indicates that the given handler has been registered or that the site is blocked from registering the handler.
42     EWK_CUSTOM_HANDLERS_REGISTERED,
43     /// Indicates that the given handler has been offered but was rejected.
44     EWK_CUSTOM_HANDLERS_DECLINED
45 };
46
47 /// Creates a type name for @a _Ewk_Custom_Handlers_State.
48 typedef enum _Ewk_Custom_Handlers_State Ewk_Custom_Handlers_State;
49
50 /**
51  * Get target(scheme or mime type) of custom handlers.
52  *
53  * @param data custom handlers's structure.
54  *
55  * @return @c target (scheme or mime type).
56  */
57 EAPI const char* ewk_custom_handlers_data_target_get(Ewk_Custom_Handlers_Data* data);
58
59 /**
60  * Get base url of custom handlers.
61  *
62  * @param data custom handlers's structure.
63  *
64  * @return @c base url.
65  */
66 EAPI const char* ewk_custom_handlers_data_base_url_get(Ewk_Custom_Handlers_Data* data);
67
68 /**
69  * Get url of custom handlers.
70  *
71  * @param data custom handlers's structure.
72  *
73  * @return @c url.
74  */
75 EAPI const char* ewk_custom_handlers_data_url_get(Ewk_Custom_Handlers_Data* data);
76
77 /**
78  * Get title of custom handlers.
79  *
80  * @param data custom handlers's structure.
81  *
82  * @return @c title.
83  */
84 EAPI const char* ewk_custom_handlers_data_title_get(Ewk_Custom_Handlers_Data* data);
85
86 /**
87  * Set result of isProtocolRegistered API.
88  *
89  * @param data custom handlers's structure
90  * @param result(Ewk_Custom_Handlers_State) of isProtocolRegistered and isContentRegistered API
91  */
92 EAPI void ewk_custom_handlers_data_result_set(Ewk_Custom_Handlers_Data* data, Ewk_Custom_Handlers_State result);
93 #ifdef __cplusplus
94 }
95 #endif
96 #endif // ewk_custom_handlers_h