Fixed some RPMlint errors - group name, duplicate files, etc.
[profile/ivi/ico-uxf-homescreen.git] / include / ico_uxf_conf.h
1 /*
2  * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9 /**
10  * @brief   user experiance library public header file(configuration)
11  *
12  * @date    Feb-28-2013
13  */
14
15 #ifndef ICO_UXF_CONF_H_
16 #define ICO_UXF_CONF_H_
17
18 #include <glib.h>
19 #include "ico_uxf_conf_def.h"
20 #include "ico_uxf_sysdef.h"
21 #include "ico_uxf_def.h"
22 #include "ico_uxf_typedef.h"
23 #include "ico_apf_log.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 typedef struct _ico_uxf_conf_misc {
30     char topdir[ICO_UXF_CONF_DIR_MAX+1];
31     char confdir[ICO_UXF_CONF_DIR_MAX+1];
32     short myhostId;
33     short masterhostId;
34     char *myhostName;
35     char *myaddress;
36     char *homescreen;
37     char *masterhostaddress;
38     short default_hostId;
39     short default_kindId;
40     short default_categoryId;
41     short default_displayId;
42     short default_layerId;
43     short default_dispzoneId;
44     short default_soundId;
45     short default_soundzoneId;
46     short default_inputdevId;
47     short default_inputswId;
48     int appscontrollerport;
49     int soundpluginport;
50     int loglevel;
51     int logflush;
52 } Ico_Uxf_conf_misc;
53
54 typedef struct _ico_uxf_conf_host {
55     int id;
56     char *name;
57     char *address;
58     int type;
59     char *homescreen;
60 } Ico_Uxf_conf_host;
61
62 typedef struct _ico_uxf_conf_category {
63     int id;
64     char *name;
65     short view;
66     short type;
67     short sound;
68     short input;
69     short priority;
70     short res;                                  /* (unused)         */
71 } Ico_Uxf_conf_category;
72
73 typedef struct _ico_uxf_conf_kind {
74     int id;
75     char *name;
76     short priv;
77     short priority;
78 } Ico_Uxf_conf_kind;
79
80 typedef struct _ico_uxf_conf_appdisplay {
81     short displayId;
82     short layerId;
83     short zoneId;
84     short res;                                  /* (unused)         */
85 } Ico_Uxf_conf_appdisplay;
86
87 typedef struct _ico_uxf_conf_appsound {
88     short soundId;
89     short zoneId;
90 } Ico_Uxf_conf_appsound;
91
92 typedef struct _ico_uxf_conf_appinput {
93     short inputdevId;
94     short inputswId;
95 } Ico_Uxf_conf_appinput;
96
97 typedef struct _ico_uxf_conf_application {
98     char *appid;
99     char *name;
100     char *group;
101     char *exec;
102     char *type;
103     int hostId;
104     char *location;
105     char *icon_key_name;
106     char *animation;
107     short animation_time;
108     char autostart;
109     char noicon;
110     char noconfigure;
111     char menuoverlap;
112     char res[2];
113     unsigned short invisiblecpu;
114     short kindId;
115     short categoryId;
116     short displayzoneNum;
117     short soundzoneNum;
118     short inputdevNum;
119     Ico_Uxf_conf_appdisplay display[ICO_UXF_APPDISPLAY_MAX];
120     Ico_Uxf_conf_appsound   sound[ICO_UXF_APPSOUND_MAX];
121     Ico_Uxf_conf_appinput   input[ICO_UXF_APPINPUT_MAX];
122     struct _ico_uxf_conf_application *nextidhash;
123     struct _ico_uxf_conf_application *nextnamehash;
124 } Ico_Uxf_conf_application;
125
126 typedef struct _ico_uxf_conf_display_layer {
127     int id;
128     char *name;
129     char menuoverlap;
130     char res[3];                                /* (unused)         */
131 } Ico_Uxf_conf_display_layer;
132
133 #define ZONE_MAX_OVERLAP    (ICO_UXF_DISPLAY_ZONE_MAX-1)
134 typedef struct _ico_uxf_conf_display_zone {
135     int id;
136     char *name;
137     short node;
138     short x;
139     short y;
140     short width;
141     short height;
142     short zoneidx;
143     struct _ico_uxf_conf_display *display;
144     unsigned char overlapNum;
145     unsigned char overlap[ZONE_MAX_OVERLAP];
146 } Ico_Uxf_conf_display_zone;
147
148 typedef struct _ico_uxf_conf_display {
149     int id;
150     char *name;
151     short hostId;
152     short displayno;
153     short type;
154     short width;
155     short height;
156     short inch;
157     short layerNum;
158     short zoneNum;
159     char *wayland;
160     Ico_Uxf_conf_display_layer *layer;
161     Ico_Uxf_conf_display_zone *zone;
162 } Ico_Uxf_conf_display;
163
164 typedef struct _ico_uxf_conf_sound_zone {
165     int id;
166     char *name;
167     short zoneidx;
168     short res;                                  /* (unused)         */
169     struct _ico_uxf_conf_sound *sound;
170     unsigned char overlapNum;
171     unsigned char overlap[ZONE_MAX_OVERLAP];
172 } Ico_Uxf_conf_sound_zone;
173
174 typedef struct _ico_uxf_conf_sound {
175     int id;
176     char *name;
177     short hostId;
178     short soundno;
179     short type;
180     short zoneNum;
181     Ico_Uxf_conf_sound_zone *zone;
182 } Ico_Uxf_conf_sound;
183
184 typedef struct _ico_uxf_conf_inputsw {
185     struct _ico_uxf_conf_inputdev   *inputdev;
186     char *name;
187     char *appid;
188     int keycode;
189 } Ico_Uxf_conf_inputsw;
190
191 typedef struct _ico_uxf_conf_inputdev {
192     int id;
193     char *name;
194     short inputswNum;
195     short res;                                  /* (unused)         */
196     Ico_Uxf_conf_inputsw *inputsw;
197 } Ico_Uxf_conf_inputdev;
198
199 typedef struct _ico_uxf_sys_config {
200     Ico_Uxf_conf_misc misc;
201     short hostNum;
202     short categoryNum;
203     short kindNum;
204     short displayNum;
205     short soundNum;
206     short inputdevNum;
207     Ico_Uxf_conf_host *host;
208     Ico_Uxf_conf_category *category;
209     Ico_Uxf_conf_kind *kind;
210     Ico_Uxf_conf_display *display;
211     Ico_Uxf_conf_sound *sound;
212     Ico_Uxf_conf_inputdev *inputdev;
213 } Ico_Uxf_Sys_Config;
214
215 typedef struct _ico_uxf_app_config {
216     int applicationNum;
217     int ailNum;
218     Ico_Uxf_conf_application *application;
219     Ico_Uxf_conf_application *hashidtable[ICO_UXF_MISC_HASHSIZE];
220     Ico_Uxf_conf_application *hashnametable[ICO_UXF_MISC_HASHSIZE];
221 } Ico_Uxf_App_Config;
222
223 typedef void (*Ico_Uxf_AppUpdata_Cb)(const char *appid, int type);
224
225 const Ico_Uxf_Sys_Config* ico_uxf_getSysConfig(void);
226 const Ico_Uxf_Sys_Config* ico_uxf_ifGetSysConfig(void);
227 const Ico_Uxf_App_Config* ico_uxf_getAppConfig(void);
228
229 void ico_uxf_closeSysConfig(void);
230 void ico_uxf_closeAppConfig(void);
231
232 int ico_uxf_getSysKindByName(const char *skind);
233 int ico_uxf_getSysCategoryByName(const char *scategory);
234 int ico_uxf_getSysHostByName(const char *shost);
235 int ico_uxf_getSysHostTypeByName(const char *stype);
236 int ico_uxf_getSysDisplayByName(const char *sdisplay);
237 int ico_uxf_getSysDispTypeByName(const char *stype);
238 int ico_uxf_getSysLayerByName(const int display, const char *slayer);
239 int ico_uxf_getSysDispZoneByName(const int display, const char *sdispzone);
240 int ico_uxf_getSysSoundByName(const char *ssound);
241 int ico_uxf_getSysSoundZoneByName(const int sound, const char *ssoundzone);
242 int ico_uxf_getSysInputdevByName(const char *sinputdev);
243 int ico_uxf_getSysInputswByName(const int inputdev, const char *sinputsw);
244 int ico_uxf_getSysBoolByName(const char *sbool);
245 int ico_uxf_getAppDisplay(const Ico_Uxf_conf_application *app, const int idx,
246                           int *x, int *y, int *width, int *height);
247
248 const Ico_Uxf_conf_host* ico_uxf_getSysHostById(const int hostId);
249 const Ico_Uxf_conf_application* ico_uxf_getAppByAppid(const char *appid);
250 const Ico_Uxf_conf_application* ico_uxf_getAppByName(const char *name);
251 const Ico_Uxf_conf_category* ico_uxf_getAppCategoryById(const int categoryId);
252 const Ico_Uxf_conf_display* ico_uxf_getSysDisplayById(const int displayId);
253 const char *ico_uxf_get_SysLocation( const int hostId );
254
255 int ico_uxf_conf_setAppUpdateCb(Ico_Uxf_AppUpdata_Cb func);
256
257 /* define log macros    */
258 #ifndef uifw_trace
259 #define uifw_debug      ICO_UXF_DEBUG
260 #define uifw_trace      ICO_UXF_DEBUG
261 #define uifw_critical   ICO_UXF_CRITICAL
262 #define uifw_info       ICO_UXF_INFO
263 #define uifw_warn       ICO_UXF_WARN
264 #define uifw_error      ICO_UXF_ERROR
265 #define uifw_logflush   ico_uxf_log_flush
266 #endif  /*uifw_trace*/
267
268 void ico_uxf_closeSysConfig(void);
269
270 #define ICO_UXF_CONF_EVENT_INSTALL      (0)
271 #define ICO_UXF_CONF_EVENT_UNINSTALL    (1)
272
273 #ifdef __cplusplus
274 }
275 #endif
276 #endif /* ICO_UXF_CONF_H_ */
277