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 resourcemanager 18 * @{ 19 * 20 * @brief Provides the c interface to obtain resources, and relies on librawfile.z.so when used. 21 * 22 * @since 12 23 */ 24 25 /** 26 * @file ohresmgr.h 27 * 28 * @brief Provides the implementation of the interface. 29 * @syscap SystemCapability.Global.ResourceManager 30 * @library libohresmgr.so 31 * @kit LocalizationKit 32 * @since 12 33 */ 34 #ifndef GLOBAL_OH_RESMGR_H 35 #define GLOBAL_OH_RESMGR_H 36 37 #include "resmgr_common.h" 38 #include "../rawfile/raw_file_manager.h" 39 #include "../arkui/drawable_descriptor.h" 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 /** 46 * @brief Obtains the Base64 code of the image resource. 47 * 48 * Obtains the Base64 code of the image resource corresponding to the specified resource ID. 49 * 50 * @param mgr Indicates the pointer to {@link NativeResourceManager} 51 * {@link OH_ResourceManager_InitNativeResourceManager}. 52 * @param resId Indicates the resource ID. 53 * @param resultValue the result write to resultValue. 54 * @param resultLen the media length write to resultLen. 55 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 56 * to use the density of current system dpi. 57 * @return {@link SUCCESS} 0 - Success. 58 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 59 * 1.Incorrect parameter types; 2.Parameter verification failed. 60 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 61 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 62 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 63 * @since 12 64 */ 65 ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64(const NativeResourceManager *mgr, uint32_t resId, 66 char **resultValue, uint64_t *resultLen, uint32_t density = 0); 67 68 /** 69 * @brief Obtains the Base64 code of the image resource. 70 * 71 * Obtains the Base64 code of the image resource corresponding to the specified resource ID. 72 * 73 * @param mgr Indicates the pointer to {@link NativeResourceManager} 74 * {@link OH_ResourceManager_InitNativeResourceManager}. 75 * @param resId Indicates the resource ID. 76 * @param resultValue the result write to resultValue. 77 * @param resultLen the media length write to resultLen. 78 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 79 * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 80 * @return {@link SUCCESS} 0 - Success. 81 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 82 * 1.Incorrect parameter types; 2.Parameter verification failed. 83 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 84 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 85 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 86 * @since 12 87 */ 88 ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64Data(const NativeResourceManager *mgr, uint32_t resId, 89 char **resultValue, uint64_t *resultLen, uint32_t density); 90 91 /** 92 * @brief Obtains the Base64 code of the image resource. 93 * 94 * Obtains the Base64 code of the image resource corresponding to the specified resource name. 95 * 96 * @param mgr Indicates the pointer to {@link NativeResourceManager} 97 * {@link OH_ResourceManager_InitNativeResourceManager}. 98 * @param resName Indicates the resource name. 99 * @param resultValue the result write to resultValue. 100 * @param resultLen the media length write to resultLen. 101 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 102 * to use the density of current system dpi. 103 * @return {@link SUCCESS} 0 - Success. 104 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 105 * 1.Incorrect parameter types; 2.Parameter verification failed. 106 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 107 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 108 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 109 * @since 12 110 */ 111 ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64ByName(const NativeResourceManager *mgr, 112 const char *resName, char **resultValue, uint64_t *resultLen, uint32_t density = 0); 113 114 /** 115 * @brief Obtains the Base64 code of the image resource. 116 * 117 * Obtains the Base64 code of the image resource corresponding to the specified resource name. 118 * 119 * @param mgr Indicates the pointer to {@link NativeResourceManager} 120 * {@link OH_ResourceManager_InitNativeResourceManager}. 121 * @param resName Indicates the resource name. 122 * @param resultValue the result write to resultValue. 123 * @param resultLen the media length write to resultLen. 124 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 125 * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 126 * @return {@link SUCCESS} 0 - Success. 127 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 128 * 1.Incorrect parameter types; 2.Parameter verification failed. 129 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 130 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 131 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 132 * @since 12 133 */ 134 ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64DataByName(const NativeResourceManager *mgr, 135 const char *resName, char **resultValue, uint64_t *resultLen, uint32_t density); 136 137 /** 138 * @brief Obtains the content of the image resource. 139 * 140 * Obtains the content of the specified screen density media file corresponding to a specified resource ID. 141 * 142 * @param mgr Indicates the pointer to {@link NativeResourceManager} 143 * {@link OH_ResourceManager_InitNativeResourceManager}. 144 * @param resId Indicates the resource ID. 145 * @param resultValue the result write to resultValue. 146 * @param resultLen the media length write to resultLen. 147 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 148 * to use the density of current system dpi. 149 * @return {@link SUCCESS} 0 - Success. 150 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 151 * 1.Incorrect parameter types; 2.Parameter verification failed. 152 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 153 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 154 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 155 * @since 12 156 */ 157 ResourceManager_ErrorCode OH_ResourceManager_GetMedia(const NativeResourceManager *mgr, uint32_t resId, 158 uint8_t **resultValue, uint64_t *resultLen, uint32_t density = 0); 159 160 /** 161 * @brief Obtains the content of the image resource. 162 * 163 * Obtains the content of the specified screen density media file corresponding to a specified resource ID. 164 * 165 * @param mgr Indicates the pointer to {@link NativeResourceManager} 166 * {@link OH_ResourceManager_InitNativeResourceManager}. 167 * @param resId Indicates the resource ID. 168 * @param resultValue the result write to resultValue. 169 * @param resultLen the media length write to resultLen. 170 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 171 * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 172 * @return {@link SUCCESS} 0 - Success. 173 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 174 * 1.Incorrect parameter types; 2.Parameter verification failed. 175 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 176 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 177 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 178 * @since 12 179 */ 180 ResourceManager_ErrorCode OH_ResourceManager_GetMediaData(const NativeResourceManager *mgr, uint32_t resId, 181 uint8_t **resultValue, uint64_t *resultLen, uint32_t density); 182 183 /** 184 * @brief Obtains the content of the image resource. 185 * 186 * Obtains the content of the specified screen density media file corresponding to a specified resource name. 187 * 188 * @param mgr Indicates the pointer to {@link NativeResourceManager} 189 * {@link OH_ResourceManager_InitNativeResourceManager}. 190 * @param resName Indicates the resource name. 191 * @param resultValue the result write to resultValue. 192 * @param resultLen the media length write to resultLen. 193 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 194 * to use the density of current system dpi. 195 * @return {@link SUCCESS} 0 - Success. 196 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 197 * 1.Incorrect parameter types; 2.Parameter verification failed. 198 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 199 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 200 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 201 * @since 12 202 */ 203 ResourceManager_ErrorCode OH_ResourceManager_GetMediaByName(const NativeResourceManager *mgr, const char *resName, 204 uint8_t **resultValue, uint64_t *resultLen, uint32_t density = 0); 205 206 /** 207 * @brief Obtains the content of the image resource. 208 * 209 * Obtains the content of the specified screen density media file corresponding to a specified resource name. 210 * 211 * @param mgr Indicates the pointer to {@link NativeResourceManager} 212 * {@link OH_ResourceManager_InitNativeResourceManager}. 213 * @param resName Indicates the resource name. 214 * @param resultValue the result write to resultValue. 215 * @param resultLen the media length write to resultLen. 216 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 217 * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 218 * @return {@link SUCCESS} 0 - Success. 219 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 220 * 1.Incorrect parameter types; 2.Parameter verification failed. 221 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 222 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 223 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 224 * @since 12 225 */ 226 ResourceManager_ErrorCode OH_ResourceManager_GetMediaDataByName(const NativeResourceManager *mgr, const char *resName, 227 uint8_t **resultValue, uint64_t *resultLen, uint32_t density); 228 229 /** 230 * @brief Obtains the DrawableDescriptor of the media file. 231 * 232 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource ID. 233 * 234 * @param mgr Indicates the pointer to {@link NativeResourceManager} 235 * {@link OH_ResourceManager_InitNativeResourceManager}. 236 * @param resId Indicates the resource ID. 237 * @param drawableDescriptor the result write to drawableDescriptor. 238 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 239 * to use the density of current system dpi. 240 * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media. 241 * @return {@link SUCCESS} 0 - Success. 242 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 243 * 1.Incorrect parameter types; 2.Parameter verification failed. 244 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 245 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 246 * @since 12 247 */ 248 ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptor(const NativeResourceManager *mgr, 249 uint32_t resId, ArkUI_DrawableDescriptor **drawableDescriptor, uint32_t density = 0, uint32_t type = 0); 250 251 /** 252 * @brief Obtains the DrawableDescriptor of the media file. 253 * 254 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource ID. 255 * 256 * @param mgr Indicates the pointer to {@link NativeResourceManager} 257 * {@link OH_ResourceManager_InitNativeResourceManager}. 258 * @param resId Indicates the resource ID. 259 * @param drawableDescriptor the result write to drawableDescriptor. 260 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 261 * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 262 * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media. 263 * If this attribute is not required, set this parameter to 0. 264 * @return {@link SUCCESS} 0 - Success. 265 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 266 * 1.Incorrect parameter types; 2.Parameter verification failed. 267 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 268 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 269 * @since 12 270 */ 271 ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorData(const NativeResourceManager *mgr, 272 uint32_t resId, ArkUI_DrawableDescriptor **drawableDescriptor, uint32_t density, uint32_t type); 273 274 /** 275 * @brief Obtains the DrawableDescriptor of the media file. 276 * 277 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource name. 278 * @param mgr Indicates the pointer to {@link NativeResourceManager} 279 * {@link OH_ResourceManager_InitNativeResourceManager}. 280 * @param resName Indicates the resource name. 281 * @param drawableDescriptor the result write to drawableDescriptor. 282 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 283 * to use the density of current system dpi. 284 * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media, 285 * 2 means the theme dynamic media. 286 * @return {@link SUCCESS} 0 - Success. 287 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 288 * 1.Incorrect parameter types; 2.Parameter verification failed. 289 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 290 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 291 * @since 12 292 */ 293 ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorByName(const NativeResourceManager *mgr, 294 const char *resName, ArkUI_DrawableDescriptor **drawableDescriptor, uint32_t density = 0, uint32_t type = 0); 295 296 /** 297 * @brief Obtains the DrawableDescriptor of the media file. 298 * 299 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource name. 300 * @param mgr Indicates the pointer to {@link NativeResourceManager} 301 * {@link OH_ResourceManager_InitNativeResourceManager}. 302 * @param resName Indicates the resource name. 303 * @param drawableDescriptor the result write to drawableDescriptor. 304 * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 305 * to use the density of current system dpi. If this attribute is not required, set this parameter to 0. 306 * @param type The optional parameter means the media type, 0 means the normal media, 1 means the the theme style media, 307 * 2 means the theme dynamic media. If this attribute is not required, set this parameter to 0. 308 * @return {@link SUCCESS} 0 - Success. 309 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. Possible causes: 310 * 1.Incorrect parameter types; 2.Parameter verification failed. 311 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 312 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 313 * @since 12 314 */ 315 ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorDataByName(const NativeResourceManager *mgr, 316 const char *resName, ArkUI_DrawableDescriptor **drawableDescriptor, uint32_t density, uint32_t type); 317 318 /** 319 * @brief Obtains the symbol resource. 320 * 321 * Obtains the symbol resource corresponding to the specified resource ID. 322 * 323 * @param mgr Indicates the pointer to {@link NativeResourceManager} 324 * {@link OH_ResourceManager_InitNativeResourceManager}. 325 * @param resId Indicates the resource ID. 326 * @param resultValue the result write to resultValue. 327 * @return {@link SUCCESS} 0 - Success. 328 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 329 Possible causes: Incorrect parameter types. 330 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 331 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 332 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 333 * @since 12 334 */ 335 ResourceManager_ErrorCode OH_ResourceManager_GetSymbol(const NativeResourceManager *mgr, uint32_t resId, 336 uint32_t *resultValue); 337 338 /** 339 * @brief Obtains the symbol resource. 340 * 341 * Obtains the symbol resource corresponding to the specified resource name. 342 * 343 * @param mgr Indicates the pointer to {@link NativeResourceManager} 344 * {@link OH_ResourceManager_InitNativeResourceManager}. 345 * @param resName Indicates the resource name. 346 * @param resultValue the result write to resultValue. 347 * @return {@link SUCCESS} 0 - Success. 348 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 349 Possible causes: Incorrect parameter types. 350 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 351 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 352 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 353 * @since 12 354 */ 355 ResourceManager_ErrorCode OH_ResourceManager_GetSymbolByName(const NativeResourceManager *mgr, const char *resName, 356 uint32_t *resultValue); 357 358 /** 359 * @brief Obtains locales list. 360 * 361 * You need to call the OH_ResourceManager_ReleaseStringArray() method to release the memory of localinfo. 362 * 363 * @param mgr Indicates the pointer to {@link NativeResourceManager} 364 * {@link OH_ResourceManager_InitNativeResourceManager}. 365 * @param resultValue the result write to resultValue. 366 * @param resultLen the locales length write to resultLen. 367 * @param includeSystem the parameter controls whether to include system resources, 368 * the default value is false, it has no effect when only system resources query the locales list. 369 * @return {@link SUCCESS} 0 - Success. 370 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 371 Possible causes: Incorrect parameter types. 372 * {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 373 * @since 12 374 */ 375 ResourceManager_ErrorCode OH_ResourceManager_GetLocales(const NativeResourceManager *mgr, char ***resultValue, 376 uint32_t *resultLen, bool includeSystem = false); 377 378 /** 379 * @brief Obtains locales list. 380 * 381 * You need to call the OH_ResourceManager_ReleaseStringArray() method to release the memory of localinfo. 382 * 383 * @param mgr Indicates the pointer to {@link NativeResourceManager} 384 * {@link OH_ResourceManager_InitNativeResourceManager}. 385 * @param resultValue the result write to resultValue. 386 * @param resultLen the locales length write to resultLen. 387 * @param includeSystem the parameter controls whether to include system resources. 388 * If this attribute is not required, set this parameter to false. 389 * @return {@link SUCCESS} 0 - Success. 390 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 391 Possible causes: Incorrect parameter types. 392 * {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 393 * @since 12 394 */ 395 ResourceManager_ErrorCode OH_ResourceManager_GetLocalesData(const NativeResourceManager *mgr, char ***resultValue, 396 uint32_t *resultLen, bool includeSystem); 397 398 /** 399 * @brief Obtains the device configuration. 400 * 401 * You need to call the OH_ResourceManager_ReleaseConfiguration() method to release the memory. 402 * If you use malloc to create a ResourceManager_Configuration object, you also need to call free to release it. 403 * 404 * @param mgr Indicates the pointer to {@link NativeResourceManager} 405 * {@link OH_ResourceManager_InitNativeResourceManager}. 406 * @param configuration the result write to ResourceManager_Configuration. 407 * @return {@link SUCCESS} 0 - Success. 408 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 409 Possible causes: Incorrect parameter types. 410 {@link ERROR_CODE_SYSTEM_RES_MANAGER_GET_FAILED} 9001009 - If failed to access the system resource. 411 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 412 * @since 12 413 * @deprecated since 20 414 * @useinstead OH_ResourceManager_GetResourceConfiguration 415 */ 416 ResourceManager_ErrorCode OH_ResourceManager_GetConfiguration(const NativeResourceManager *mgr, 417 ResourceManager_Configuration *configuration); 418 419 /** 420 * @brief Obtains the device configuration. 421 * 422 * You need to call the OH_ResourceManager_ReleaseConfiguration() method to release the memory. 423 * If you use malloc to create a ResourceManager_Configuration object, you also need to call free to release it. 424 * 425 * @param {NativeResourceManager} mgr Indicates the pointer to {@link NativeResourceManager} 426 * {@link OH_ResourceManager_InitNativeResourceManager}. 427 * @param {ResourceManager_Configuration} configuration the result write to ResourceManager_Configuration. 428 * @return {@link SUCCESS} 0 - Success. 429 {@link ERROR_CODE_SYSTEM_RES_MANAGER_GET_FAILED} 9001009 - If failed to access the system resource. 430 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 431 * @since 20 432 */ 433 ResourceManager_ErrorCode OH_ResourceManager_GetResourceConfiguration(const NativeResourceManager *mgr, 434 ResourceManager_Configuration *configuration); 435 436 /** 437 * @brief Release the device configuration. 438 * @param configuration the object need to release. 439 * @return {@link SUCCESS} 0 - Success. 440 {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 441 Possible causes: Incorrect parameter types. 442 * @since 12 443 */ 444 ResourceManager_ErrorCode OH_ResourceManager_ReleaseConfiguration(ResourceManager_Configuration *configuration); 445 446 /** 447 * @brief Obtains the character string. 448 * 449 * Obtains the character string corresponding to a specified resource ID. 450 * Obtain normal resource by calling OH_ResourceManager_GetString(mgr, resId, resultValue), 451 obtain a formatted resource with replacements for %d, %s, %f, 452 call OH_ResourceManager_GetString(mgr, resId, resultValue, 10, "format", 10.10). 453 * You need to call free() to release the memory for the string. 454 * 455 * @param mgr Indicates the pointer to {@link NativeResourceManager} 456 * {@link OH_ResourceManager_InitNativeResourceManager}. 457 * @param resId Indicates the resource ID. 458 * @param resultValue the result write to resultValue. 459 * @param { const char* | int | float } args - Indicates the formatting string resource parameters. 460 * @return {@link SUCCESS} 0 - Success. 461 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 462 Possible causes: Incorrect parameter types. 463 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 464 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 465 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 466 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 467 * @since 12 468 */ 469 ResourceManager_ErrorCode OH_ResourceManager_GetString(const NativeResourceManager *mgr, uint32_t resId, 470 char **resultValue, ...); 471 472 /** 473 * @brief Obtains the character string. 474 * 475 * Obtains the character string corresponding to a specified resource name. 476 * Obtain normal resource by calling OH_ResourceManager_GetString(mgr, resName, resultValue), 477 obtain a formatted resource with replacements for %d, %s, %f, 478 call OH_ResourceManager_GetString(mgr, resName, resultValue, 10, "format", 10.10). 479 * You need to call free() to release the memory for the string. 480 * 481 * @param mgr Indicates the pointer to {@link NativeResourceManager} 482 * {@link OH_ResourceManager_InitNativeResourceManager}. 483 * @param resName Indicates the resource name. 484 * @param resultValue the result write to resultValue. 485 * @param { const char* | int | float } args - Indicates the formatting string resource parameters. 486 * @return {@link SUCCESS} 0 - Success. 487 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 488 Possible causes: Incorrect parameter types. 489 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 490 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 491 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 492 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 493 * @since 12 494 */ 495 ResourceManager_ErrorCode OH_ResourceManager_GetStringByName(const NativeResourceManager *mgr, const char *resName, 496 char **resultValue, ...); 497 498 /** 499 * @brief Obtains the array of character strings. 500 * 501 * Obtains the array of character strings corresponding to a specified resource ID. 502 * You need to call the OH_ResourceManager_ReleaseStringArray() method to release the memory of string array. 503 * 504 * @param mgr Indicates the pointer to {@link NativeResourceManager} 505 * {@link OH_ResourceManager_InitNativeResourceManager}. 506 * @param resId Indicates the resource ID. 507 * @param resultValue the result write to resultValue. 508 * @param resultLen the StringArray length write to resultLen. 509 * @return {@link SUCCESS} 0 - Success. 510 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 511 Possible causes: Incorrect parameter types. 512 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 513 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 514 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 515 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 516 * @since 12 517 */ 518 ResourceManager_ErrorCode OH_ResourceManager_GetStringArray(const NativeResourceManager *mgr, uint32_t resId, 519 char ***resultValue, uint32_t *resultLen); 520 521 /** 522 * @brief Obtains the array of character strings. 523 * 524 * Obtains the array of character strings corresponding to a specified resource name. 525 * You need to call the OH_ResourceManager_ReleaseStringArray() method to release the memory of string array. 526 * 527 * @param mgr Indicates the pointer to {@link NativeResourceManager} 528 * {@link OH_ResourceManager_InitNativeResourceManager}. 529 * @param resName Indicates the resource name. 530 * @param resultValue the result write to resultValue. 531 * @param resultLen the StringArray length write to resultLen. 532 * @return {@link SUCCESS} 0 - Success. 533 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 534 Possible causes: Incorrect parameter types. 535 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 536 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 537 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 538 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 539 * @since 12 540 */ 541 ResourceManager_ErrorCode OH_ResourceManager_GetStringArrayByName(const NativeResourceManager *mgr, 542 const char *resName, char ***resultValue, uint32_t *resultLen); 543 544 /** 545 * @brief Release the array of character strings. 546 * @param resValue the array of character strings corresponding to the specified resource name. 547 * @param len the length of array. 548 * @return {@link SUCCESS} 0 - Success. 549 {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 550 Possible causes: Incorrect parameter types. 551 * @since 12 552 */ 553 ResourceManager_ErrorCode OH_ResourceManager_ReleaseStringArray(char ***resValue, uint32_t len); 554 555 /** 556 * @brief Obtains the singular-plural character string represented. 557 * 558 * Obtains the singular-plural character string represented by the ID string corresponding to the specified number. 559 * You need to call free() to release the memory for the string. 560 * 561 * @param mgr Indicates the pointer to {@link NativeResourceManager} 562 * {@link OH_ResourceManager_InitNativeResourceManager}. 563 * @param resId Indicates the resource ID. 564 * @param num - Indicates the number. 565 * @param resultValue the result write to resultValue. 566 * @return {@link SUCCESS} 0 - Success. 567 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 568 Possible causes: Incorrect parameter types. 569 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 570 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 571 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 572 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 573 * @since 12 574 * @deprecated since 18 575 * @useinstead OH_ResourceManager_GetIntPluralString 576 */ 577 ResourceManager_ErrorCode OH_ResourceManager_GetPluralString(const NativeResourceManager *mgr, uint32_t resId, 578 uint32_t num, char **resultValue); 579 580 /** 581 * @brief Obtains the singular-plural character string represented. 582 * 583 * Obtains the singular-plural character string represented by the Name string corresponding to the specified number. 584 * You need to call free() to release the memory for the string. 585 * 586 * @param mgr Indicates the pointer to {@link NativeResourceManager} 587 * {@link OH_ResourceManager_InitNativeResourceManager}. 588 * @param resName Indicates the resource name. 589 * @param num - Indicates the number. 590 * @param resultValue the result write to resultValue. 591 * @return {@link SUCCESS} 0 - Success. 592 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 593 Possible causes: Incorrect parameter types. 594 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 595 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 596 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 597 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 598 * @since 12 599 * @deprecated since 18 600 * @useinstead OH_ResourceManager_GetIntPluralStringByName 601 */ 602 ResourceManager_ErrorCode OH_ResourceManager_GetPluralStringByName(const NativeResourceManager *mgr, 603 const char *resName, uint32_t num, char **resultValue); 604 605 /** 606 * @brief Obtains the singular-plural character string represented. 607 * 608 * Obtains the singular-plural character string represented by the ID string corresponding to the specified number. 609 * You need to call free() to release the memory for the string. 610 * 611 * @param mgr Indicates the pointer to {@link NativeResourceManager} 612 * {@link OH_ResourceManager_InitNativeResourceManager}. 613 * @param resId Indicates the resource ID. 614 * @param num - an integer used to get the correct string for the current plural rules. 615 * @param resultValue the result write to resultValue. 616 * @param { const char* | int | float } args - Indicates the formatting string resource parameters. 617 * @return {@link SUCCESS} 0 - Success. 618 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 619 Possible causes: Incorrect parameter types. 620 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 621 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 622 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 623 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 624 * @since 18 625 */ 626 ResourceManager_ErrorCode OH_ResourceManager_GetIntPluralString(const NativeResourceManager *mgr, uint32_t resId, 627 uint32_t num, char **resultValue, ...); 628 629 /** 630 * @brief Obtains the singular-plural character string represented. 631 * 632 * Obtains the singular-plural character string represented by the ID string corresponding to the specified number. 633 * You need to call free() to release the memory for the string. 634 * 635 * @param mgr Indicates the pointer to {@link NativeResourceManager} 636 * {@link OH_ResourceManager_InitNativeResourceManager}. 637 * @param resId Indicates the resource ID. 638 * @param num - a double parameter used to get the correct string for the current plural rules. 639 * @param resultValue the result write to resultValue. 640 * @param { const char* | int | float } args - Indicates the formatting string resource parameters. 641 * @return {@link SUCCESS} 0 - Success. 642 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 643 Possible causes: Incorrect parameter types. 644 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 645 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 646 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 647 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 648 * @since 18 649 */ 650 ResourceManager_ErrorCode OH_ResourceManager_GetDoublePluralString(const NativeResourceManager *mgr, uint32_t resId, 651 double num, char **resultValue, ...); 652 653 /** 654 * @brief Obtains the singular-plural character string represented. 655 * 656 * Obtains the singular-plural character string represented by the Name string corresponding to the specified number. 657 * You need to call free() to release the memory for the string. 658 * 659 * @param mgr Indicates the pointer to {@link NativeResourceManager} 660 * {@link OH_ResourceManager_InitNativeResourceManager}. 661 * @param resName Indicates the resource name. 662 * @param num - an integer used to get the correct string for the current plural rules. 663 * @param resultValue the result write to resultValue. 664 * @param { const char* | int | float } args - Indicates the formatting string resource parameters. 665 * @return {@link SUCCESS} 0 - Success. 666 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 667 Possible causes: Incorrect parameter types. 668 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 669 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 670 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 671 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 672 * @since 18 673 */ 674 ResourceManager_ErrorCode OH_ResourceManager_GetIntPluralStringByName(const NativeResourceManager *mgr, 675 const char *resName, uint32_t num, char **resultValue, ...); 676 677 /** 678 * @brief Obtains the singular-plural character string represented. 679 * 680 * Obtains the singular-plural character string represented by the Name string corresponding to the specified number. 681 * You need to call free() to release the memory for the string. 682 * 683 * @param mgr Indicates the pointer to {@link NativeResourceManager} 684 * {@link OH_ResourceManager_InitNativeResourceManager}. 685 * @param resName Indicates the resource name. 686 * @param num - a double parameter used to get the correct string for the current plural rules. 687 * @param resultValue the result write to resultValue. 688 * @param { const char* | int | float } args - Indicates the formatting string resource parameters. 689 * @return {@link SUCCESS} 0 - Success. 690 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 691 Possible causes: Incorrect parameter types. 692 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 693 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 694 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 695 {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory. 696 * @since 18 697 */ 698 ResourceManager_ErrorCode OH_ResourceManager_GetDoublePluralStringByName(const NativeResourceManager *mgr, 699 const char *resName, double num, char **resultValue, ...); 700 701 /** 702 * @brief Obtains the color resource. 703 * 704 * Obtains the color resource corresponding to the specified resource ID. 705 * 706 * @param mgr Indicates the pointer to {@link NativeResourceManager} 707 * {@link OH_ResourceManager_InitNativeResourceManager}. 708 * @param resId Indicates the resource ID. 709 * @param resultValue the result write to resultValue. 710 * @return {@link SUCCESS} 0 - Success. 711 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 712 Possible causes: Incorrect parameter types. 713 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 714 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 715 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 716 * @since 12 717 */ 718 ResourceManager_ErrorCode OH_ResourceManager_GetColor(const NativeResourceManager *mgr, uint32_t resId, 719 uint32_t *resultValue); 720 721 /** 722 * @brief Obtains the color resource. 723 * 724 * Obtains the color resource corresponding to the specified resource name. 725 * 726 * @param mgr Indicates the pointer to {@link NativeResourceManager} 727 * {@link OH_ResourceManager_InitNativeResourceManager}. 728 * @param resName Indicates the resource name. 729 * @param resultValue the result write to resultValue. 730 * @return {@link SUCCESS} 0 - Success. 731 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 732 Possible causes: Incorrect parameter types. 733 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 734 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 735 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 736 * @since 12 737 */ 738 ResourceManager_ErrorCode OH_ResourceManager_GetColorByName(const NativeResourceManager *mgr, const char *resName, 739 uint32_t *resultValue); 740 741 /** 742 * @brief Obtains the Int resource. 743 * 744 * Obtains the Int resource corresponding to the specified resource ID. 745 * 746 * @param mgr Indicates the pointer to {@link NativeResourceManager} 747 * {@link OH_ResourceManager_InitNativeResourceManager}. 748 * @param resId Indicates the resource ID. 749 * @param resultValue the result write to resultValue. 750 * @return {@link SUCCESS} 0 - Success. 751 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 752 Possible causes: Incorrect parameter types. 753 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 754 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 755 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 756 * @since 12 757 */ 758 ResourceManager_ErrorCode OH_ResourceManager_GetInt(const NativeResourceManager *mgr, uint32_t resId, 759 int *resultValue); 760 761 /** 762 * @brief Obtains the Int resource. 763 * 764 * Obtains the Int resource corresponding to the specified resource name. 765 * 766 * @param mgr Indicates the pointer to {@link NativeResourceManager} 767 * {@link OH_ResourceManager_InitNativeResourceManager}. 768 * @param resName Indicates the resource name. 769 * @param resultValue the result write to resultValue. 770 * @return {@link SUCCESS} 0 - Success. 771 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 772 Possible causes: Incorrect parameter types. 773 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 774 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 775 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 776 * @since 12 777 */ 778 ResourceManager_ErrorCode OH_ResourceManager_GetIntByName(const NativeResourceManager *mgr, const char *resName, 779 int *resultValue); 780 781 /** 782 * @brief Obtains the Float resource. 783 * 784 * Obtains the Int resource corresponding to the specified resource ID. 785 * 786 * @param mgr Indicates the pointer to {@link NativeResourceManager} 787 * {@link OH_ResourceManager_InitNativeResourceManager}. 788 * @param resId Indicates the resource ID. 789 * @param resultValue the result write to resultValue. 790 * @return {@link SUCCESS} 0 - Success. 791 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 792 Possible causes: Incorrect parameter types. 793 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 794 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 795 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 796 * @since 12 797 */ 798 ResourceManager_ErrorCode OH_ResourceManager_GetFloat(const NativeResourceManager *mgr, uint32_t resId, 799 float *resultValue); 800 801 /** 802 * @brief Obtains the Float resource. 803 * 804 * Obtains the Float resource corresponding to the specified resource name. 805 * 806 * @param mgr Indicates the pointer to {@link NativeResourceManager} 807 * {@link OH_ResourceManager_InitNativeResourceManager}. 808 * @param resName Indicates the resource name. 809 * @param resultValue the result write to resultValue. 810 * @return {@link SUCCESS} 0 - Success. 811 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 812 Possible causes: Incorrect parameter types. 813 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 814 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 815 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 816 * @since 12 817 */ 818 ResourceManager_ErrorCode OH_ResourceManager_GetFloatByName(const NativeResourceManager *mgr, const char *resName, 819 float *resultValue); 820 821 /** 822 * @brief Obtains the boolean result. 823 * 824 * Obtains the boolean result with a specified resource ID. 825 * 826 * @param mgr Indicates the pointer to {@link NativeResourceManager} 827 * {@link OH_ResourceManager_InitNativeResourceManager}. 828 * @param resId Indicates the resource ID. 829 * @param resultValue the result write to resultValue. 830 * @return {@link SUCCESS} 0 - Success. 831 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 832 Possible causes: Incorrect parameter types. 833 {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID. 834 {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID. 835 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 836 * @since 12 837 */ 838 ResourceManager_ErrorCode OH_ResourceManager_GetBool(const NativeResourceManager *mgr, uint32_t resId, 839 bool *resultValue); 840 841 /** 842 * @brief Obtains the boolean result. 843 * 844 * Obtains the boolean result with a specified resource name. 845 * 846 * @param mgr Indicates the pointer to {@link NativeResourceManager} 847 * {@link OH_ResourceManager_InitNativeResourceManager}. 848 * @param resName Indicates the resource name. 849 * @param resultValue the result write to resultValue. 850 * @return {@link SUCCESS} 0 - Success. 851 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 852 Possible causes: Incorrect parameter types. 853 {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name. 854 {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name. 855 {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically. 856 * @since 12 857 */ 858 ResourceManager_ErrorCode OH_ResourceManager_GetBoolByName(const NativeResourceManager *mgr, const char *resName, 859 bool *resultValue); 860 861 /** 862 * @brief Add overlay resources during application runtime. 863 * @param mgr Indicates the pointer to {@link NativeResourceManager} 864 * {@link OH_ResourceManager_InitNativeResourceManager}. 865 * @param path Indicates the application overlay path. 866 * @return {@link SUCCESS} 0 - Success. 867 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 868 Possible causes: Incorrect parameter types. 869 {@link ERROR_CODE_OVERLAY_RES_PATH_INVALID} 9001010 - Invalid overlay path. 870 * @since 12 871 */ 872 ResourceManager_ErrorCode OH_ResourceManager_AddResource(const NativeResourceManager *mgr, const char *path); 873 874 /** 875 * @brief Remove overlay resources during application runtime. 876 * @param mgr Indicates the pointer to {@link NativeResourceManager} 877 * {@link OH_ResourceManager_InitNativeResourceManager}. 878 * @param path Indicates the application overlay path. 879 * @return {@link SUCCESS} 0 - Success. 880 * {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid. 881 Possible causes: Incorrect parameter types. 882 {@link ERROR_CODE_OVERLAY_RES_PATH_INVALID} 9001010 - Invalid overlay path. 883 * @since 12 884 */ 885 ResourceManager_ErrorCode OH_ResourceManager_RemoveResource(const NativeResourceManager *mgr, const char *path); 886 #ifdef __cplusplus 887 }; 888 #endif 889 890 /** @} */ 891 #endif // GLOBAL_OH_RESMGR_H