tizen 2.3 release
[apps/home/b2-clocksetting.git] / include / util.h
1 /*
2  * Copyright (c) 2010 Samsung Electronics, Inc.
3  * All rights reserved.
4  *
5  * This software is a confidential and proprietary information
6  * of Samsung Electronics, Inc. ("Confidential Information").  You
7  * shall not disclose such Confidential Information and shall use
8  * it only in accordance with the terms of the license agreement
9  * you entered into with Samsung Electronics.
10  */
11 #ifndef _UTIL_H_
12 #define _UTIL_H_
13
14 #include <Elementary.h>
15 #include <efl_assist.h>
16 #include <app.h>
17
18 #include "setting_debug.h"
19
20 #define IMG_DIR         "/usr/apps/org.tizen.clocksetting/data/images/"
21 #define EDJE_PATH       "/usr/apps/org.tizen.clocksetting/res/edje/clocksetting.edj"
22
23 #ifndef FEATURE_SETTING_CHANGEABLE
24 #define FEATURE_SETTING_CHANGEABLE
25 #endif
26
27 #ifdef FEATURE_SETTING_CHANGEABLE
28 #define COLOR_INFO_TABLE "/usr/apps/org.tizen.clocksetting/shared/res/tables/org.tizen.clocksetting_ChangeableColorInfo.xml"
29 #endif
30
31 #define TRUE    1
32 #define FALSE   0
33
34 #define SETTING_PACKAGE                 "clocksetting"
35 #define SYSTEM_PACKAGE                  "sys-string"
36
37 #define _(s)                    setting_gettext(s)
38 #define REPL(s,o,r)     replace(s,o,r)
39 #define ICU_NUM(n)      _get_strnum_from_icu(n)
40
41 #define WIN_SIZE        320
42
43 enum {
44         SETTING_CLOCK,
45         SETTING_NOTIFICATION,
46         SETTING_HOMESCREEN,
47         SETTING_SOUND,
48         SETTING_VOLUME,
49         SETTING_DISPLAY,
50         SETTING_BATTERY,
51         SETTING_BLUETOOTH,
52         SETTING_SCREEN_LOCK,
53         SETTING_DOUBLE_PRESSING,
54         SETTING_LANGUAGE,
55         SETTING_SAFETY,
56         SETTING_RESET,
57         SETTING_INFO,
58         SETTING_MAIN,
59         SETTING_VOLUME_2_DEPTH,
60         SETTING_SOUND_RINGTONE,
61         SETTING_SOUND_NOTIFICATION
62 };
63
64 enum {
65         DISABLE,
66         ENABLE
67 };
68
69 enum {
70         NONE,
71         TOUCH_DOWN,
72         TOUCH_UP,
73         TOUCH_MOVE
74 };
75
76 typedef struct _appdata
77 {
78         Evas_Coord root_w;
79         Evas_Coord root_h;
80
81         Evas *evas;
82         Evas_Object *win_main;
83         Evas_Object *bg;
84         Evas_Object *conform;
85         Evas_Object *layout_main;
86         Evas_Object *nf;
87         Evas_Object *datetime;
88         Evas_Object *alert_rdg;
89         Evas_Object *sound_mode_rdg;
90         Evas_Object *ringtone_type_rdg;
91         Evas_Object *notification_rdg;
92         Evas_Object *vibration_rdg;
93         Evas_Object *pref_arm_rdg;
94         Evas_Object *homescreen_rdg;
95         Evas_Object *double_rdg;
96         Evas_Object *safety_interval_trauma_rdg;
97         Evas_Object *safety_interval_no_activity_rdg;
98
99         Evas_Object *screen_timeout_rdg;
100         Evas_Object *font_size_rdg;
101         Evas_Object *font_style_rdg;
102         Evas_Object *popup;
103         Evas_Object *language_rdg;
104         Evas_Object *wake_up_guesture_rdg;
105         Evas_Object *rotate_screen_rdg;
106         Elm_Object_Item *dt_genlist_item_of_time;
107         Elm_Object_Item *dt_genlist_item_of_date;
108         Elm_Object_Item *language_item;
109
110         Evas_Object *main_genlist;
111
112         char * device_name;
113
114         int is_motion_smart_relay_on;
115         int is_motion_wake_up_on;
116
117         int is_show_ringtone_toast;
118         int is_show_noti_toast;
119
120         int is_first_launch;
121
122         int MENU_TYPE;
123         
124         Evas_Object *indicator_layout;
125
126 #ifdef FEATURE_SETTING_CHANGEABLE
127         Ea_Theme_Color_Table *color_table;
128 #endif
129 } appdata;
130
131 typedef struct _Item_Data
132 {
133         int index;
134         Elm_Object_Item *item;
135 } Item_Data;
136
137 typedef struct _spin_date spin_date;
138 struct _spin_date
139 {
140         Evas_Object *spinner;
141         Evas_Object *layout;
142
143         double posx1, posy1, posx2, posy2;
144 };
145
146 char * replace( char * str, char * orig, char * repl);
147 char *setting_gettext(const char *s);
148
149 void setting_popup_back_cb(void *data, Evas_Object *obj, void *event_info);
150
151 int is_connected_GM();
152
153 bool colorstr_to_decimal(char *color, int *R, int *G, int *B);
154
155 bool is_file_exist(char * file_path);
156
157 #endif