Create string tightly when retrive string from cbhm callback event
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_policy_decision.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 #ifndef ewk_policy_decision_h
21 #define ewk_policy_decision_h
22
23 #include "ewk_frame.h"
24 #include <Eina.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 /**
31  * \enum   Ewk_Policy_Decision_Type
32  * @brief   Provides option to policy decision type.
33  */
34 enum _Ewk_Policy_Decision_Type {
35     EWK_POLICY_DECISION_USE,
36     EWK_POLICY_DECISION_DOWNLOAD,
37     EWK_POLICY_DECISION_IGNORE
38 };
39 typedef enum _Ewk_Policy_Decision_Type Ewk_Policy_Decision_Type;
40
41 typedef struct _Ewk_Policy_Decision Ewk_Policy_Decision;
42
43 enum _Ewk_Policy_Navigation_Type {
44     EWK_POLICY_NAVIGATION_TYPE_LINK_CLICKED = 0,
45     EWK_POLICY_NAVIGATION_TYPE_FORM_SUBMITTED = 1,
46     EWK_POLICY_NAVIGATION_TYPE_BACK_FORWARD = 2,
47     EWK_POLICY_NAVIGATION_TYPE_RELOAD = 3,
48     EWK_POLICY_NAVIGATION_TYPE_FORM_RESUBMITTED = 4,
49     EWK_POLICY_NAVIGATION_TYPE_OTHER = 5
50 };
51 typedef enum _Ewk_Policy_Navigation_Type Ewk_Policy_Navigation_Type;
52
53 /**
54  * Returns cookie from Policy Decision object.
55  *
56  * @param policy_decision policy decsision object
57  *
58  * @return @c cookie string on success or empty string on failure
59  */
60 EAPI const char* ewk_policy_decision_cookie_get(Ewk_Policy_Decision* policy_decision);
61
62 /**
63  * Returns url from Policy Decision object.
64  *
65  * @param policy_decision policy decsision object
66  *
67  * @return @c url string on success or empty string on failure
68  */
69 EAPI const char* ewk_policy_decision_url_get(Ewk_Policy_Decision* policy_decision);
70
71 /**
72  * Returns scheme from Policy Decision object.
73  *
74  * @param policy_decision policy decsision object
75  *
76  * @return @c scheme string on success or empty string on failure
77  */
78 EAPI const char* ewk_policy_decision_scheme_get(Ewk_Policy_Decision* policy_decision);
79
80 /**
81  * Returns host from Policy Decision object.
82  *
83  * @param policy_decision policy decsision object
84  *
85  * @return @c host string on success or empty string on failure
86  */
87 EAPI const char* ewk_policy_decision_host_get(Ewk_Policy_Decision* policy_decision);
88
89 /**
90  * Returns mimetype for response data from Policy Decision object.
91  *
92  * @param policy_decision policy decsision object
93  *
94  * @return @c mimetype string on success or empty string on failure
95  */
96 EAPI const char* ewk_policy_decision_response_mime_get(Ewk_Policy_Decision* policy_decision);
97
98 /**
99  * Returns http headers for response data from Policy Decision object.
100  *
101  * @param policy_decision policy decsision object
102  *
103  * @return @c http headers on success or NULL on failure
104  */
105 EAPI const Eina_Hash* ewk_policy_decision_response_headers_get(Ewk_Policy_Decision* policy_decision);
106
107 /*#if ENABLE(TIZEN_ON_REDIRECTION_REQUESTED)*/
108 /**
109  * Returns http status code from Policy Decision object.
110  *
111  * @param policy_decision policy decsision object
112  *
113  * @return @c http status code number
114  */
115 EAPI int ewk_policy_decision_response_status_code_get(Ewk_Policy_Decision* policyDecision);
116 /*#endif*/
117
118 /**
119  * Returns policy type from Policy Decision object.
120  *
121  * @param policy_decision policy decsision object
122  *
123  * @return @c policy type
124  */
125 EAPI Ewk_Policy_Decision_Type ewk_policy_decision_type_get(const Ewk_Policy_Decision* policy_decision);
126
127 /**
128  * Suspend the operation for policy decision.
129  *
130  * This suspends the operation for policy decision when the signal for policy is emitted.
131  * This is very usefull to decide the policy from the additional UI operation like the popup.
132  *
133  * @param policy_decision policy decsision object
134  *
135  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
136  */
137 EAPI Eina_Bool ewk_policy_decision_suspend(Ewk_Policy_Decision* policy_decision);
138
139 /**
140  * Accept the action which triggers this decision.
141  *
142  * @param policy_decision policy decsision object
143  *
144  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
145  */
146 EAPI Eina_Bool ewk_policy_decision_use(Ewk_Policy_Decision* policy_decision);
147
148 /**
149  * Ignore the action which triggers this decision.
150  *
151  * @param policy_decision policy decsision object
152  *
153  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
154  */
155 EAPI Eina_Bool ewk_policy_decision_ignore(Ewk_Policy_Decision* policy_decision);
156
157 /**
158  * Cause a download from this decision.
159  *
160  * @param policy_decision policy decsision object
161  *
162  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
163  */
164 EAPI Eina_Bool ewk_policy_decision_download(Ewk_Policy_Decision* policy_decision);
165
166 /**
167  * Returns navigation type from Policy Decision object.
168  *
169  * @param policy_decision policy decsision object
170  *
171  * @return @c navigation type
172  */
173 EAPI Ewk_Policy_Navigation_Type ewk_policy_decision_navigation_type_get(Ewk_Policy_Decision* policy_decision);
174
175 /**
176  * Gets the frame reference from Policy Decision object.
177  *
178  * @param policy_decision policy decsision object
179  *
180  * @return frame reference on success, or NULL on failure
181  */
182 EAPI Ewk_Frame_Ref ewk_policy_decision_frame_get(Ewk_Policy_Decision* policy_decision);
183
184 #ifdef __cplusplus
185 }
186 #endif
187 #endif // ewk_policy_decision_h