Unify uiapplication_x and serviceapplication_x
[platform/core/appfw/pkgmgr-info.git] / include / pkgmgrinfo_basic.h
1 #ifndef __PKGMGR_INFO_BASIC_H__
2 #define __PKGMGR_INFO_BASIC_H__
3
4 /**
5  * @brief List definitions.
6  * All lists are doubly-linked, the last element is stored to list pointer,
7  * which means that lists must be looped using the prev pointer, or by
8  * calling LISTHEAD first to go to start in order to use the next pointer.
9  */
10
11  /**
12  * @brief Convinience Macro to add node in list
13  */
14
15 #define LISTADD(list, node)                     \
16     do {                                        \
17         (node)->prev = (list);                  \
18         if (list) (node)->next = (list)->next;  \
19         else (node)->next = NULL;               \
20         if (list) (list)->next = (node);        \
21         (list) = (node);                        \
22     } while (0);
23
24  /**
25  * @brief Convinience Macro to add one node to another node
26  */
27 #define NODEADD(node1, node2)                                   \
28     do {                                                        \
29         (node2)->prev = (node1);                                \
30         (node2)->next = (node1)->next;                          \
31         if ((node1)->next) (node1)->next->prev = (node2);       \
32         (node1)->next = (node2);                                \
33     } while (0);
34
35  /**
36  * @brief Convinience Macro to concatenate two lists
37  */
38 #define LISTCAT(list, first, last)              \
39     if ((first) && (last)) {                    \
40         (first)->prev = (list);                 \
41         (list) = (last);                        \
42     }
43
44  /**
45  * @brief Convinience Macro to delete node from list
46  */
47 #define LISTDEL(list, node)                                     \
48     do {                                                        \
49         if ((node)->prev) (node)->prev->next = (node)->next;    \
50         if ((node)->next) (node)->next->prev = (node)->prev;    \
51         if (!((node)->prev) && !((node)->next)) (list) = NULL;  \
52     } while (0);
53
54  /**
55  * @brief Convinience Macro to get list head
56  */
57 #define LISTHEAD(list, node)                                    \
58     for ((node) = (list); (node)->prev; (node) = (node)->prev)
59
60  /**
61  * @brief Convinience Macro to get list tail
62  */
63 #define LISTTAIL(list, node)                                    \
64     for ((node) = (list); (node)->next; (node) = (node)->next)
65
66 typedef struct metadata_x {
67         const char *key;
68         const char *value;
69         struct metadata_x *prev;
70         struct metadata_x *next;
71 } metadata_x;
72
73 typedef struct privilege_x {
74         const char *text;
75         struct privilege_x *prev;
76         struct privilege_x *next;
77 } privilege_x;
78
79 typedef struct privileges_x {
80         struct privilege_x *privilege;
81         struct privileges_x *prev;
82         struct privileges_x *next;
83 } privileges_x;
84
85 typedef struct permission_x {
86         const char *type;
87         const char *value;
88         struct permission_x *prev;
89         struct permission_x *next;
90 } permission_x;
91
92 typedef struct icon_x {
93         const char *name;
94         const char *text;
95         const char *lang;
96         const char *section;
97         const char *size;
98         const char *resolution;
99         struct icon_x *prev;
100         struct icon_x *next;
101 } icon_x;
102
103 typedef struct image_x {
104         const char *name;
105         const char *text;
106         const char *lang;
107         const char *section;
108         struct image_x *prev;
109         struct image_x *next;
110 } image_x;
111
112 typedef struct allowed_x {
113         const char *name;
114         const char *text;
115         struct allowed_x *prev;
116         struct allowed_x *next;
117 } allowed_x;
118
119 typedef struct request_x {
120         const char *text;
121         struct request_x *prev;
122         struct request_x *next;
123 } request_x;
124
125 typedef struct define_x {
126         const char *path;
127         struct allowed_x *allowed;
128         struct request_x *request;
129         struct define_x *prev;
130         struct define_x *next;
131 } define_x;
132
133 typedef struct datashare_x {
134         struct define_x *define;
135         struct request_x *request;
136         struct datashare_x *prev;
137         struct datashare_x *next;
138 } datashare_x;
139
140 typedef struct description_x {
141         const char *name;
142         const char *text;
143         const char *lang;
144         struct description_x *prev;
145         struct description_x *next;
146 } description_x;
147
148 typedef struct registry_x {
149         const char *name;
150         const char *text;
151         struct registry_x *prev;
152         struct registry_x *next;
153 } registry_x;
154
155 typedef struct database_x {
156         const char *name;
157         const char *text;
158         struct database_x *prev;
159         struct database_x *next;
160 } database_x;
161
162 typedef struct layout_x {
163         const char *name;
164         const char *text;
165         struct layout_x *prev;
166         struct layout_x *next;
167 } layout_x;
168
169 typedef struct label_x {
170         const char *name;
171         const char *text;
172         const char *lang;
173         struct label_x *prev;
174         struct label_x *next;
175 } label_x;
176
177 typedef struct author_x {
178         const char *email;
179         const char *href;
180         const char *text;
181         const char *lang;
182         struct author_x *prev;
183         struct author_x *next;
184 } author_x;
185
186 typedef struct license_x {
187         const char *text;
188         const char *lang;
189         struct license_x *prev;
190         struct license_x *next;
191 } license_x;
192
193 typedef struct operation_x {
194         const char *name;
195         const char *text;
196         struct operation_x *prev;
197         struct operation_x *next;
198 } operation_x;
199
200 typedef struct uri_x {
201         const char *name;
202         const char *text;
203         struct uri_x *prev;
204         struct uri_x *next;
205 } uri_x;
206
207 typedef struct mime_x {
208         const char *name;
209         const char *text;
210         struct mime_x *prev;
211         struct mime_x *next;
212 } mime_x;
213
214 typedef struct subapp_x {
215         const char *name;
216         const char *text;
217         struct subapp_x *prev;
218         struct subapp_x *next;
219 } subapp_x;
220
221 typedef struct condition_x {
222         const char *name;
223         const char *text;
224         struct condition_x *prev;
225         struct condition_x *next;
226 } condition_x;
227
228 typedef struct notification_x {
229         const char *name;
230         const char *text;
231         struct notification_x *prev;
232         struct notification_x *next;
233 } notification_x;
234
235 typedef struct appsvc_x {
236         const char *text;
237         struct operation_x *operation;
238         struct uri_x *uri;
239         struct mime_x *mime;
240         struct subapp_x *subapp;
241         struct appsvc_x *prev;
242         struct appsvc_x *next;
243 } appsvc_x;
244
245 typedef struct appcontrol_x {
246         const char *operation;
247         const char *uri;
248         const char *mime;
249         struct appcontrol_x *prev;
250         struct appcontrol_x *next;
251 } appcontrol_x;
252
253 typedef struct category_x{
254         const char *name;
255         struct category_x *prev;
256         struct category_x *next;
257 } category_x;
258
259 typedef struct launchconditions_x {
260         const char *text;
261         struct condition_x *condition;
262         struct launchconditions_x *prev;
263         struct launchconditions_x *next;
264 } launchconditions_x;
265
266 typedef struct compatibility_x {
267         const char *name;
268         const char *text;
269         struct compatibility_x *prev;
270         struct compatibility_x *next;
271 }compatibility_x;
272
273 typedef struct deviceprofile_x {
274         const char *name;
275         const char *text;
276         struct deviceprofile_x *prev;
277         struct deviceprofile_x *next;
278 }deviceprofile_x;
279
280 typedef struct datacontrol_x {
281         const char *providerid;
282         const char *access;
283         const char *type;
284         struct datacontrol_x *prev;
285         struct datacontrol_x *next;
286 } datacontrol_x;
287
288 typedef struct application_x {
289         const char *appid;
290         const char *component;
291         const char *exec;
292         const char *nodisplay;
293         const char *type;
294         const char *onboot;
295         const char *multiple;
296         const char *autorestart;
297         const char *taskmanage;
298         const char *enabled;
299         const char *categories;
300         const char *extraid;
301         const char *hwacceleration;
302         const char *screenreader;
303         const char *mainapp;
304         const char *recentimage;
305         const char *launchcondition;
306         const char *indicatordisplay;
307         const char *portraitimg;
308         const char *landscapeimg;
309         const char *guestmode_visibility;
310         const char *permission_type;
311         const char *preload;
312         const char *submode;
313         const char *submode_mainid;
314         const char *launch_mode;
315         const char *ui_gadget;
316         const char *support_disable;
317         const char *component_type;
318         const char *package;
319         struct label_x *label;
320         struct icon_x *icon;
321         struct image_x *image;
322         struct appsvc_x *appsvc;
323         struct appcontrol_x *appcontrol;
324         struct category_x *category;
325         struct metadata_x *metadata;
326         struct permission_x *permission;
327         struct launchconditions_x *launchconditions;
328         struct notification_x *notification;
329         struct datashare_x *datashare;
330         struct datacontrol_x *datacontrol;
331         struct application_x *prev;
332         struct application_x *next;
333 } application_x;
334
335 typedef struct daemon_x {
336         const char *name;
337         const char *text;
338         struct daemon_x *prev;
339         struct daemon_x *next;
340 } daemon_x;
341
342 typedef struct theme_x {
343         const char *name;
344         const char *text;
345         struct theme_x *prev;
346         struct theme_x *next;
347 } theme_x;
348
349 typedef struct font_x {
350         const char *name;
351         const char *text;
352         struct font_x *prev;
353         struct font_x *next;
354 } font_x;
355
356 typedef struct ime_x {
357         const char *name;
358         const char *text;
359         struct ime_x *prev;
360         struct ime_x *next;
361 } ime_x;
362
363 typedef struct package_x {
364         const char *for_all_users;              /**< Flag that indicates if the package is available for everyone or for current user only*/
365         const char *package;            /**< package name*/
366         const char *version;            /**< package version*/
367         const char *installlocation;            /**< package install location*/
368         const char *ns;         /**<name space*/
369         const char *removable;          /**< package removable flag*/
370         const char *preload;            /**< package preload flag*/
371         const char *readonly;           /**< package readonly flag*/
372         const char *update;                     /**< package update flag*/
373         const char *appsetting;         /**< package app setting flag*/
374         const char *system;             /**< package system flag*/
375         const char *type;               /**< package type*/
376         const char *package_size;               /**< package size for external installation*/
377         const char *installed_time;             /**< installed time after finishing of installation*/
378         const char *installed_storage;          /**< package currently installed storage*/
379         const char *storeclient_id;             /**< id of store client for installed package*/
380         const char *mainapp_id;         /**< app id of main application*/
381         const char *package_url;                /**< app id of main application*/
382         const char *root_path;          /**< package root path*/
383         const char *csc_path;           /**< package csc path*/
384         const char *nodisplay_setting;          /**< package no display setting menu*/
385         const char *api_version;                /**< minimum version of API package using*/
386         const char *support_disable;            /**< package support disable flag*/
387         struct icon_x *icon;            /**< package icon*/
388         struct label_x *label;          /**< package label*/
389         struct author_x *author;                /**< package author*/
390         struct description_x *description;              /**< package description*/
391         struct license_x *license;              /**< package license*/
392         struct privileges_x *privileges;        /**< package privileges*/
393         struct application_x *application;              /**< package's application*/
394         struct daemon_x *daemon;                /**< package daemon*/
395         struct theme_x *theme;          /**< package theme*/
396         struct font_x *font;            /**< package font*/
397         struct ime_x *ime;              /**< package ime*/
398         struct compatibility_x *compatibility;          /**< package compatibility*/
399         struct deviceprofile_x *deviceprofile;          /**< package device profile*/
400 } package_x;
401
402 typedef struct package_x manifest_x;
403
404 void pkgmgrinfo_basic_free_application(application_x *application);
405 void pkgmgrinfo_basic_free_package(package_x *package);
406
407 #endif