• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 /** @error Success. */
37 ARKWEB_SUCCESS = 0,
38 
39 /** @error Init error. */
40 ARKWEB_INIT_ERROR = 17100001,
41 
42 /** @error Unknown error. */
43 ARKWEB_ERROR_UNKNOWN = 17100100,
44 
45 /** @error Invalid param. */
46 ARKWEB_INVALID_PARAM = 17100101,
47 
48 /** @error Register custom schemes should be called before create any ArkWeb. */
49 ARKWEB_SCHEME_REGISTER_FAILED = 17100102,
50 
51 /** @error Invalid url. */
52 ARKWEB_INVALID_URL = 17100103,
53 
54 /** @error Invalid cookie value. */
55 ARKWEB_INVALID_COOKIE_VALUE = 17100104,
56 
57 /*
58  * @brief Failed to open the library.
59  *
60  * @syscap SystemCapability.Web.Webview.Core
61  * @since 15
62  */
63 ARKWEB_LIBRARY_OPEN_FAILURE = 17100105,
64 
65 /*
66  * @brief The required symbol was not found in the library.
67  *
68  * @syscap SystemCapability.Web.Webview.Core
69  * @since 15
70  */
71 ARKWEB_LIBRARY_SYMBOL_NOT_FOUND = 17100106,
72 
73 /**
74  * @brief The CookieManager not initialized.
75  *
76  * @since 20
77  */
78 ARKWEB_COOKIE_MANAGER_NOT_INITIALIZED = 17100107,
79 
80 /**
81  * @brief The CookieManager initialize failed.
82  *
83  * @since 20
84  */
85 ARKWEB_COOKIE_MANAGER_INITIALIZE_FAILED = 17100108,
86 
87 /**
88  * @brief Save cookie failed.
89  *
90  * @since 20
91  */
92 ARKWEB_COOKIE_SAVE_FAILED = 17100109,
93 } ArkWeb_ErrorCode;
94 
95 /**
96  * @brief Defines an enum for the error codes of the white screen optimization solution.
97  *
98  * @since 20
99  */
100 typedef enum ArkWeb_BlanklessErrorCode {
101 /** @error The operation is successful. */
102 ARKWEB_BLANKLESS_SUCCESS = 0,
103 
104 /** @error Unidentified error. */
105 ARKWEB_BLANKLESS_ERR_UNKNOWN = -1,
106 
107 /** @error Invalid parameter. */
108 ARKWEB_BLANKLESS_ERR_INVALID_ARGS = -2,
109 
110 /** @error The web controller is not bound to a component. */
111 ARKWEB_BLANKLESS_ERR_CONTROLLER_NOT_INITED = -3,
112 
113 /**
114  * @error The key value is not matched. The OH_NativeArkWeb_SetBlanklessLoadingWithKey
115  * and OH_NativeArkWeb_GetBlanklessInfoWithKey APIs must be used in pair and use the same key value.
116  */
117 ARKWEB_BLANKLESS_ERR_KEY_NOT_MATCH = -4,
118 
119 /**
120  * @error If the similarity is low, the system determines that the change is too large.
121  * As a result, the OH_NativeArkWeb_SetBlanklessLoadingWithKey API fails to enable frame interpolation.
122  */
123 ARKWEB_BLANKLESS_ERR_SIGNIFICANT_CHANGE = -5,
124 
125 /** @error The device does not support this feature. */
126 ARKWEB_BLANKLESS_ERR_DEVICE_NOT_SUPPORT = 801,
127 } ArkWeb_BlanklessErrorCode;
128 
129 #endif // ARKWEB_ERROR_CODE_H
130 /** @} */
131