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