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 #ifndef INCLUDE_GRAPHIC_ERROR_CODE_H
17 #define INCLUDE_GRAPHIC_ERROR_CODE_H
18 
19 /**
20  * @addtogroup NativeWindow
21  * @{
22  *
23  * @brief Provides the error codes for native window.
24  *
25  * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
26  * @since 12
27  * @version 1.0
28  */
29 
30 /**
31  * @file external_window.h
32  *
33  * @brief Defines the error codes.
34  *
35  * @kit ArkGraphics2D
36  * @library libnative_window.so
37  * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
38  * @since 12
39  * @version 1.0
40  */
41 
42 #include <stdint.h>
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /**
49  * @brief interface error code.
50  * @since 12
51  */
52 typedef enum OHNativeErrorCode {
53     /** @error succeed */
54     NATIVE_ERROR_OK = 0,
55     /** @error input invalid parameter */
56     NATIVE_ERROR_INVALID_ARGUMENTS = 40001000,
57     /** @error unauthorized operation */
58     NATIVE_ERROR_NO_PERMISSION = 40301000,
59     /** @error no idle buffer is available */
60     NATIVE_ERROR_NO_BUFFER = 40601000,
61     /** @error the consumer side doesn't exist */
62     NATIVE_ERROR_NO_CONSUMER = 41202000,
63     /** @error uninitialized */
64     NATIVE_ERROR_NOT_INIT = 41203000,
65     /** @error the consumer is connected */
66     NATIVE_ERROR_CONSUMER_CONNECTED = 41206000,
67     /** @error the buffer status did not meet expectations */
68     NATIVE_ERROR_BUFFER_STATE_INVALID = 41207000,
69     /** @error buffer is already in the cache queue */
70     NATIVE_ERROR_BUFFER_IN_CACHE = 41208000,
71     /** @error the buffer queue is full */
72     NATIVE_ERROR_BUFFER_QUEUE_FULL = 41209000,
73     /** @error buffer is not in the cache queue */
74     NATIVE_ERROR_BUFFER_NOT_IN_CACHE = 41210000,
75     /** @error the consumer is disconnected */
76     NATIVE_ERROR_CONSUMER_DISCONNECTED = 41211000,
77     /** @error the consumer not register listener */
78     NATIVE_ERROR_CONSUMER_NO_LISTENER_REGISTERED = 41212000,
79     /** @error the current device or platform does not support it */
80     NATIVE_ERROR_UNSUPPORTED = 50102000,
81     /** @error unknown error, please check log */
82     NATIVE_ERROR_UNKNOWN = 50002000,
83     /** @error hdi interface error */
84     NATIVE_ERROR_HDI_ERROR = 50007000,
85     /** @error ipc send failed */
86     NATIVE_ERROR_BINDER_ERROR = 50401000,
87     /** @error the egl environment is abnormal */
88     NATIVE_ERROR_EGL_STATE_UNKNOWN = 60001000,
89     /** @error egl interface invocation failed */
90     NATIVE_ERROR_EGL_API_FAILED = 60002000,
91 } OHNativeErrorCode;
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 /** @} */
98 #endif // INCLUDE_GRAPHIC_ERROR_CODE_H