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 * @library libnative_drawing.so 37 * @since 12 38 * @version 1.0 39 */ 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 /** 46 * @brief Enumerates error codes of drawing. 47 * @since 12 48 */ 49 typedef enum { 50 /** 51 * @error operation completed successfully. 52 */ 53 OH_DRAWING_SUCCESS = 0, 54 /** 55 * @error permission verification failed. 56 */ 57 OH_DRAWING_ERROR_NO_PERMISSION = 201, 58 /** 59 * @error invalid input parameter, for example, the pointer in the parameter is a nullptr. 60 */ 61 OH_DRAWING_ERROR_INVALID_PARAMETER = 401, 62 /** 63 * @error parameter is not in a valid range. 64 */ 65 OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE = 26200001, 66 /** 67 * @error mem allocate failed. 68 * @since 13 69 */ 70 OH_DRAWING_ERROR_ALLOCATION_FAILED = 26200002, 71 } OH_Drawing_ErrorCode; 72 73 /** 74 * @brief Obtains the error code of the drawing module. 75 * 76 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 77 * @return Returns the error code. 78 * @since 12 79 * @version 1.0 80 */ 81 OH_Drawing_ErrorCode OH_Drawing_ErrorCodeGet(); 82 83 #ifdef __cplusplus 84 } 85 #endif 86 /** @} */ 87 #endif