1 #ifndef DALI_WEB_ENGINE_POLICY_DECISION_H
2 #define DALI_WEB_ENGINE_POLICY_DECISION_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
29 * @brief A class WebBackForwardList for back forward list of web engine.
31 class WebEnginePolicyDecision
35 * @brief Enumeration that provides an option to policy decision types.
37 enum class DecisionType
40 DOWNLOAD, ///< Download.
45 * @brief Enumeration that provides an option to policy navigation types.
47 enum class NavigationType
49 LINK_CLICKED, ///< Link clicked.
50 FORM_SUBMITTED, ///< Form submitted.
51 BACK_FORWARD, ///< Back forward.
53 FORM_RESUBMITTED, ///< Form resubmitted.
60 WebEnginePolicyDecision() = default;
65 virtual ~WebEnginePolicyDecision() = default;
68 * @brief Returns the url that request policy decision.
69 * @return The url that request policy decision
71 virtual std::string GetUrl() const = 0;
74 * @brief Returns a cookie that web page has.
75 * @return The cookie string if successfully
77 virtual std::string GetCookie() const = 0;
80 * @brief Returns a decision type.
81 * @return The decision type
83 virtual DecisionType GetDecisionType() const = 0;
86 * @brief Returns a MIME type for response data.
87 * @return The MIME type string
89 virtual std::string GetResponseMime() const = 0;
92 * @brief Returns an HTTP status code.
93 * @return The HTTP status code number
95 virtual int32_t GetResponseStatusCode() const = 0;
98 * @brief Returns a navigation type.
99 * @return The navigation type
101 virtual NavigationType GetNavigationType() const = 0;
105 * @return The frame of policy decision
107 virtual WebEngineFrame& GetFrame() const = 0;
110 * @brief Gets a scheme from the Policy Decision.
111 * @return The scheme if succeeded, empty otherwise
113 virtual std::string GetScheme() const = 0;
116 * @brief Accepts the action which triggers this decision.
117 * @return True if successfully, false otherwise
119 virtual bool Use() = 0;
122 * @brief Ignores the action which triggers this decision.
123 * @return True if successfully, false otherwise
125 virtual bool Ignore() = 0;
128 * @brief Suspend the operation for policy decision.
129 * @return True if successfully, false otherwise
131 virtual bool Suspend() = 0;
136 #endif // DALI_WEB_ENGINE_POLICY_DECISION_H