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 Drawing 18 * @{ 19 * 20 * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. 21 * 22 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 23 * 24 * @since 8 25 * @version 1.0 26 */ 27 28 /** 29 * @file drawing_error_code.h 30 * 31 * @brief Declares functions related to the error code in the drawing module. 32 * 33 * @kit ArkGraphics2D 34 * @library libnative_drawing.so 35 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 36 * @since 12 37 * @version 1.0 38 */ 39 40 #ifndef C_INCLUDE_DRAWING_ERROR_CODE_H 41 #define C_INCLUDE_DRAWING_ERROR_CODE_H 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 /** 86 * @brief Resets the error code of the drawing module to OH_DRAWING_SUCCESS. 87 * 88 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 89 * @since 18 90 * @version 1.0 91 */ 92 void OH_Drawing_ErrorCodeReset(void); 93 #ifdef __cplusplus 94 } 95 #endif 96 /** @} */ 97 #endif