diff --git a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h index 04bb5d3311b50786aa49d24727f99e080f525837..8e0e2424d346b3d428205674a342a9cf8197fa5b 100644 --- a/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h +++ b/bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h @@ -37,6 +37,9 @@ #ifndef FOUNDATION_APPEXECFWK_STANDARD_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_NATIVE_INTERFACE_BUNDLE_H #define FOUNDATION_APPEXECFWK_STANDARD_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_NATIVE_INTERFACE_BUNDLE_H +#include +#include + #ifdef __cplusplus extern "C" { #endif @@ -76,6 +79,82 @@ struct OH_NativeBundle_ElementName { char* abilityName; }; +/** + * @brief Indicates information of Metadata + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ +struct OH_NativeBundle_Metadata { + /** + * @brief Indicates the metadata name + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + char* name; + /** + * @brief Indicates the metadata value + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + char* value; + /** + * @brief Indicates the metadata resource + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + char* resource; +}; + +/** + * @brief Indicates information of Metadata + * + * @since 20 + * @version 1.0 + */ +typedef struct OH_NativeBundle_Metadata OH_NativeBundle_Metadata; + +/** + * @brief Indicates information of ModuleMetadata + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ +struct OH_NativeBundle_ModuleMetadata { + /** + * @brief Indicates the moduleName of ModuleMetadata + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + char* moduleName; + /** + * @brief Indicates the Metadata array of module + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + OH_NativeBundle_Metadata* metadataArray; + /** + * @brief Indicates the Metadata array size of module + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 20 + * @version 1.0 + */ + size_t metadataArraySize; +}; + /** * @brief Indicates information of application * @@ -92,6 +171,14 @@ typedef struct OH_NativeBundle_ApplicationInfo OH_NativeBundle_ApplicationInfo; */ typedef struct OH_NativeBundle_ElementName OH_NativeBundle_ElementName; +/** + * @brief Indicates information of ModuleMetadata + * + * @since 20 + * @version 1.0 + */ +typedef struct OH_NativeBundle_ModuleMetadata OH_NativeBundle_ModuleMetadata; + /** * @brief Obtains the application info based on the The current bundle. * @@ -159,6 +246,29 @@ OH_NativeBundle_ElementName OH_NativeBundle_GetMainElementName(); * @version 1.0 */ char* OH_NativeBundle_GetCompatibleDeviceType(); + +/** + * @brief Obtains the application debug mode. + * + * @return Returns true if the application is in debug mode; returns false otherwise. + * @since 20 + * @version 1.0 + */ +bool OH_NativeBundle_IsDebugMode(); + +/** + * @brief Obtains the OH_NativeBundle_ModuleMetadata array of the current application. + * After utilizing this interface, to prevent memory leaks, + * it is necessary to manually release the pointer returned by the interface. + * + * @param size Indicates the OH_NativeBundle_ModuleMetadata array size. + * @return Returns the newly created OH_NativeBundle_ModuleMetadata array, if the returned object is NULL, + * it indicates creation failure. The possible cause of failure could be that the application address space is full, + * leading to space allocation failure. + * @since 20 + * @version 1.0 + */ +OH_NativeBundle_ModuleMetadata* OH_NativeBundle_GetModuleMetadata(size_t* size); #ifdef __cplusplus }; #endif