95d2b171ef3fe70d9e8e64475ec2daa3d8473d9c
[platform/core/appfw/pkgmgr-info.git] / include / pkgmgrinfo_resource.h
1 #ifndef __PKGMGRINFO_RESOURCE_H_
2 #define __PKGMGRINFO_RESOURCE_H_
3
4 #include <glib.h>
5 #include <bundle.h>
6
7 #define RSC_GROUP_TYPE_IMAGE "image"
8 #define RSC_GROUP_TYPE_LAYOUT "layout"
9 #define RSC_GROUP_TYPE_SOUND "sound"
10 #define RSC_GROUP_TYPE_BIN "bin"
11
12 #define RSC_NODE_ATTR_SCREEN_DPI "screen-dpi"
13 #define RSC_NODE_ATTR_SCREEN_DPI_RANGE "screen-dpi-range"
14 #define RSC_NODE_ATTR_SCREEN_WIDTH_RANGE "screen-width-range"
15 #define RSC_NODE_ATTR_SCREEN_LARGE "screen-large"
16 #define RSC_NODE_ATTR_SCREEN_BPP "screen-bpp"
17 #define RSC_NODE_ATTR_PLATFORM_VER "platform-version"
18 #define RSC_NODE_ATTR_LANGUAGE "language"
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 typedef struct {
25         char *folder;
26         bundle *attr;
27 } resource_node_t;
28
29 typedef struct {
30         char *folder;
31         char *type;
32         GList *node_list;
33 } resource_group_t;
34
35 typedef struct {
36         char *package;
37         GList *group_list;
38 } resource_data_t;
39
40 /**
41  * @fn int pkgmgrinfo_resource_close(resource_data_t data)
42  * @brief       This API frees given data and its own variables
43  *
44  * @par         This API is for capi-appfw-application.
45  * @par Sync (or) Async : Synchronous API
46  *
47  * @param[in]   data    structure of resource_data_t
48  * @return      0 on succeed and -1 on failure, -2 on invalid parameter
49  */
50 int pkgmgrinfo_resource_close(resource_data_t *data);
51
52 /**
53  * @fn int pkgmgrinfo_resource_open(const char *package, resource_data_t **data)
54  * @brief       This API will get resource data of specific package from db
55  *
56  * @par         This API is for capi-appfw-application.
57  * @par Sync (or) Async : Synchronous API
58  *
59  * @param[in]   package packageID
60  * @param[out]data      resource_data type structure. it will filled with resource data
61  * @return      0 on succeed and -1 on failure, -2 on invalid parameter
62  */
63 int pkgmgrinfo_resource_open(const char *package, resource_data_t **data);
64
65 #ifdef __cplusplus
66 }
67 #endif
68
69 #endif
70