17777dab0Sopenharmony_ci/* 27777dab0Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License. 57777dab0Sopenharmony_ci * You may obtain a copy of the License at 67777dab0Sopenharmony_ci * 77777dab0Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 87777dab0Sopenharmony_ci * 97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and 137777dab0Sopenharmony_ci * limitations under the License. 147777dab0Sopenharmony_ci */ 157777dab0Sopenharmony_ci 167777dab0Sopenharmony_ci/** 177777dab0Sopenharmony_ci * @addtogroup resourcemanager 187777dab0Sopenharmony_ci * @{ 197777dab0Sopenharmony_ci * 207777dab0Sopenharmony_ci * @brief Provides the c interface to obtain resources, and relies on librawfile.z.so when used. 217777dab0Sopenharmony_ci * 227777dab0Sopenharmony_ci * @since 12 237777dab0Sopenharmony_ci */ 247777dab0Sopenharmony_ci 257777dab0Sopenharmony_ci/** 267777dab0Sopenharmony_ci * @file ohresmgr.h 277777dab0Sopenharmony_ci * 287777dab0Sopenharmony_ci * @brief Provides the implementation of the interface. 297777dab0Sopenharmony_ci * @syscap SystemCapability.Global.ResourceManager 307777dab0Sopenharmony_ci * @library libohresmgr.so 317777dab0Sopenharmony_ci * @kit LocalizationKit 327777dab0Sopenharmony_ci * @since 12 337777dab0Sopenharmony_ci */ 347777dab0Sopenharmony_ci#ifndef GLOBAL_OH_RESMGR_H 357777dab0Sopenharmony_ci#define GLOBAL_OH_RESMGR_H 367777dab0Sopenharmony_ci 377777dab0Sopenharmony_ci#include "resmgr_common.h" 387777dab0Sopenharmony_ci#include "../rawfile/raw_file_manager.h" 397777dab0Sopenharmony_ci#include "../arkui/drawable_descriptor.h" 407777dab0Sopenharmony_ci 417777dab0Sopenharmony_ci#ifdef __cplusplus 427777dab0Sopenharmony_ciextern "C" { 437777dab0Sopenharmony_ci#endif 447777dab0Sopenharmony_ci 457777dab0Sopenharmony_ci/** 467777dab0Sopenharmony_ci * @brief Obtains the Base64 code of the image resource. 477777dab0Sopenharmony_ci * 487777dab0Sopenharmony_ci * Obtains the Base64 code of the image resource corresponding to the specified resource ID. 497777dab0Sopenharmony_ci * 507777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 517777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 527777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 537777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 547777dab0Sopenharmony_ci * to use the density of current system dpi. 557777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 567777dab0Sopenharmony_ci * @param resultLen the media length write to resultLen. 577777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 587777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 597777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 607777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 617777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 627777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 637777dab0Sopenharmony_ci * @since 12 647777dab0Sopenharmony_ci */ 657777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64(const NativeResourceManager *mgr, uint32_t resId, 667777dab0Sopenharmony_ci char **resultValue, uint64_t *resultLen, uint32_t density = 0); 677777dab0Sopenharmony_ci 687777dab0Sopenharmony_ci/** 697777dab0Sopenharmony_ci * @brief Obtains the Base64 code of the image resource. 707777dab0Sopenharmony_ci * 717777dab0Sopenharmony_ci * Obtains the Base64 code of the image resource corresponding to the specified resource ID. 727777dab0Sopenharmony_ci * 737777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 747777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 757777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 767777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 777777dab0Sopenharmony_ci * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 787777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 797777dab0Sopenharmony_ci * @param resultLen the media length write to resultLen. 807777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 817777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 827777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 837777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 847777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 857777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 867777dab0Sopenharmony_ci * @since 12 877777dab0Sopenharmony_ci */ 887777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64Data(const NativeResourceManager *mgr, uint32_t resId, 897777dab0Sopenharmony_ci char **resultValue, uint64_t *resultLen, uint32_t density); 907777dab0Sopenharmony_ci 917777dab0Sopenharmony_ci/** 927777dab0Sopenharmony_ci * @brief Obtains the Base64 code of the image resource. 937777dab0Sopenharmony_ci * 947777dab0Sopenharmony_ci * Obtains the Base64 code of the image resource corresponding to the specified resource name. 957777dab0Sopenharmony_ci * 967777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 977777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 987777dab0Sopenharmony_ci * @param resName Indicates the resource name. 997777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1007777dab0Sopenharmony_ci * to use the density of current system dpi. 1017777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 1027777dab0Sopenharmony_ci * @param resultLen the media length write to resultLen. 1037777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 1047777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 1057777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 1067777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 1077777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 1087777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 1097777dab0Sopenharmony_ci * @since 12 1107777dab0Sopenharmony_ci */ 1117777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64ByName(const NativeResourceManager *mgr, 1127777dab0Sopenharmony_ci const char *resName, char **resultValue, uint64_t *resultLen, uint32_t density = 0); 1137777dab0Sopenharmony_ci 1147777dab0Sopenharmony_ci/** 1157777dab0Sopenharmony_ci * @brief Obtains the Base64 code of the image resource. 1167777dab0Sopenharmony_ci * 1177777dab0Sopenharmony_ci * Obtains the Base64 code of the image resource corresponding to the specified resource name. 1187777dab0Sopenharmony_ci * 1197777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 1207777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 1217777dab0Sopenharmony_ci * @param resName Indicates the resource name. 1227777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1237777dab0Sopenharmony_ci * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 1247777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 1257777dab0Sopenharmony_ci * @param resultLen the media length write to resultLen. 1267777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 1277777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 1287777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 1297777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 1307777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 1317777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 1327777dab0Sopenharmony_ci * @since 12 1337777dab0Sopenharmony_ci */ 1347777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64DataByName(const NativeResourceManager *mgr, 1357777dab0Sopenharmony_ci const char *resName, char **resultValue, uint64_t *resultLen, uint32_t density); 1367777dab0Sopenharmony_ci 1377777dab0Sopenharmony_ci/** 1387777dab0Sopenharmony_ci * @brief Obtains the content of the image resource. 1397777dab0Sopenharmony_ci * 1407777dab0Sopenharmony_ci * Obtains the content of the specified screen density media file corresponding to a specified resource ID. 1417777dab0Sopenharmony_ci * 1427777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 1437777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 1447777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 1457777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1467777dab0Sopenharmony_ci * to use the density of current system dpi. 1477777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 1487777dab0Sopenharmony_ci * @param resultLen the media length write to resultLen. 1497777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 1507777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 1517777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 1527777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 1537777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 1547777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 1557777dab0Sopenharmony_ci * @since 12 1567777dab0Sopenharmony_ci */ 1577777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMedia(const NativeResourceManager *mgr, uint32_t resId, 1587777dab0Sopenharmony_ci uint8_t **resultValue, uint64_t *resultLen, uint32_t density = 0); 1597777dab0Sopenharmony_ci 1607777dab0Sopenharmony_ci/** 1617777dab0Sopenharmony_ci * @brief Obtains the content of the image resource. 1627777dab0Sopenharmony_ci * 1637777dab0Sopenharmony_ci * Obtains the content of the specified screen density media file corresponding to a specified resource ID. 1647777dab0Sopenharmony_ci * 1657777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 1667777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 1677777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 1687777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1697777dab0Sopenharmony_ci * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 1707777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 1717777dab0Sopenharmony_ci * @param resultLen the media length write to resultLen. 1727777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 1737777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 1747777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 1757777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 1767777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 1777777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 1787777dab0Sopenharmony_ci * @since 12 1797777dab0Sopenharmony_ci */ 1807777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaData(const NativeResourceManager *mgr, uint32_t resId, 1817777dab0Sopenharmony_ci uint8_t **resultValue, uint64_t *resultLen, uint32_t density); 1827777dab0Sopenharmony_ci 1837777dab0Sopenharmony_ci/** 1847777dab0Sopenharmony_ci * @brief Obtains the content of the image resource. 1857777dab0Sopenharmony_ci * 1867777dab0Sopenharmony_ci * Obtains the content of the specified screen density media file corresponding to a specified resource name. 1877777dab0Sopenharmony_ci * 1887777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 1897777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 1907777dab0Sopenharmony_ci * @param resName Indicates the resource name. 1917777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1927777dab0Sopenharmony_ci * to use the density of current system dpi. 1937777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 1947777dab0Sopenharmony_ci * @param resultLen the media length write to resultLen. 1957777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 1967777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 1977777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 1987777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 1997777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 2007777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 2017777dab0Sopenharmony_ci * @since 12 2027777dab0Sopenharmony_ci */ 2037777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaByName(const NativeResourceManager *mgr, const char *resName, 2047777dab0Sopenharmony_ci uint8_t **resultValue, uint64_t *resultLen, uint32_t density = 0); 2057777dab0Sopenharmony_ci 2067777dab0Sopenharmony_ci/** 2077777dab0Sopenharmony_ci * @brief Obtains the content of the image resource. 2087777dab0Sopenharmony_ci * 2097777dab0Sopenharmony_ci * Obtains the content of the specified screen density media file corresponding to a specified resource name. 2107777dab0Sopenharmony_ci * 2117777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 2127777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 2137777dab0Sopenharmony_ci * @param resName Indicates the resource name. 2147777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2157777dab0Sopenharmony_ci * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 2167777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 2177777dab0Sopenharmony_ci * @param resultLen the media length write to resultLen. 2187777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 2197777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 2207777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 2217777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 2227777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 2237777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 2247777dab0Sopenharmony_ci * @since 12 2257777dab0Sopenharmony_ci */ 2267777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaDataByName(const NativeResourceManager *mgr, const char *resName, 2277777dab0Sopenharmony_ci uint8_t **resultValue, uint64_t *resultLen, uint32_t density); 2287777dab0Sopenharmony_ci 2297777dab0Sopenharmony_ci/** 2307777dab0Sopenharmony_ci * @brief Obtains the DrawableDescriptor of the media file. 2317777dab0Sopenharmony_ci * 2327777dab0Sopenharmony_ci * Obtains the DrawableDescriptor of the media file corresponding to a specified resource ID. 2337777dab0Sopenharmony_ci * 2347777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 2357777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 2367777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 2377777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2387777dab0Sopenharmony_ci * to use the density of current system dpi. 2397777dab0Sopenharmony_ci * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media. 2407777dab0Sopenharmony_ci * @param drawableDescriptor the result write to drawableDescriptor. 2417777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 2427777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 2437777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 2447777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 2457777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 2467777dab0Sopenharmony_ci * @since 12 2477777dab0Sopenharmony_ci */ 2487777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptor(const NativeResourceManager *mgr, 2497777dab0Sopenharmony_ci uint32_t resId, ArkUI_DrawableDescriptor **drawableDescriptor, uint32_t density = 0, uint32_t type = 0); 2507777dab0Sopenharmony_ci 2517777dab0Sopenharmony_ci/** 2527777dab0Sopenharmony_ci * @brief Obtains the DrawableDescriptor of the media file. 2537777dab0Sopenharmony_ci * 2547777dab0Sopenharmony_ci * Obtains the DrawableDescriptor of the media file corresponding to a specified resource ID. 2557777dab0Sopenharmony_ci * 2567777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 2577777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 2587777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 2597777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2607777dab0Sopenharmony_ci * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 2617777dab0Sopenharmony_ci * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media. 2627777dab0Sopenharmony_ci * If this attribute is not required, set this parameter to 0. 2637777dab0Sopenharmony_ci * @param drawableDescriptor the result write to drawableDescriptor. 2647777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 2657777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 2667777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 2677777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 2687777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 2697777dab0Sopenharmony_ci * @since 12 2707777dab0Sopenharmony_ci */ 2717777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorData(const NativeResourceManager *mgr, 2727777dab0Sopenharmony_ci uint32_t resId, ArkUI_DrawableDescriptor **drawableDescriptor, uint32_t density, uint32_t type); 2737777dab0Sopenharmony_ci 2747777dab0Sopenharmony_ci/** 2757777dab0Sopenharmony_ci * @brief Obtains the DrawableDescriptor of the media file. 2767777dab0Sopenharmony_ci * 2777777dab0Sopenharmony_ci * Obtains the DrawableDescriptor of the media file corresponding to a specified resource name. 2787777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 2797777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 2807777dab0Sopenharmony_ci * @param resName Indicates the resource name. 2817777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2827777dab0Sopenharmony_ci * to use the density of current system dpi. 2837777dab0Sopenharmony_ci * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media, 2847777dab0Sopenharmony_ci * 2 means the theme dynamic media. 2857777dab0Sopenharmony_ci * @param drawableDescriptor the result write to drawableDescriptor. 2867777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 2877777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 2887777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 2897777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 2907777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 2917777dab0Sopenharmony_ci * @since 12 2927777dab0Sopenharmony_ci */ 2937777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorByName(const NativeResourceManager *mgr, 2947777dab0Sopenharmony_ci const char *resName, ArkUI_DrawableDescriptor **drawableDescriptor, uint32_t density = 0, uint32_t type = 0); 2957777dab0Sopenharmony_ci 2967777dab0Sopenharmony_ci/** 2977777dab0Sopenharmony_ci * @brief Obtains the DrawableDescriptor of the media file. 2987777dab0Sopenharmony_ci * 2997777dab0Sopenharmony_ci * Obtains the DrawableDescriptor of the media file corresponding to a specified resource name. 3007777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 3017777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 3027777dab0Sopenharmony_ci * @param resName Indicates the resource name. 3037777dab0Sopenharmony_ci * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3047777dab0Sopenharmony_ci * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 3057777dab0Sopenharmony_ci * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media, 3067777dab0Sopenharmony_ci * 2 means the theme dynamic media. If this attribute is not required, set this parameter to 0. 3077777dab0Sopenharmony_ci * @param drawableDescriptor the result write to drawableDescriptor. 3087777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 3097777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 3107777dab0Sopenharmony_ci * 1.Incorrect parameter types; 2.Parameter verification failed. 3117777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 3127777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 3137777dab0Sopenharmony_ci * @since 12 3147777dab0Sopenharmony_ci */ 3157777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorDataByName(const NativeResourceManager *mgr, 3167777dab0Sopenharmony_ci const char *resName, ArkUI_DrawableDescriptor **drawableDescriptor, uint32_t density, uint32_t type); 3177777dab0Sopenharmony_ci 3187777dab0Sopenharmony_ci/** 3197777dab0Sopenharmony_ci * @brief Obtains the symbol resource. 3207777dab0Sopenharmony_ci * 3217777dab0Sopenharmony_ci * Obtains the symbol resource corresponding to the specified resource ID. 3227777dab0Sopenharmony_ci * 3237777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 3247777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 3257777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 3267777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 3277777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 3287777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 3297777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 3307777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 3317777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 3327777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 3337777dab0Sopenharmony_ci * @since 12 3347777dab0Sopenharmony_ci */ 3357777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetSymbol(const NativeResourceManager *mgr, uint32_t resId, 3367777dab0Sopenharmony_ci uint32_t *resultValue); 3377777dab0Sopenharmony_ci 3387777dab0Sopenharmony_ci/** 3397777dab0Sopenharmony_ci * @brief Obtains the symbol resource. 3407777dab0Sopenharmony_ci * 3417777dab0Sopenharmony_ci * Obtains the symbol resource corresponding to the specified resource name. 3427777dab0Sopenharmony_ci * 3437777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 3447777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 3457777dab0Sopenharmony_ci * @param resName Indicates the resource name. 3467777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 3477777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 3487777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 3497777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 3507777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 3517777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 3527777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 3537777dab0Sopenharmony_ci * @since 12 3547777dab0Sopenharmony_ci */ 3557777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetSymbolByName(const NativeResourceManager *mgr, const char *resName, 3567777dab0Sopenharmony_ci uint32_t *resultValue); 3577777dab0Sopenharmony_ci 3587777dab0Sopenharmony_ci/** 3597777dab0Sopenharmony_ci * @brief Obtains locales list. 3607777dab0Sopenharmony_ci * 3617777dab0Sopenharmony_ci * You need to call the OH_ResourceManager_ReleaseStringArray() method to release the memory of localinfo. 3627777dab0Sopenharmony_ci * 3637777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 3647777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 3657777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 3667777dab0Sopenharmony_ci * @param resultLen the locales length write to resultLen. 3677777dab0Sopenharmony_ci * @param includeSystem the parameter controls whether to include system resources, 3687777dab0Sopenharmony_ci * the default value is false, it has no effect when only system resources query the locales list. 3697777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 3707777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 3717777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 3727777dab0Sopenharmony_ci * {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 3737777dab0Sopenharmony_ci * @since 12 3747777dab0Sopenharmony_ci */ 3757777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetLocales(const NativeResourceManager *mgr, char ***resultValue, 3767777dab0Sopenharmony_ci uint32_t *resultLen, bool includeSystem = false); 3777777dab0Sopenharmony_ci 3787777dab0Sopenharmony_ci/** 3797777dab0Sopenharmony_ci * @brief Obtains locales list. 3807777dab0Sopenharmony_ci * 3817777dab0Sopenharmony_ci * You need to call the OH_ResourceManager_ReleaseStringArray() method to release the memory of localinfo. 3827777dab0Sopenharmony_ci * 3837777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 3847777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 3857777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 3867777dab0Sopenharmony_ci * @param resultLen the locales length write to resultLen. 3877777dab0Sopenharmony_ci * @param includeSystem the parameter controls whether to include system resources. 3887777dab0Sopenharmony_ci * If this attribute is not required, set this parameter to false. 3897777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 3907777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 3917777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 3927777dab0Sopenharmony_ci * {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 3937777dab0Sopenharmony_ci * @since 12 3947777dab0Sopenharmony_ci */ 3957777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetLocalesData(const NativeResourceManager *mgr, char ***resultValue, 3967777dab0Sopenharmony_ci uint32_t *resultLen, bool includeSystem); 3977777dab0Sopenharmony_ci 3987777dab0Sopenharmony_ci/** 3997777dab0Sopenharmony_ci * @brief Obtains the device configuration. 4007777dab0Sopenharmony_ci * 4017777dab0Sopenharmony_ci * You need to call the OH_ResourceManager_ReleaseConfiguration() method to release the memory. 4027777dab0Sopenharmony_ci * If you use malloc to create a ResourceManager_Configuration object, you also need to call free to release it. 4037777dab0Sopenharmony_ci * 4047777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 4057777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 4067777dab0Sopenharmony_ci * @param configuration the result write to ResourceManager_Configuration. 4077777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 4087777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 4097777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 4107777dab0Sopenharmony_ci {@link ERROR_CODE_SYSTEM_RES_MANAGER_GET_FAILED} 9001009 - If failed to access the system resource. 4117777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 4127777dab0Sopenharmony_ci * @since 12 4137777dab0Sopenharmony_ci */ 4147777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetConfiguration(const NativeResourceManager *mgr, 4157777dab0Sopenharmony_ci ResourceManager_Configuration *configuration); 4167777dab0Sopenharmony_ci 4177777dab0Sopenharmony_ci/** 4187777dab0Sopenharmony_ci * @brief Release the device configuration. 4197777dab0Sopenharmony_ci * @param configuration the object need to release. 4207777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 4217777dab0Sopenharmony_ci {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 4227777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 4237777dab0Sopenharmony_ci * @since 12 4247777dab0Sopenharmony_ci */ 4257777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_ReleaseConfiguration(ResourceManager_Configuration *configuration); 4267777dab0Sopenharmony_ci 4277777dab0Sopenharmony_ci/** 4287777dab0Sopenharmony_ci * @brief Obtains the character string. 4297777dab0Sopenharmony_ci * 4307777dab0Sopenharmony_ci * Obtains the character string corresponding to a specified resource ID. 4317777dab0Sopenharmony_ci * Obtain normal resource by calling OH_ResourceManager_GetString(mgr, resId, resultValue), 4327777dab0Sopenharmony_ci obtain a formatted resource with replacements for %d, %s, %f, 4337777dab0Sopenharmony_ci call OH_ResourceManager_GetString(mgr, resId, resultValue, 10, "format", 10.10). 4347777dab0Sopenharmony_ci * You need to call free() to release the memory for the string. 4357777dab0Sopenharmony_ci * 4367777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 4377777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 4387777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 4397777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 4407777dab0Sopenharmony_ci * @param { const char* | int | float } args - Indicates the formatting string resource parameters. 4417777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 4427777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 4437777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 4447777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 4457777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 4467777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 4477777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 4487777dab0Sopenharmony_ci * @since 12 4497777dab0Sopenharmony_ci */ 4507777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetString(const NativeResourceManager *mgr, uint32_t resId, 4517777dab0Sopenharmony_ci char **resultValue, ...); 4527777dab0Sopenharmony_ci 4537777dab0Sopenharmony_ci/** 4547777dab0Sopenharmony_ci * @brief Obtains the character string. 4557777dab0Sopenharmony_ci * 4567777dab0Sopenharmony_ci * Obtains the character string corresponding to a specified resource name. 4577777dab0Sopenharmony_ci * Obtain normal resource by calling OH_ResourceManager_GetString(mgr, resName, resultValue), 4587777dab0Sopenharmony_ci obtain a formatted resource with replacements for %d, %s, %f, 4597777dab0Sopenharmony_ci call OH_ResourceManager_GetString(mgr, resName, resultValue, 10, "format", 10.10). 4607777dab0Sopenharmony_ci * You need to call free() to release the memory for the string. 4617777dab0Sopenharmony_ci * 4627777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 4637777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 4647777dab0Sopenharmony_ci * @param resName Indicates the resource name. 4657777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 4667777dab0Sopenharmony_ci * @param { const char* | int | float } args - Indicates the formatting string resource parameters. 4677777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 4687777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 4697777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 4707777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 4717777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 4727777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 4737777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 4747777dab0Sopenharmony_ci * @since 12 4757777dab0Sopenharmony_ci */ 4767777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetStringByName(const NativeResourceManager *mgr, const char *resName, 4777777dab0Sopenharmony_ci char **resultValue, ...); 4787777dab0Sopenharmony_ci 4797777dab0Sopenharmony_ci/** 4807777dab0Sopenharmony_ci * @brief Obtains the array of character strings. 4817777dab0Sopenharmony_ci * 4827777dab0Sopenharmony_ci * Obtains the array of character strings corresponding to a specified resource ID. 4837777dab0Sopenharmony_ci * You need to call the OH_ResourceManager_ReleaseStringArray() method to release the memory of string array. 4847777dab0Sopenharmony_ci * 4857777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 4867777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 4877777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 4887777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 4897777dab0Sopenharmony_ci * @param resultLen the StringArray length write to resultLen. 4907777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 4917777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 4927777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 4937777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 4947777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 4957777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 4967777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 4977777dab0Sopenharmony_ci * @since 12 4987777dab0Sopenharmony_ci */ 4997777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetStringArray(const NativeResourceManager *mgr, uint32_t resId, 5007777dab0Sopenharmony_ci char ***resultValue, uint32_t *resultLen); 5017777dab0Sopenharmony_ci 5027777dab0Sopenharmony_ci/** 5037777dab0Sopenharmony_ci * @brief Obtains the array of character strings. 5047777dab0Sopenharmony_ci * 5057777dab0Sopenharmony_ci * Obtains the array of character strings corresponding to a specified resource name. 5067777dab0Sopenharmony_ci * You need to call the OH_ResourceManager_ReleaseStringArray() method to release the memory of string array. 5077777dab0Sopenharmony_ci * 5087777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 5097777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 5107777dab0Sopenharmony_ci * @param resName Indicates the resource name. 5117777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 5127777dab0Sopenharmony_ci * @param resultLen the StringArray length write to resultLen. 5137777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 5147777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 5157777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 5167777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 5177777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 5187777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 5197777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 5207777dab0Sopenharmony_ci * @since 12 5217777dab0Sopenharmony_ci */ 5227777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetStringArrayByName(const NativeResourceManager *mgr, 5237777dab0Sopenharmony_ci const char *resName, char ***resultValue, uint32_t *resultLen); 5247777dab0Sopenharmony_ci 5257777dab0Sopenharmony_ci/** 5267777dab0Sopenharmony_ci * @brief Release the array of character strings. 5277777dab0Sopenharmony_ci * @param resValue the array of character strings corresponding to the specified resource name. 5287777dab0Sopenharmony_ci * @param len the length of array. 5297777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 5307777dab0Sopenharmony_ci {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 5317777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 5327777dab0Sopenharmony_ci * @since 12 5337777dab0Sopenharmony_ci */ 5347777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_ReleaseStringArray(char ***resValue, uint32_t len); 5357777dab0Sopenharmony_ci 5367777dab0Sopenharmony_ci/** 5377777dab0Sopenharmony_ci * @brief Obtains the singular-plural character string represented. 5387777dab0Sopenharmony_ci * 5397777dab0Sopenharmony_ci * Obtains the singular-plural character string represented by the ID string corresponding to the specified number. 5407777dab0Sopenharmony_ci * You need to call free() to release the memory for the string. 5417777dab0Sopenharmony_ci * 5427777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 5437777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 5447777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 5457777dab0Sopenharmony_ci * @param num - Indicates the number. 5467777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 5477777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 5487777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 5497777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 5507777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 5517777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 5527777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 5537777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 5547777dab0Sopenharmony_ci * @since 12 5557777dab0Sopenharmony_ci */ 5567777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetPluralString(const NativeResourceManager *mgr, uint32_t resId, 5577777dab0Sopenharmony_ci uint32_t num, char **resultValue); 5587777dab0Sopenharmony_ci 5597777dab0Sopenharmony_ci/** 5607777dab0Sopenharmony_ci * @brief Obtains the singular-plural character string represented. 5617777dab0Sopenharmony_ci * 5627777dab0Sopenharmony_ci * Obtains the singular-plural character string represented by the Name string corresponding to the specified number. 5637777dab0Sopenharmony_ci * You need to call free() to release the memory for the string. 5647777dab0Sopenharmony_ci * 5657777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 5667777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 5677777dab0Sopenharmony_ci * @param resName Indicates the resource name. 5687777dab0Sopenharmony_ci * @param num - Indicates the number. 5697777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 5707777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 5717777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 5727777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 5737777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 5747777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 5757777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 5767777dab0Sopenharmony_ci {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 5777777dab0Sopenharmony_ci * @since 12 5787777dab0Sopenharmony_ci */ 5797777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetPluralStringByName(const NativeResourceManager *mgr, 5807777dab0Sopenharmony_ci const char *resName, uint32_t num, char **resultValue); 5817777dab0Sopenharmony_ci 5827777dab0Sopenharmony_ci/** 5837777dab0Sopenharmony_ci * @brief Obtains the color resource. 5847777dab0Sopenharmony_ci * 5857777dab0Sopenharmony_ci * Obtains the color resource corresponding to the specified resource ID. 5867777dab0Sopenharmony_ci * 5877777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 5887777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 5897777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 5907777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 5917777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 5927777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 5937777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 5947777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 5957777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 5967777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 5977777dab0Sopenharmony_ci * @since 12 5987777dab0Sopenharmony_ci */ 5997777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetColor(const NativeResourceManager *mgr, uint32_t resId, 6007777dab0Sopenharmony_ci uint32_t *resultValue); 6017777dab0Sopenharmony_ci 6027777dab0Sopenharmony_ci/** 6037777dab0Sopenharmony_ci * @brief Obtains the color resource. 6047777dab0Sopenharmony_ci * 6057777dab0Sopenharmony_ci * Obtains the color resource corresponding to the specified resource name. 6067777dab0Sopenharmony_ci * 6077777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 6087777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 6097777dab0Sopenharmony_ci * @param resName Indicates the resource name. 6107777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 6117777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 6127777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 6137777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 6147777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 6157777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 6167777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 6177777dab0Sopenharmony_ci * @since 12 6187777dab0Sopenharmony_ci */ 6197777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetColorByName(const NativeResourceManager *mgr, const char *resName, 6207777dab0Sopenharmony_ci uint32_t *resultValue); 6217777dab0Sopenharmony_ci 6227777dab0Sopenharmony_ci/** 6237777dab0Sopenharmony_ci * @brief Obtains the Int resource. 6247777dab0Sopenharmony_ci * 6257777dab0Sopenharmony_ci * Obtains the Int resource corresponding to the specified resource ID. 6267777dab0Sopenharmony_ci * 6277777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 6287777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 6297777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 6307777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 6317777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 6327777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 6337777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 6347777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 6357777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 6367777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 6377777dab0Sopenharmony_ci * @since 12 6387777dab0Sopenharmony_ci */ 6397777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetInt(const NativeResourceManager *mgr, uint32_t resId, 6407777dab0Sopenharmony_ci int *resultValue); 6417777dab0Sopenharmony_ci 6427777dab0Sopenharmony_ci/** 6437777dab0Sopenharmony_ci * @brief Obtains the Int resource. 6447777dab0Sopenharmony_ci * 6457777dab0Sopenharmony_ci * Obtains the Int resource corresponding to the specified resource name. 6467777dab0Sopenharmony_ci * 6477777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 6487777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 6497777dab0Sopenharmony_ci * @param resName Indicates the resource name. 6507777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 6517777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 6527777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 6537777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 6547777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 6557777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 6567777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 6577777dab0Sopenharmony_ci * @since 12 6587777dab0Sopenharmony_ci */ 6597777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetIntByName(const NativeResourceManager *mgr, const char *resName, 6607777dab0Sopenharmony_ci int *resultValue); 6617777dab0Sopenharmony_ci 6627777dab0Sopenharmony_ci/** 6637777dab0Sopenharmony_ci * @brief Obtains the Float resource. 6647777dab0Sopenharmony_ci * 6657777dab0Sopenharmony_ci * Obtains the Int resource corresponding to the specified resource ID. 6667777dab0Sopenharmony_ci * 6677777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 6687777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 6697777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 6707777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 6717777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 6727777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 6737777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 6747777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 6757777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 6767777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 6777777dab0Sopenharmony_ci * @since 12 6787777dab0Sopenharmony_ci */ 6797777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetFloat(const NativeResourceManager *mgr, uint32_t resId, 6807777dab0Sopenharmony_ci float *resultValue); 6817777dab0Sopenharmony_ci 6827777dab0Sopenharmony_ci/** 6837777dab0Sopenharmony_ci * @brief Obtains the Float resource. 6847777dab0Sopenharmony_ci * 6857777dab0Sopenharmony_ci * Obtains the Float resource corresponding to the specified resource name. 6867777dab0Sopenharmony_ci * 6877777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 6887777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 6897777dab0Sopenharmony_ci * @param resName Indicates the resource name. 6907777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 6917777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 6927777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 6937777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 6947777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 6957777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 6967777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 6977777dab0Sopenharmony_ci * @since 12 6987777dab0Sopenharmony_ci */ 6997777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetFloatByName(const NativeResourceManager *mgr, const char *resName, 7007777dab0Sopenharmony_ci float *resultValue); 7017777dab0Sopenharmony_ci 7027777dab0Sopenharmony_ci/** 7037777dab0Sopenharmony_ci * @brief Obtains the boolean result. 7047777dab0Sopenharmony_ci * 7057777dab0Sopenharmony_ci * Obtains the boolean result with a specified resource ID. 7067777dab0Sopenharmony_ci * 7077777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 7087777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 7097777dab0Sopenharmony_ci * @param resId Indicates the resource ID. 7107777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 7117777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 7127777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 7137777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 7147777dab0Sopenharmony_ci {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 7157777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 7167777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 7177777dab0Sopenharmony_ci * @since 12 7187777dab0Sopenharmony_ci */ 7197777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetBool(const NativeResourceManager *mgr, uint32_t resId, 7207777dab0Sopenharmony_ci bool *resultValue); 7217777dab0Sopenharmony_ci 7227777dab0Sopenharmony_ci/** 7237777dab0Sopenharmony_ci * @brief Obtains the boolean result. 7247777dab0Sopenharmony_ci * 7257777dab0Sopenharmony_ci * Obtains the boolean result with a specified resource name. 7267777dab0Sopenharmony_ci * 7277777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 7287777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 7297777dab0Sopenharmony_ci * @param resName Indicates the resource name. 7307777dab0Sopenharmony_ci * @param resultValue the result write to resultValue. 7317777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 7327777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 7337777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 7347777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 7357777dab0Sopenharmony_ci {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 7367777dab0Sopenharmony_ci {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 7377777dab0Sopenharmony_ci * @since 12 7387777dab0Sopenharmony_ci */ 7397777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetBoolByName(const NativeResourceManager *mgr, const char *resName, 7407777dab0Sopenharmony_ci bool *resultValue); 7417777dab0Sopenharmony_ci 7427777dab0Sopenharmony_ci/** 7437777dab0Sopenharmony_ci * @brief Add overlay resources during application runtime. 7447777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 7457777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 7467777dab0Sopenharmony_ci * @param path Indicates the application overlay path. 7477777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 7487777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 7497777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 7507777dab0Sopenharmony_ci {@link ERROR_CODE_OVERLAY_RES_PATH_INVALID} 9001010 - Invalid overlay path. 7517777dab0Sopenharmony_ci * @since 12 7527777dab0Sopenharmony_ci */ 7537777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_AddResource(const NativeResourceManager *mgr, const char *path); 7547777dab0Sopenharmony_ci 7557777dab0Sopenharmony_ci/** 7567777dab0Sopenharmony_ci * @brief Remove overlay resources during application runtime. 7577777dab0Sopenharmony_ci * @param mgr Indicates the pointer to {@link NativeResourceManager} 7587777dab0Sopenharmony_ci * {@link OH_ResourceManager_InitNativeResourceManager}. 7597777dab0Sopenharmony_ci * @param path Indicates the application overlay path. 7607777dab0Sopenharmony_ci * @return {@link SUCCESS} 0 - Success. 7617777dab0Sopenharmony_ci * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 7627777dab0Sopenharmony_ci Possible causes: Incorrect parameter types. 7637777dab0Sopenharmony_ci {@link ERROR_CODE_OVERLAY_RES_PATH_INVALID} 9001010 - Invalid overlay path. 7647777dab0Sopenharmony_ci * @since 12 7657777dab0Sopenharmony_ci */ 7667777dab0Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_RemoveResource(const NativeResourceManager *mgr, const char *path); 7677777dab0Sopenharmony_ci#ifdef __cplusplus 7687777dab0Sopenharmony_ci}; 7697777dab0Sopenharmony_ci#endif 7707777dab0Sopenharmony_ci 7717777dab0Sopenharmony_ci/** @} */ 7727777dab0Sopenharmony_ci#endif // GLOBAL_OH_RESMGR_H