CanvasRenderer: Add Set/GetViewBox() API
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine-load-error.h
1 #ifndef DALI_WEB_ENGINE_LOAD_ERROR_H
2 #define DALI_WEB_ENGINE_LOAD_ERROR_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 WebEngineLoadError for loading error of web engine.
28  */
29 class WebEngineLoadError
30 {
31 public:
32   /**
33    * @brief Enumeration for indicating error code of page loading.
34    */
35   enum class ErrorCode
36   {
37     UNKNOWN = 0,           ///< Unknown.
38     CANCELED,              ///< User canceled.
39     CANT_SUPPORT_MIMETYPE, ///< Can't show the page for this MIME type.
40     FAILED_FILE_IO,        ///< File IO error.
41     CANT_CONNECT,          ///< Cannot connect to the network.
42     CANT_LOOKUP_HOST,      ///< Fail to look up host from the DNS.
43     FAILED_TLS_HANDSHAKE,  ///< Fail to SSL/TLS handshake.
44     INVALID_CERTIFICATE,   ///< Received certificate is invalid.
45     REQUEST_TIMEOUT,       ///< Connection timeout.
46     TOO_MANY_REDIRECTS,    ///< Too many redirects.
47     TOO_MANY_REQUESTS,     ///< Too many requests during this load.
48     BAD_URL,               ///< Malformed URL.
49     UNSUPPORTED_SCHEME,    ///< Unsupported scheme.
50     AUTHENTICATION,        ///< User authentication failed on the server.
51     INTERNAL_SERVER,       ///< Web server has an internal server error.
52     OTHER,                 ///< other error.
53   };
54
55   /**
56    * @brief Enumeration that provides type of loading error.
57    */
58   enum class ErrorType
59   {
60     NONE,
61     INTERNAL,
62     NETWORK,
63     POLICY,
64     PLUGIN,
65     DOWNLOAD,
66     PRINT,
67   };
68
69   /**
70    * @brief Constructor.
71    */
72   WebEngineLoadError() = default;
73
74   /**
75    * @brief Destructor.
76    */
77   virtual ~WebEngineLoadError() = default;
78
79   /**
80    * @brief Query failing URL for this error.
81    * @return URL that failed to load
82    */
83   virtual std::string GetUrl() const = 0;
84
85   /**
86    * @brief Query the error code.
87    * @return The error code
88    */
89   virtual ErrorCode GetCode() const = 0;
90
91   /**
92    * @brief Query description for this error.
93    * @return SeverityLevel indicating the console message level
94    */
95   virtual std::string GetDescription() const = 0;
96
97   /**
98    * @brief Query type for this error.
99    * @return the error type
100    */
101   virtual ErrorType GetType() const = 0;
102 };
103
104 } // namespace Dali
105
106 #endif // DALI_WEB_ENGINE_LOAD_ERROR_H