6fcc132c4b41fd6425cc5ca83207d2a479e7b894
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine-http-auth-handler.h
1 #ifndef DALI_WEB_ENGINE_HTTP_AUTH_HANDLER_H
2 #define DALI_WEB_ENGINE_HTTP_AUTH_HANDLER_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <string>
23
24 namespace Dali
25 {
26 /**
27  * @brief A class WebEngineHttpAuthHandler for HTTP authentication handler of web engine.
28  */
29 class WebEngineHttpAuthHandler
30 {
31 public:
32   /**
33    * @brief Constructor.
34    */
35   WebEngineHttpAuthHandler() = default;
36
37   /**
38    * @brief Destructor.
39    */
40   virtual ~WebEngineHttpAuthHandler() = default;
41
42   /**
43    * @brief Gets the realm string of authentication challenge received.
44    *
45    * @return the realm of authentication challenge
46    */
47   virtual std::string GetRealm() const = 0;
48
49   /**
50    * @brief Suspend the operation for authentication challenge.
51    */
52   virtual void Suspend() = 0;
53
54   /**
55    * @brief Send credential for authentication challenge.
56    *
57    * @param[in] user user id from user input.
58    * @param[in] password user password from user input.
59    */
60   virtual void UseCredential(const std::string& user, const std::string& password) = 0;
61
62   /**
63    * @brief Send cancellation notification for authentication challenge.
64    */
65   virtual void CancelCredential() = 0;
66 };
67
68 } // namespace Dali
69
70 #endif // DALI_WEB_ENGINE_HTTP_AUTH_HANDLER_H