1 #ifndef __PKGMGR_PARSER_RESOURCE_H_
2 #define __PKGMGR_PARSER_RESOURCE_H_
6 #include "pkgmgr_parser.h"
7 #include "pkgmgrinfo_resource.h"
9 #define PKGMGR_RSC_GROUP_TYPE_IMAGE "image"
10 #define PKGMGR_RSC_GROUP_TYPE_LAYOUT "layout"
11 #define PKGMGR_RSC_GROUP_TYPE_SOUND "sound"
12 #define PKGMGR_RSC_GROUP_TYPE_BIN "bin"
14 #define RSC_NODE_ATTR_SCREEN_DPI "screen-dpi"
15 #define RSC_NODE_ATTR_SCREEN_DPI_RANGE "screen-dpi-range"
16 #define RSC_NODE_ATTR_SCREEN_WIDTH_RANGE "screen-width-range"
17 #define RSC_NODE_ATTR_SCREEN_LARGE "screen-large"
18 #define RSC_NODE_ATTR_SCREEN_BPP "screen-bpp"
19 #define RSC_NODE_ATTR_PLATFORM_VER "platform-version"
20 #define RSC_NODE_ATTR_LANGUAGE "language"
27 * @fn int *pkgmgr_resource_parser_open(const char *fname, const char *package, resource_data_t **data)
28 * @brief This API initialize parses res.xml which identified by fname and package and put it into data.
30 * @par This API is for package-manager installer backends.
31 * @par Sync (or) Async : Synchronous API
33 * @param[in] fname pointer to xml filename
34 * @param[in] pacakage pointer to packageID
35 * @param[out]data pointer of pointer to resource_data type structure.
36 * @return 0 on succeed and -1 on failure, -2 on invalid parameter
38 API int pkgmgr_resource_parser_open(const char *fname, const char *package, resource_data_t **data);
41 * @fn int pkgmgr_resource_parser_close(resource_data_t data)
42 * @brief This API frees given data and its own variables
44 * @par This API is for package-manager installer backends.
45 * @par Sync (or) Async : Synchronous API
47 * @param[in] data structure of resource_data_t
48 * @return 0 on succeed and -1 on failure, -2 on invalid parameter
50 API int pkgmgr_resource_parser_close(resource_data_t *data);
53 * @fn int pkgmgr_resource_parser_insert_into_db(resource_data_t *data)
54 * @brief This API will put given data into db
56 * @par This API is for package-manager installer backends.
57 * @par Sync (or) Async : Synchronous API
59 * @param[in] data structure to be inserted into db
60 * @return 0 on succeed and -1 on failure, -2 on invalid parameter
62 API int pkgmgr_resource_parser_insert_into_db(resource_data_t *data);
65 * @fn int pkgmgr_resource_parser_open_from_db(const char *package, resource_data_t **data)
66 * @brief This API will get resource data of specific package from db
68 * @par This API is for applications.
69 * @par Sync (or) Async : Synchronous API
71 * @param[in] package packageID
72 * @param[out]data resource_data type structure. it will filled with resource data
73 * @return 0 on succeed and -1 on failure, -2 on invalid parameter
75 API int pkgmgr_resource_parser_open_from_db(const char *package, resource_data_t **data);
78 * @fn int pkgmgr_resource_parser_check_xml_validation(const char *xmlfile)
79 * @brief This API will validates given resource manifest file
81 * @par This API is for package-manager installer backends.
82 * @par Sync (or) Async : Synchronous API
84 * @param[in] manifest manifest filepath to be validated
85 * @return 0 on succeed and -1 on failure, -2 on invalid parameter
87 API int pkgmgr_resource_parser_check_xml_validation(const char *xmlfile);
90 * @fn int pkgmgr_resource_parser_delete_from_db(const char *package)
91 * @brief This API will remove resource data from package_resource_info, package_resource_data
93 * @par This API is for package-manager installer backends.
94 * @par Sync (or) Async : Synchronous API
96 * @param[in] package packageID
97 * @return 0 on succeed and -1 on failure, -2 on invalid parameter
99 API int pkgmgr_resource_parser_delete_from_db(const char *package);