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 C_INCLUDE_DRAWING_ERROR_CODE_H 17 #define C_INCLUDE_DRAWING_ERROR_CODE_H 18 19 /** 20 * @addtogroup Drawing 21 * @{ 22 * 23 * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. 24 * 25 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 26 * 27 * @since 8 28 * @version 1.0 29 */ 30 31 /** 32 * @file drawing_error_code.h 33 * 34 * @brief Declares functions related to the error code in the drawing module. 35 * 36 * @kit ArkGraphics2D 37 * @library libnative_drawing.so 38 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 39 * @since 12 40 * @version 1.0 41 */ 42 43 #ifdef __cplusplus 44 extern "C" { 45 #endif 46 47 /** 48 * @brief Enumerates error codes of drawing. 49 * @since 12 50 */ 51 typedef enum { 52 /** 53 * @error Operation completed successfully. 54 */ 55 OH_DRAWING_SUCCESS = 0, 56 /** 57 * @error Permission verification failed. 58 */ 59 OH_DRAWING_ERROR_NO_PERMISSION = 201, 60 /** 61 * @error Invalid input parameter. For example, the pointer in the parameter is a nullptr. 62 */ 63 OH_DRAWING_ERROR_INVALID_PARAMETER = 401, 64 /** 65 * @error The parameter is not in the valid range. 66 */ 67 OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE = 26200001, 68 /** 69 * @error mem allocate failed. 70 * @since 13 71 */ 72 OH_DRAWING_ERROR_ALLOCATION_FAILED = 26200002, 73 } OH_Drawing_ErrorCode; 74 75 /** 76 * @brief Obtains the error code of the drawing module. 77 * 78 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 79 * @return Returns the error code. 80 * @since 12 81 * @version 1.0 82 */ 83 OH_Drawing_ErrorCode OH_Drawing_ErrorCodeGet(); 84 85 #ifdef __cplusplus 86 } 87 #endif 88 /** @} */ 89 #endif