2 Copyright (C) 2012 Samsung Electronics
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.
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.
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.
20 #ifndef ewk_policy_decision_h
21 #define ewk_policy_decision_h
23 #include "ewk_frame.h"
31 * \enum Ewk_Policy_Decision_Type
32 * @brief Provides option to policy decision type.
34 enum _Ewk_Policy_Decision_Type {
35 EWK_POLICY_DECISION_USE,
36 EWK_POLICY_DECISION_DOWNLOAD,
37 EWK_POLICY_DECISION_IGNORE
39 typedef enum _Ewk_Policy_Decision_Type Ewk_Policy_Decision_Type;
41 typedef struct _Ewk_Policy_Decision Ewk_Policy_Decision;
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
51 typedef enum _Ewk_Policy_Navigation_Type Ewk_Policy_Navigation_Type;
54 * Returns cookie from Policy Decision object.
56 * @param policy_decision policy decsision object
58 * @return @c cookie string on success or empty string on failure
60 EAPI const char* ewk_policy_decision_cookie_get(Ewk_Policy_Decision* policy_decision);
63 * Returns url from Policy Decision object.
65 * @param policy_decision policy decsision object
67 * @return @c url string on success or empty string on failure
69 EAPI const char* ewk_policy_decision_url_get(Ewk_Policy_Decision* policy_decision);
72 * Returns scheme from Policy Decision object.
74 * @param policy_decision policy decsision object
76 * @return @c scheme string on success or empty string on failure
78 EAPI const char* ewk_policy_decision_scheme_get(Ewk_Policy_Decision* policy_decision);
81 * Returns host from Policy Decision object.
83 * @param policy_decision policy decsision object
85 * @return @c host string on success or empty string on failure
87 EAPI const char* ewk_policy_decision_host_get(Ewk_Policy_Decision* policy_decision);
90 * Returns mimetype for response data from Policy Decision object.
92 * @param policy_decision policy decsision object
94 * @return @c mimetype string on success or empty string on failure
96 EAPI const char* ewk_policy_decision_response_mime_get(Ewk_Policy_Decision* policy_decision);
99 * Returns http headers for response data from Policy Decision object.
101 * @param policy_decision policy decsision object
103 * @return @c http headers on success or NULL on failure
105 EAPI const Eina_Hash* ewk_policy_decision_response_headers_get(Ewk_Policy_Decision* policy_decision);
107 /*#if ENABLE(TIZEN_ON_REDIRECTION_REQUESTED)*/
109 * Returns http status code from Policy Decision object.
111 * @param policy_decision policy decsision object
113 * @return @c http status code number
115 EAPI int ewk_policy_decision_response_status_code_get(Ewk_Policy_Decision* policyDecision);
119 * Returns policy type from Policy Decision object.
121 * @param policy_decision policy decsision object
123 * @return @c policy type
125 EAPI Ewk_Policy_Decision_Type ewk_policy_decision_type_get(const Ewk_Policy_Decision* policy_decision);
128 * Suspend the operation for policy decision.
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.
133 * @param policy_decision policy decsision object
135 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
137 EAPI Eina_Bool ewk_policy_decision_suspend(Ewk_Policy_Decision* policy_decision);
140 * Accept the action which triggers this decision.
142 * @param policy_decision policy decsision object
144 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
146 EAPI Eina_Bool ewk_policy_decision_use(Ewk_Policy_Decision* policy_decision);
149 * Ignore the action which triggers this decision.
151 * @param policy_decision policy decsision object
153 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
155 EAPI Eina_Bool ewk_policy_decision_ignore(Ewk_Policy_Decision* policy_decision);
158 * Cause a download from this decision.
160 * @param policy_decision policy decsision object
162 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
164 EAPI Eina_Bool ewk_policy_decision_download(Ewk_Policy_Decision* policy_decision);
167 * Returns navigation type from Policy Decision object.
169 * @param policy_decision policy decsision object
171 * @return @c navigation type
173 EAPI Ewk_Policy_Navigation_Type ewk_policy_decision_navigation_type_get(Ewk_Policy_Decision* policy_decision);
176 * Gets the frame reference from Policy Decision object.
178 * @param policy_decision policy decsision object
180 * @return frame reference on success, or NULL on failure
182 EAPI Ewk_Frame_Ref ewk_policy_decision_frame_get(Ewk_Policy_Decision* policy_decision);
187 #endif // ewk_policy_decision_h