• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ohresmgr.h
2
3
4## Overview
5
6Provides native APIs for obtaining resources.
7
8**System capability**: SystemCapability.Global.ResourceManager
9
10**Library**: libohresmgr.so
11
12**Since**: 12
13
14**Related module**: [Resourcemanager](resourcemanager.md)
15
16
17## Summary
18
19
20### Callback
21
22| Name| Description|
23| -------- | -------- |
24| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetMediaBase64](resourcemanager.md#oh_resourcemanager_getmediabase64) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, char \*\*resultValue, uint64_t \*resultLen, uint32_t density=0) | Obtains the Base64 code of the media resource with the specified screen density based on the specified resource ID. |
25| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetMediaBase64Data](resourcemanager.md#oh_resourcemanager_getmediabase64data) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, char \*\*resultValue, uint64_t \*resultLen, uint32_t density) | Obtains the Base64 code of the media resource with the specified screen density based on the specified resource ID. |
26| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetMediaBase64ByName](resourcemanager.md#oh_resourcemanager_getmediabase64byname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, char \*\*resultValue, uint64_t \*resultLen, uint32_t density=0) | Obtains the Base64 code of the media resource with the specified screen density based on the specified resource name. |
27| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetMediaBase64DataByName](resourcemanager.md#oh_resourcemanager_getmediabase64databyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, char \*\*resultValue, uint64_t \*resultLen, uint32_t density) | Obtains the Base64 code of the media resource with the specified screen density based on the specified resource name. |
28| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetMedia](resourcemanager.md#oh_resourcemanager_getmedia) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, uint8_t \*\*resultValue, uint64_t \*resultLen, uint32_t density=0) | Obtains the content of the media resource with the specified screen density based on the specified resource ID. |
29| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetMediaData](resourcemanager.md#oh_resourcemanager_getmediadata) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, uint8_t \*\*resultValue, uint64_t \*resultLen, uint32_t density) | Obtains the content of the media resource with the specified screen density based on the specified resource ID. |
30| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetMediaByName](resourcemanager.md#oh_resourcemanager_getmediabyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, uint8_t \*\*resultValue, uint64_t \*resultLen, uint32_t density=0) | Obtains the content of the media resource with the specified screen density based on the specified resource name. |
31| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetMediaDataByName](resourcemanager.md#oh_resourcemanager_getmediadatabyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, uint8_t \*\*resultValue, uint64_t \*resultLen, uint32_t density) | Obtains the content of the media resource with the specified screen density based on the specified resource name. |
32| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetDrawableDescriptor](resourcemanager.md#oh_resourcemanager_getdrawabledescriptor) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, ArkUI_DrawableDescriptor \*\*drawableDescriptor, uint32_t density=0, uint32_t type=0) | Obtains the **DrawableDescriptor** object of the icon resource with the specified screen density based on the specified resource ID. |
33| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetDrawableDescriptorData](resourcemanager.md#oh_resourcemanager_getdrawabledescriptordata) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, ArkUI_DrawableDescriptor \*\*drawableDescriptor, uint32_t density, uint32_t type) | Obtains the **DrawableDescriptor** object of the icon resource with the specified screen density based on the specified resource ID. |
34| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetDrawableDescriptorByName](resourcemanager.md#oh_resourcemanager_getdrawabledescriptorbyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, ArkUI_DrawableDescriptor \*\*drawableDescriptor, uint32_t density=0, uint32_t type=0) | Obtains the **DrawableDescriptor** object of the icon resource with the specified screen density based on the specified resource name. |
35| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetDrawableDescriptorDataByName](resourcemanager.md#oh_resourcemanager_getdrawabledescriptordatabyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, ArkUI_DrawableDescriptor \*\*drawableDescriptor, uint32_t density, uint32_t type) | Obtains the **DrawableDescriptor** object of the icon resource with the specified screen density based on the specified resource name. |
36| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetSymbol](resourcemanager.md#oh_resourcemanager_getsymbol) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, uint32_t \*resultValue) | Obtains a **symbol** resource based on the specified resource ID. |
37| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetSymbolByName](resourcemanager.md#oh_resourcemanager_getsymbolbyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, uint32_t \*resultValue) | Obtains a **symbol** resource based on the specified resource name. |
38| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetLocales](resourcemanager.md#oh_resourcemanager_getlocales) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, char \*\*\*resultValue, uint32_t \*resultLen, bool includeSystem=false) | Obtains the language list. |
39| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetLocalesData](resourcemanager.md#oh_resourcemanager_getlocalesdata) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, char \*\*\*resultValue, uint32_t \*resultLen, bool includeSystem) | Obtains the language list. |
40| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetConfiguration](resourcemanager.md#oh_resourcemanager_getconfiguration) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, [ResourceManager_Configuration](_resource_manager___configuration.md) \*configuration) | Obtains the device configuration. |
41| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_ReleaseConfiguration](resourcemanager.md#oh_resourcemanager_releaseconfiguration) ([ResourceManager_Configuration](_resource_manager___configuration.md) \*configuration) | Releases the memory requested by using **OH_ResourceManager_GetConfiguration()**. |
42| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetString](resourcemanager.md#oh_resourcemanager_getstring) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, char \*\*resultValue,...) | Obtains a **string** resource based on the specified resource ID. |
43| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetStringByName](resourcemanager.md#oh_resourcemanager_getstringbyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, char \*\*resultValue,...) | Obtains a **string** resource based on the specified resource name. |
44| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetStringArray](resourcemanager.md#oh_resourcemanager_getstringarray) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, char \*\*\*resultValue, uint32_t \*resultLen) | Obtains a string array based on the specified resource ID. |
45| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetStringArrayByName](resourcemanager.md#oh_resourcemanager_getstringarraybyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, char \*\*\*resultValue, uint32_t \*resultLen) | Obtains a string array based on the specified resource name. |
46| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_ReleaseStringArray](resourcemanager.md#oh_resourcemanager_releasestringarray) (char \*\*\*resValue, uint32_t len) | Releases the memory of the string array. |
47| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetPluralString](resourcemanager.md#oh_resourcemanager_getpluralstring) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, uint32_t num, char \*\*resultValue) | Obtains singular and plural strings based on the specified resource ID. |
48| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetPluralStringByName](resourcemanager.md#oh_resourcemanager_getpluralstringbyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, uint32_t num, char \*\*resultValue) | Obtains singular and plural strings based on the specified resource name. |
49| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetIntPluralString](resourcemanager.md#oh_resourcemanager_getintpluralstring) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, uint32_t num, char \*\*resultValue,...) | Obtains singular and plural strings based on the specified resource ID. |
50| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetDoublePluralString](resourcemanager.md#oh_resourcemanager_getdoublepluralstring) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, double num, char \*\*resultValue,...) | Obtains singular and plural strings based on the specified resource ID. |
51| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetIntPluralStringByName](resourcemanager.md#oh_resourcemanager_getintpluralstringbyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, uint32_t num, char \*\*resultValue,...) | Obtains singular and plural strings based on the specified resource name. |
52| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetDoublePluralStringByName](resourcemanager.md#oh_resourcemanager_getdoublepluralstringbyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, double num, char \*\*resultValue,...) | Obtains singular and plural strings based on the specified resource name. |
53| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetColor](resourcemanager.md#oh_resourcemanager_getcolor) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, uint32_t \*resultValue) | Obtains a color value based on the specified resource ID. |
54| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetColorByName](resourcemanager.md#oh_resourcemanager_getcolorbyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, uint32_t \*resultValue) | Obtains a color value based on the specified resource ID. |
55| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetInt](resourcemanager.md#oh_resourcemanager_getint) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, int \*resultValue) | Obtains an int value based on the specified resource ID. |
56| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetIntByName](resourcemanager.md#oh_resourcemanager_getintbyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, int \*resultValue) | Obtains an int value based on the specified resource name. |
57| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetFloat](resourcemanager.md#oh_resourcemanager_getfloat) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, float \*resultValue) | Obtains a float value based on the specified resource ID. |
58| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetFloatByName](resourcemanager.md#oh_resourcemanager_getfloatbyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, float \*resultValue) | Obtains a float value based on the specified resource name. |
59| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetBool](resourcemanager.md#oh_resourcemanager_getbool) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, uint32_t resId, bool \*resultValue) | Obtains a bool value based on the specified resource ID. |
60| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_GetBoolByName](resourcemanager.md#oh_resourcemanager_getboolbyname) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*resName, bool \*resultValue) | Obtains a bool value based on the specified resource name. |
61| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_AddResource](resourcemanager.md#oh_resourcemanager_addresource) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*path) | Adds overlay resources when an application is running. |
62| [ResourceManager_ErrorCode](resourcemanager.md#resourcemanager_errorcode) [OH_ResourceManager_RemoveResource](resourcemanager.md#oh_resourcemanager_removeresource) (const [NativeResourceManager](rawfile.md#nativeresourcemanager) \*mgr, const char \*path) | Removes overlay resources when an application is running. |
63