Updated package changelog.
[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 noicon;
105     char res[3];                    /* (unused)     */
106     char *location;
107     char *icon_key_name;
108     short kindId;
109     short categoryId;
110     short autostart;
111     short displayzoneNum;
112     short soundzoneNum;
113     short inputdevNum;
114     Ico_Uxf_conf_appdisplay display[ICO_UXF_APPDISPLAY_MAX];
115     Ico_Uxf_conf_appsound   sound[ICO_UXF_APPSOUND_MAX];
116     Ico_Uxf_conf_appinput   input[ICO_UXF_APPINPUT_MAX];
117     struct _ico_uxf_conf_application *nextidhash;
118     struct _ico_uxf_conf_application *nextnamehash;
119 } Ico_Uxf_conf_application;
120
121 typedef struct _ico_uxf_conf_display_layer {
122     int id;
123     char *name;
124 } Ico_Uxf_conf_display_layer;
125
126 #define ZONE_MAX_OVERLAP    (ICO_UXF_DISPLAY_ZONE_MAX-1)
127 typedef struct _ico_uxf_conf_display_zone {
128     int id;
129     char *name;
130     short x;
131     short y;
132     short width;
133     short height;
134     short zoneidx;
135     short res;                                  /* (unused)         */
136     struct _ico_uxf_conf_display *display;
137     unsigned char overlapNum;
138     unsigned char overlap[ZONE_MAX_OVERLAP];
139 } Ico_Uxf_conf_display_zone;
140
141 typedef struct _ico_uxf_conf_display {
142     int id;
143     char *name;
144     short hostId;
145     short displayno;
146     short type;
147     short width;
148     short height;
149     short inch;
150     short layerNum;
151     short zoneNum;
152     char *wayland;
153     Ico_Uxf_conf_display_layer *layer;
154     Ico_Uxf_conf_display_zone *zone;
155 } Ico_Uxf_conf_display;
156
157 typedef struct _ico_uxf_conf_sound_zone {
158     int id;
159     char *name;
160     short zoneidx;
161     short res;                                  /* (unused)         */
162     struct _ico_uxf_conf_sound *sound;
163     unsigned char overlapNum;
164     unsigned char overlap[ZONE_MAX_OVERLAP];
165 } Ico_Uxf_conf_sound_zone;
166
167 typedef struct _ico_uxf_conf_sound {
168     int id;
169     char *name;
170     short hostId;
171     short soundno;
172     short type;
173     short zoneNum;
174     Ico_Uxf_conf_sound_zone *zone;
175 } Ico_Uxf_conf_sound;
176
177 typedef struct _ico_uxf_conf_inputsw {
178     struct _ico_uxf_conf_inputdev   *inputdev;
179     char *name;
180     char *appid;
181 } Ico_Uxf_conf_inputsw;
182
183 typedef struct _ico_uxf_conf_inputdev {
184     int id;
185     char *name;
186     short inputswNum;
187     short res;                                  /* (unused)         */
188     Ico_Uxf_conf_inputsw *inputsw;
189 } Ico_Uxf_conf_inputdev;
190
191 typedef struct _ico_uxf_sys_config {
192     Ico_Uxf_conf_misc misc;
193     short hostNum;
194     short categoryNum;
195     short kindNum;
196     short displayNum;
197     short soundNum;
198     short inputdevNum;
199     Ico_Uxf_conf_host *host;
200     Ico_Uxf_conf_category *category;
201     Ico_Uxf_conf_kind *kind;
202     Ico_Uxf_conf_display *display;
203     Ico_Uxf_conf_sound *sound;
204     Ico_Uxf_conf_inputdev *inputdev;
205 } Ico_Uxf_Sys_Config;
206
207 typedef struct _ico_uxf_app_config {
208     int applicationNum;
209     Ico_Uxf_conf_application *application;
210     Ico_Uxf_conf_application *hashidtable[ICO_UXF_MISC_HASHSIZE];
211     Ico_Uxf_conf_application *hashnametable[ICO_UXF_MISC_HASHSIZE];
212 } Ico_Uxf_App_Config;
213
214 const Ico_Uxf_Sys_Config* ico_uxf_getSysConfig(void);
215 const Ico_Uxf_Sys_Config* ico_uxf_ifGetSysConfig(void);
216 const Ico_Uxf_App_Config* ico_uxf_getAppConfig(void);
217
218 void ico_uxf_closeSysConfig(void);
219 void ico_uxf_closeAppConfig(void);
220
221 int ico_uxf_getSysKindByName(const char *skind);
222 int ico_uxf_getSysCategoryByName(const char *scategory);
223 int ico_uxf_getSysHostByName(const char *shost);
224 int ico_uxf_getSysHostTypeByName(const char *stype);
225 int ico_uxf_getSysDisplayByName(const char *sdisplay);
226 int ico_uxf_getSysDispTypeByName(const char *stype);
227 int ico_uxf_getSysLayerByName(const int display, const char *slayer);
228 int ico_uxf_getSysDispZoneByName(const int display, const char *sdispzone);
229 int ico_uxf_getSysSoundByName(const char *ssound);
230 int ico_uxf_getSysSoundZoneByName(const int sound, const char *ssoundzone);
231 int ico_uxf_getSysInputdevByName(const char *sinputdev);
232 int ico_uxf_getSysInputswByName(const int inputdev, const char *sinputsw);
233 int ico_uxf_getSysBoolByName(const char *sbool);
234 int ico_uxf_getAppDisplay(const Ico_Uxf_conf_application *app, const int idx,
235                           int *x, int *y, int *width, int *height);
236
237 const Ico_Uxf_conf_host* ico_uxf_getSysHostById(const int hostId);
238 const Ico_Uxf_conf_application* ico_uxf_getAppByAppid(const char *appid);
239 const Ico_Uxf_conf_application* ico_uxf_getAppByName(const char *name);
240 const Ico_Uxf_conf_category* ico_uxf_getAppCategoryById(const int categoryId);
241 const Ico_Uxf_conf_display* ico_uxf_getSysDisplayById(const int displayId);
242 const char *ico_uxf_get_SysLocation( const int hostId );
243
244 /* define log macros    */
245 #ifndef uifw_trace
246 #define uifw_debug      ICO_UXF_DEBUG
247 #define uifw_trace      ICO_UXF_DEBUG
248 #define uifw_critical   ICO_UXF_CRITICAL
249 #define uifw_info       ICO_UXF_INFO
250 #define uifw_warn       ICO_UXF_WARN
251 #define uifw_error      ICO_UXF_ERROR
252 #define uifw_logflush   ico_uxf_log_flush
253 #endif  /*uifw_trace*/
254
255 void ico_uxf_closeSysConfig(void);
256
257 #define ICO_UXF_EVENT_WAIT_DEFAULT      (0)
258 #define ICO_UXF_EVENT_WAIT_WAYLAND      (1)
259 #define ICO_UXF_EVENT_WAIT_WEBSOCKET    (2)
260 #define ICO_UXF_EVENT_WAIT_JULIUS       (3)
261
262 #define ICO_UXF_EFFECT_NONE             (0)
263 #define ICO_UXF_EFFECT_GRAYOUT          (1)
264 #define ICO_UXF_EFFECT_BLACKOUT         (2)
265 #define ICO_UXF_EFFECT_INVISIBLE        (3)
266 #define ICO_UXF_EFFECT_TERMINATE        (4)
267
268 #ifdef __cplusplus
269 }
270 #endif
271 #endif /* ICO_UXF_CONF_H_ */
272