• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  */
414 ResourceManager_ErrorCode OH_ResourceManager_GetConfiguration(const NativeResourceManager *mgr,
415     ResourceManager_Configuration *configuration);
416 
417 /**
418  * @brief Release the device configuration.
419  * @param configuration the object need to release.
420  * @return {@link SUCCESS} 0 - Success.
421            {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
422            Possible causes: Incorrect parameter types.
423  * @since 12
424  */
425 ResourceManager_ErrorCode OH_ResourceManager_ReleaseConfiguration(ResourceManager_Configuration *configuration);
426 
427 /**
428  * @brief Obtains the character string.
429  *
430  * Obtains the character string corresponding to a specified resource ID.
431  * Obtain normal resource by calling OH_ResourceManager_GetString(mgr, resId, resultValue),
432    obtain a formatted resource with replacements for %d, %s, %f,
433    call OH_ResourceManager_GetString(mgr, resId, resultValue, 10, "format", 10.10).
434  * You need to call free() to release the memory for the string.
435  *
436  * @param mgr Indicates the pointer to {@link NativeResourceManager}
437  *        {@link OH_ResourceManager_InitNativeResourceManager}.
438  * @param resId Indicates the resource ID.
439  * @param resultValue the result write to resultValue.
440  * @param { const char* | int | float } args - Indicates the formatting string resource parameters.
441  * @return {@link SUCCESS} 0 - Success.
442  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
443            Possible causes: Incorrect parameter types.
444            {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID.
445            {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID.
446            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
447            {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory.
448  * @since 12
449  */
450 ResourceManager_ErrorCode OH_ResourceManager_GetString(const NativeResourceManager *mgr, uint32_t resId,
451     char **resultValue, ...);
452 
453 /**
454  * @brief Obtains the character string.
455  *
456  * Obtains the character string corresponding to a specified resource name.
457  * Obtain normal resource by calling OH_ResourceManager_GetString(mgr, resName, resultValue),
458    obtain a formatted resource with replacements for %d, %s, %f,
459    call OH_ResourceManager_GetString(mgr, resName, resultValue, 10, "format", 10.10).
460  * You need to call free() to release the memory for the string.
461  *
462  * @param mgr Indicates the pointer to {@link NativeResourceManager}
463  *        {@link OH_ResourceManager_InitNativeResourceManager}.
464  * @param resName Indicates the resource name.
465  * @param resultValue the result write to resultValue.
466  * @param { const char* | int | float } args - Indicates the formatting string resource parameters.
467  * @return {@link SUCCESS} 0 - Success.
468  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
469            Possible causes: Incorrect parameter types.
470            {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name.
471            {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name.
472            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
473            {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory.
474  * @since 12
475  */
476 ResourceManager_ErrorCode OH_ResourceManager_GetStringByName(const NativeResourceManager *mgr, const char *resName,
477     char **resultValue, ...);
478 
479 /**
480  * @brief Obtains the array of character strings.
481  *
482  * Obtains the array of character strings corresponding to a specified resource ID.
483  * You need to call the OH_ResourceManager_ReleaseStringArray() method to release the memory of string array.
484  *
485  * @param mgr Indicates the pointer to {@link NativeResourceManager}
486  *        {@link OH_ResourceManager_InitNativeResourceManager}.
487  * @param resId Indicates the resource ID.
488  * @param resultValue the result write to resultValue.
489  * @param resultLen the StringArray length write to resultLen.
490  * @return {@link SUCCESS} 0 - Success.
491  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
492            Possible causes: Incorrect parameter types.
493            {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID.
494            {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID.
495            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
496            {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory.
497  * @since 12
498  */
499 ResourceManager_ErrorCode OH_ResourceManager_GetStringArray(const NativeResourceManager *mgr, uint32_t resId,
500     char ***resultValue, uint32_t *resultLen);
501 
502 /**
503  * @brief Obtains the array of character strings.
504  *
505  * Obtains the array of character strings corresponding to a specified resource name.
506  * You need to call the OH_ResourceManager_ReleaseStringArray() method to release the memory of string array.
507  *
508  * @param mgr Indicates the pointer to {@link NativeResourceManager}
509  *        {@link OH_ResourceManager_InitNativeResourceManager}.
510  * @param resName Indicates the resource name.
511  * @param resultValue the result write to resultValue.
512  * @param resultLen the StringArray length write to resultLen.
513  * @return {@link SUCCESS} 0 - Success.
514  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
515            Possible causes: Incorrect parameter types.
516            {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name.
517            {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name.
518            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
519            {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory.
520  * @since 12
521  */
522 ResourceManager_ErrorCode OH_ResourceManager_GetStringArrayByName(const NativeResourceManager *mgr,
523     const char *resName, char ***resultValue, uint32_t *resultLen);
524 
525 /**
526  * @brief Release the array of character strings.
527  * @param resValue the array of character strings corresponding to the specified resource name.
528  * @param len the length of array.
529  * @return {@link SUCCESS} 0 - Success.
530            {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
531            Possible causes: Incorrect parameter types.
532  * @since 12
533  */
534 ResourceManager_ErrorCode OH_ResourceManager_ReleaseStringArray(char ***resValue, uint32_t len);
535 
536 /**
537  * @brief Obtains the singular-plural character string represented.
538  *
539  * Obtains the singular-plural character string represented by the ID string corresponding to the specified number.
540  * You need to call free() to release the memory for the string.
541  *
542  * @param mgr Indicates the pointer to {@link NativeResourceManager}
543  *        {@link OH_ResourceManager_InitNativeResourceManager}.
544  * @param resId Indicates the resource ID.
545  * @param num - Indicates the number.
546  * @param resultValue the result write to resultValue.
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            {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID.
551            {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID.
552            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
553            {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory.
554  * @since 12
555  * @deprecated since 18
556  * @useinstead OH_ResourceManager_GetIntPluralString
557  */
558 ResourceManager_ErrorCode OH_ResourceManager_GetPluralString(const NativeResourceManager *mgr, uint32_t resId,
559     uint32_t num, char **resultValue);
560 
561 /**
562  * @brief Obtains the singular-plural character string represented.
563  *
564  * Obtains the singular-plural character string represented by the Name string corresponding to the specified number.
565  * You need to call free() to release the memory for the string.
566  *
567  * @param mgr Indicates the pointer to {@link NativeResourceManager}
568  *        {@link OH_ResourceManager_InitNativeResourceManager}.
569  * @param resName Indicates the resource name.
570  * @param num - Indicates the number.
571  * @param resultValue the result write to resultValue.
572  * @return {@link SUCCESS} 0 - Success.
573  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
574            Possible causes: Incorrect parameter types.
575            {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name.
576            {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name.
577            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
578            {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory.
579  * @since 12
580  * @deprecated since 18
581  * @useinstead OH_ResourceManager_GetIntPluralStringByName
582  */
583 ResourceManager_ErrorCode OH_ResourceManager_GetPluralStringByName(const NativeResourceManager *mgr,
584     const char *resName, uint32_t num, char **resultValue);
585 
586 /**
587  * @brief Obtains the singular-plural character string represented.
588  *
589  * Obtains the singular-plural character string represented by the ID string corresponding to the specified number.
590  * You need to call free() to release the memory for the string.
591  *
592  * @param mgr Indicates the pointer to {@link NativeResourceManager}
593  *        {@link OH_ResourceManager_InitNativeResourceManager}.
594  * @param resId Indicates the resource ID.
595  * @param num - an integer used to get the correct string for the current plural rules.
596  * @param resultValue the result write to resultValue.
597  * @param { const char* | int | float } args - Indicates the formatting string resource parameters.
598  * @return {@link SUCCESS} 0 - Success.
599  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
600            Possible causes: Incorrect parameter types.
601            {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID.
602            {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID.
603            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
604            {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory.
605  * @since 18
606  */
607 ResourceManager_ErrorCode OH_ResourceManager_GetIntPluralString(const NativeResourceManager *mgr, uint32_t resId,
608     uint32_t num, char **resultValue, ...);
609 
610 /**
611  * @brief Obtains the singular-plural character string represented.
612  *
613  * Obtains the singular-plural character string represented by the ID string corresponding to the specified number.
614  * You need to call free() to release the memory for the string.
615  *
616  * @param mgr Indicates the pointer to {@link NativeResourceManager}
617  *        {@link OH_ResourceManager_InitNativeResourceManager}.
618  * @param resId Indicates the resource ID.
619  * @param num - a double parameter used to get the correct string for the current plural rules.
620  * @param resultValue the result write to resultValue.
621  * @param { const char* | int | float } args - Indicates the formatting string resource parameters.
622  * @return {@link SUCCESS} 0 - Success.
623  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
624            Possible causes: Incorrect parameter types.
625            {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID.
626            {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID.
627            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
628            {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory.
629  * @since 18
630  */
631 ResourceManager_ErrorCode OH_ResourceManager_GetDoublePluralString(const NativeResourceManager *mgr, uint32_t resId,
632     double num, char **resultValue, ...);
633 
634 /**
635  * @brief Obtains the singular-plural character string represented.
636  *
637  * Obtains the singular-plural character string represented by the Name string corresponding to the specified number.
638  * You need to call free() to release the memory for the string.
639  *
640  * @param mgr Indicates the pointer to {@link NativeResourceManager}
641  *        {@link OH_ResourceManager_InitNativeResourceManager}.
642  * @param resName Indicates the resource name.
643  * @param num - an integer used to get the correct string for the current plural rules.
644  * @param resultValue the result write to resultValue.
645  * @param { const char* | int | float } args - Indicates the formatting string resource parameters.
646  * @return {@link SUCCESS} 0 - Success.
647  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
648            Possible causes: Incorrect parameter types.
649            {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name.
650            {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name.
651            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
652            {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory.
653  * @since 18
654  */
655 ResourceManager_ErrorCode OH_ResourceManager_GetIntPluralStringByName(const NativeResourceManager *mgr,
656     const char *resName, uint32_t num, char **resultValue, ...);
657 
658 /**
659  * @brief Obtains the singular-plural character string represented.
660  *
661  * Obtains the singular-plural character string represented by the Name string corresponding to the specified number.
662  * You need to call free() to release the memory for the string.
663  *
664  * @param mgr Indicates the pointer to {@link NativeResourceManager}
665  *        {@link OH_ResourceManager_InitNativeResourceManager}.
666  * @param resName Indicates the resource name.
667  * @param num - a double parameter used to get the correct string for the current plural rules.
668  * @param resultValue the result write to resultValue.
669  * @param { const char* | int | float } args - Indicates the formatting string resource parameters.
670  * @return {@link SUCCESS} 0 - Success.
671  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
672            Possible causes: Incorrect parameter types.
673            {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name.
674            {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name.
675            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
676            {@link ERROR_CODE_OUT_OF_MEMORY} 9001100 - Out of memory.
677  * @since 18
678  */
679 ResourceManager_ErrorCode OH_ResourceManager_GetDoublePluralStringByName(const NativeResourceManager *mgr,
680     const char *resName, double num, char **resultValue, ...);
681 
682 /**
683  * @brief Obtains the color resource.
684  *
685  * Obtains the color resource corresponding to the specified resource ID.
686  *
687  * @param mgr Indicates the pointer to {@link NativeResourceManager}
688  *        {@link OH_ResourceManager_InitNativeResourceManager}.
689  * @param resId Indicates the resource ID.
690  * @param resultValue the result write to resultValue.
691  * @return {@link SUCCESS} 0 - Success.
692  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
693            Possible causes: Incorrect parameter types.
694            {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID.
695            {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID.
696            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
697  * @since 12
698  */
699 ResourceManager_ErrorCode OH_ResourceManager_GetColor(const NativeResourceManager *mgr, uint32_t resId,
700     uint32_t *resultValue);
701 
702 /**
703  * @brief Obtains the color resource.
704  *
705  * Obtains the color resource corresponding to the specified resource name.
706  *
707  * @param mgr Indicates the pointer to {@link NativeResourceManager}
708  *        {@link OH_ResourceManager_InitNativeResourceManager}.
709  * @param resName Indicates the resource name.
710  * @param resultValue the result write to resultValue.
711  * @return {@link SUCCESS} 0 - Success.
712  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
713            Possible causes: Incorrect parameter types.
714            {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name.
715            {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name.
716            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
717  * @since 12
718  */
719 ResourceManager_ErrorCode OH_ResourceManager_GetColorByName(const NativeResourceManager *mgr, const char *resName,
720     uint32_t *resultValue);
721 
722 /**
723  * @brief Obtains the Int resource.
724  *
725  * Obtains the Int resource corresponding to the specified resource ID.
726  *
727  * @param mgr Indicates the pointer to {@link NativeResourceManager}
728  *        {@link OH_ResourceManager_InitNativeResourceManager}.
729  * @param resId Indicates the resource ID.
730  * @param resultValue the result write to resultValue.
731  * @return {@link SUCCESS} 0 - Success.
732  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
733            Possible causes: Incorrect parameter types.
734            {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID.
735            {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID.
736            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
737  * @since 12
738  */
739 ResourceManager_ErrorCode OH_ResourceManager_GetInt(const NativeResourceManager *mgr, uint32_t resId,
740     int *resultValue);
741 
742 /**
743  * @brief Obtains the Int resource.
744  *
745  * Obtains the Int resource corresponding to the specified resource name.
746  *
747  * @param mgr Indicates the pointer to {@link NativeResourceManager}
748  *        {@link OH_ResourceManager_InitNativeResourceManager}.
749  * @param resName Indicates the resource name.
750  * @param resultValue the result write to resultValue.
751  * @return {@link SUCCESS} 0 - Success.
752  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
753            Possible causes: Incorrect parameter types.
754            {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name.
755            {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name.
756            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
757  * @since 12
758  */
759 ResourceManager_ErrorCode OH_ResourceManager_GetIntByName(const NativeResourceManager *mgr, const char *resName,
760     int *resultValue);
761 
762 /**
763  * @brief Obtains the Float resource.
764  *
765  * Obtains the Int resource corresponding to the specified resource ID.
766  *
767  * @param mgr Indicates the pointer to {@link NativeResourceManager}
768  *        {@link OH_ResourceManager_InitNativeResourceManager}.
769  * @param resId Indicates the resource ID.
770  * @param resultValue the result write to resultValue.
771  * @return {@link SUCCESS} 0 - Success.
772  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
773            Possible causes: Incorrect parameter types.
774            {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID.
775            {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID.
776            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
777  * @since 12
778  */
779 ResourceManager_ErrorCode OH_ResourceManager_GetFloat(const NativeResourceManager *mgr, uint32_t resId,
780     float *resultValue);
781 
782 /**
783  * @brief Obtains the Float resource.
784  *
785  * Obtains the Float resource corresponding to the specified resource name.
786  *
787  * @param mgr Indicates the pointer to {@link NativeResourceManager}
788  *        {@link OH_ResourceManager_InitNativeResourceManager}.
789  * @param resName Indicates the resource name.
790  * @param resultValue the result write to resultValue.
791  * @return {@link SUCCESS} 0 - Success.
792  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
793            Possible causes: Incorrect parameter types.
794            {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name.
795            {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name.
796            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
797  * @since 12
798  */
799 ResourceManager_ErrorCode OH_ResourceManager_GetFloatByName(const NativeResourceManager *mgr, const char *resName,
800     float *resultValue);
801 
802 /**
803  * @brief Obtains the boolean result.
804  *
805  * Obtains the boolean result with a specified resource ID.
806  *
807  * @param mgr Indicates the pointer to {@link NativeResourceManager}
808  *        {@link OH_ResourceManager_InitNativeResourceManager}.
809  * @param resId Indicates the resource ID.
810  * @param resultValue the result write to resultValue.
811  * @return {@link SUCCESS} 0 - Success.
812  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
813            Possible causes: Incorrect parameter types.
814            {@link ERROR_CODE_RES_ID_NOT_FOUND} 9001001 - Invalid resource ID.
815            {@link ERROR_CODE_RES_NOT_FOUND_BY_ID} 9001002 - No matching resource is found based on the resource ID.
816            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
817  * @since 12
818  */
819 ResourceManager_ErrorCode OH_ResourceManager_GetBool(const NativeResourceManager *mgr, uint32_t resId,
820     bool *resultValue);
821 
822 /**
823  * @brief Obtains the boolean result.
824  *
825  * Obtains the boolean result with a specified resource name.
826  *
827  * @param mgr Indicates the pointer to {@link NativeResourceManager}
828  *        {@link OH_ResourceManager_InitNativeResourceManager}.
829  * @param resName Indicates the resource name.
830  * @param resultValue the result write to resultValue.
831  * @return {@link SUCCESS} 0 - Success.
832  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
833            Possible causes: Incorrect parameter types.
834            {@link ERROR_CODE_RES_NAME_NOT_FOUND} 9001003 - Invalid resource name.
835            {@link ERROR_CODE_RES_NOT_FOUND_BY_NAME} 9001004 - No matching resource is found based on the resource name.
836            {@link ERROR_CODE_RES_REF_TOO_MUCH} 9001006 - The resource is referenced cyclically.
837  * @since 12
838  */
839 ResourceManager_ErrorCode OH_ResourceManager_GetBoolByName(const NativeResourceManager *mgr, const char *resName,
840     bool *resultValue);
841 
842 /**
843  * @brief Add overlay resources during application runtime.
844  * @param mgr Indicates the pointer to {@link NativeResourceManager}
845  *        {@link OH_ResourceManager_InitNativeResourceManager}.
846  * @param path Indicates the application overlay path.
847  * @return {@link SUCCESS} 0 - Success.
848  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
849            Possible causes: Incorrect parameter types.
850            {@link ERROR_CODE_OVERLAY_RES_PATH_INVALID} 9001010 - Invalid overlay path.
851  * @since 12
852  */
853 ResourceManager_ErrorCode OH_ResourceManager_AddResource(const NativeResourceManager *mgr, const char *path);
854 
855 /**
856  * @brief Remove overlay resources during application runtime.
857  * @param mgr Indicates the pointer to {@link NativeResourceManager}
858  *        {@link OH_ResourceManager_InitNativeResourceManager}.
859  * @param path Indicates the application overlay path.
860  * @return {@link SUCCESS} 0 - Success.
861  *         {@link ERROR_CODE_INVALID_INPUT_PARAMETER} 401 - The input parameter invalid.
862            Possible causes: Incorrect parameter types.
863            {@link ERROR_CODE_OVERLAY_RES_PATH_INVALID} 9001010 - Invalid overlay path.
864  * @since 12
865  */
866 ResourceManager_ErrorCode OH_ResourceManager_RemoveResource(const NativeResourceManager *mgr, const char *path);
867 #ifdef __cplusplus
868 };
869 #endif
870 
871 /** @} */
872 #endif // GLOBAL_OH_RESMGR_H