• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup Web
18  * @{
19  *
20  * @brief Provides APIs for the ArkWeb errors.
21  * @since 12
22  */
23 /**
24  * @file arkweb_error_code.h
25  *
26  * @brief Declares the APIs for the ArkWeb errors.
27  * @kit ArkWeb
28  * @library libohweb.so
29  * @syscap SystemCapability.Web.Webview.Core
30  * @since 12
31  */
32 #ifndef ARKWEB_ERROR_CODE_H
33 #define ARKWEB_ERROR_CODE_H
34 
35 typedef enum ArkWeb_ErrorCode {
36 /*
37  * @brief Success.
38  *
39  * @syscap SystemCapability.Web.Webview.Core
40  * @since 12
41  */
42 ARKWEB_SUCCESS = 0,
43 
44 /*
45  * @brief Init error. The WebviewController must be associated with a Web component.
46  *
47  * @syscap SystemCapability.Web.Webview.Core
48  * @since 12
49  */
50 ARKWEB_INIT_ERROR = 17100001,
51 
52 /*
53  * @brief Unknown error.
54  *
55  * @syscap SystemCapability.Web.Webview.Core
56  * @since 12
57  */
58 ARKWEB_ERROR_UNKNOWN = 17100100,
59 
60 /*
61  * @brief Invalid param.
62  *
63  * @syscap SystemCapability.Web.Webview.Core
64  * @since 12
65  */
66 ARKWEB_INVALID_PARAM = 17100101,
67 
68 /*
69  * @brief Register custom schemes should be called before create any ArkWeb.
70  *
71  * @syscap SystemCapability.Web.Webview.Core
72  * @since 12
73  */
74 ARKWEB_SCHEME_REGISTER_FAILED = 17100102,
75 
76 /*
77  * @brief Invalid url.
78  *
79  * @syscap SystemCapability.Web.Webview.Core
80  * @since 12
81  */
82 ARKWEB_INVALID_URL = 17100103,
83 
84 /*
85  * @brief Invalid cookie value.
86  *
87  * @syscap SystemCapability.Web.Webview.Core
88  * @since 12
89  */
90 ARKWEB_INVALID_COOKIE_VALUE = 17100104,
91 
92 /*
93  * @brief Failed to open the library.
94  *
95  * @syscap SystemCapability.Web.Webview.Core
96  * @since 15
97  */
98 ARKWEB_LIBRARY_OPEN_FAILURE = 17100105,
99 
100 /*
101  * @brief The required symbol was not found in the library.
102  *
103  * @syscap SystemCapability.Web.Webview.Core
104  * @since 15
105  */
106 ARKWEB_LIBRARY_SYMBOL_NOT_FOUND = 17100106,
107 
108 /**
109  * @brief The CookieManager not initialized.
110  *
111  * @since 20
112  */
113 ARKWEB_COOKIE_MANAGER_NOT_INITIALIZED = 17100107,
114 
115 /**
116  * @brief The CookieManager initialize failed.
117  *
118  * @since 20
119  */
120 ARKWEB_COOKIE_MANAGER_INITIALIZE_FAILED = 17100108,
121 
122 /**
123  * @brief Save cookie failed.
124  *
125  * @since 20
126  */
127 ARKWEB_COOKIE_SAVE_FAILED = 17100109,
128 } ArkWeb_ErrorCode;
129 
130 /**
131  * @brief Defines an enum for the error codes of the white screen optimization solution.
132  *
133  * @since 20
134  */
135 typedef enum ArkWeb_BlanklessErrorCode {
136 /** @error The operation is successful. */
137 ARKWEB_BLANKLESS_SUCCESS = 0,
138 
139 /** @error Unidentified error. */
140 ARKWEB_BLANKLESS_ERR_UNKNOWN = -1,
141 
142 /** @error Invalid parameter. */
143 ARKWEB_BLANKLESS_ERR_INVALID_ARGS = -2,
144 
145 /** @error The web controller is not bound to a component. */
146 ARKWEB_BLANKLESS_ERR_CONTROLLER_NOT_INITED = -3,
147 
148 /**
149  * @error The key value is not matched. The OH_NativeArkWeb_SetBlanklessLoadingWithKey
150  * and OH_NativeArkWeb_GetBlanklessInfoWithKey APIs must be used in pair and use the same key value.
151  */
152 ARKWEB_BLANKLESS_ERR_KEY_NOT_MATCH = -4,
153 
154 /**
155  * @error If the similarity is low, the system determines that the change is too large.
156  * As a result, the OH_NativeArkWeb_SetBlanklessLoadingWithKey API fails to enable frame interpolation.
157  */
158 ARKWEB_BLANKLESS_ERR_SIGNIFICANT_CHANGE = -5,
159 
160 /** @error The device does not support this feature. */
161 ARKWEB_BLANKLESS_ERR_DEVICE_NOT_SUPPORT = 801,
162 } ArkWeb_BlanklessErrorCode;
163 
164 #endif // ARKWEB_ERROR_CODE_H