tizen 2.4 release
[apps/home/settings.git] / setting-display / include / setting-display.h
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #ifndef __SETTING_DISPLAY_H__
22 #define __SETTING_DISPLAY_H__
23
24 #include <stdio.h>
25 #include <string.h>
26
27 #include <Elementary.h>
28
29
30 #include <glib-object.h>
31
32 #include <setting-common-draw-widget.h>
33 #include <setting-common-view.h>
34
35 #include <device.h>
36 #include <dd-display.h>
37 #include <dd-deviced.h>
38 /*#include <devman.h> */
39
40 #define Keystr_Dynamic          "IDS_ST_BODY_DYNAMIC_T_DISPLAY_EFFECT"
41 #define Keystr_Standard         "IDS_ST_BODY_STANDARD_T_DISPLAY_EFFECT"
42 #define Keystr_Natural          "IDS_ST_BODY_NATURAL_T_DISPLAY_EFFECT"
43 #define Keystr_Movie            "IDS_ST_BODY_MOVIE_T_DISPLAY_EFFECT"
44
45 #define LAUNCH_EFFECT_STR "IDS_ST_BODY_APP_OPENING_EFFECT"
46 #define LAUNCH_IMAGE_STR  "IDS_ST_BODY_APP_OPENING_IMAGE"
47
48 #define LAUNCH_BATTERY_DESC  "IDS_ST_BODY_SHOWS_BATTERY_PERCENTAGE_ON_INDICATOR" /*"Increase the screen's sensitivity so you can touch it while wearing gloves" */
49
50 #define SETTING_DISPLAY_TIME_15_SEC_STR "IDS_ST_BODY_15SEC"
51 #define SETTING_DISPLAY_TIME_30_SEC_STR "IDS_ST_BODY_30SEC"
52 #define SETTING_DISPLAY_TIME_1_MIN_STR "IDS_ST_BODY_1MINUTE"
53 #define SETTING_DISPLAY_TIME_2_MIN_STR "IDS_ST_BODY_2_MINUTES"
54 #define SETTING_DISPLAY_TIME_5_MIN_STR "IDS_ST_BODY_5_MINUTES"
55 #define SETTING_DISPLAY_TIME_10_MIN_STR "IDS_ST_BODY_10_MINUTES"
56
57
58 #define URI_SMART_STAY "tizen-help://org.tizen.setting/smartstay"
59 #define URI_SMART_ROTATION "tizen-help://org.tizen.setting/smartrotation"
60
61 #define SETTING_DISPLAY_ICON_PATH 12
62
63 typedef enum {
64     SCREENMODE_DYNAMIC = 0,
65     SCREENMODE_STANDARD,
66     SCREENMODE_NATURAL,
67     SCREENMODE_MOVIE,
68     SCREENMODE_MAX
69 } screenmode_t;
70
71 typedef enum {
72     DISPLAY_EXPAND_NONE = 0,
73     DISPLAY_EXPAND_BACKLIGHT,
74     DISPLAY_EXPAND_TOUCH_KEY_LIGHT_DURATION
75 } DisplayExpandState;
76
77
78 typedef struct _Ctxpopup_Data {
79         Evas_Object *ctx;
80         Evas_Object *btn;
81 } Ctxpopup_Data;
82
83 typedef enum {
84     SETTING_DISPLAY_VIEWTYPE_MAIN,
85     SETTING_DISPLAY_VIEWTYPE_BRIGHTNESS,
86     SETTING_DISPLAY_VIEWTYPE_BACKLIGHT,
87     SETTING_DISPLAY_VIEWTYPE_SMARTSCREEN,
88     SETTING_DISPLAY_VIEWTYPE_MAX,
89 } display_viewtype;
90
91 typedef struct _SettingDisplayUG SettingDisplayUG;
92
93 #define BRIGHTNESS_DISPLAY 0
94
95 /**
96  * Setting Display UG context
97  * all UG function has void* as an agument. this is casted back to SettingDisplayUG
98  * and the functions access app context.
99  */
100 struct _SettingDisplayUG {
101         ui_gadget_h ug;
102
103         /* add more variables here (move your appdata to here) */
104         Evas *evas;
105         Evas_Object *win_main_layout;
106         Evas_Object *win_get;
107
108         ui_gadget_h ug_loading;
109         ui_gadget_h ug_font;
110         ui_gadget_h ug_passwd;
111         ui_gadget_h ug_ledindicator;
112
113         Evas_Object *ly_main;   /**< link to src/setting-display-main.c */
114
115         Evas_Object *navi_bar;  /*  for navigation effect */
116         Elm_Object_Item *nf_it;
117         Ecore_Timer *event_freeze_timer;
118
119         Evas_Object *screen_timeout_popup;
120         Evas_Object *screen_timeout_rdg;
121
122         Setting_GenGroupItem_Data *data_screen_mode;
123         Setting_GenGroupItem_Data *data_br;
124         Setting_GenGroupItem_Data *data_font;
125         Setting_GenGroupItem_Data *data_back;
126         //Setting_GenGroupItem_Data *data_touchkey_light_duration;
127         Setting_GenGroupItem_Data *data_br_auto;
128         Setting_GenGroupItem_Data *data_br_sli;
129         Setting_GenGroupItem_Data *data_adjust;
130         Setting_GenGroupItem_Data *data_overheating;
131
132         Setting_GenGroupItem_Data *data_br_adjustment;
133
134         Setting_GenGroupItem_Data *data_auto_rotate;
135
136         /* smart screen */
137         Setting_GenGroupItem_Data *data_smart_stay;
138         Setting_GenGroupItem_Data *data_smart_rotation;
139         Setting_GenGroupItem_Data *data_auto_adjust_scrn_tone;
140         Setting_GenGroupItem_Data *data_dynamic;
141
142
143         Evas_Object *more_popup;
144         Ctxpopup_Data ctx_data;
145
146         Setting_GenGroupItem_Data *tilting_head;
147         Setting_GenGroupItem_Data *tilting_device;
148         Setting_GenGroupItem_Data *smart_scroll_speed;
149         Setting_GenGroupItem_Data *visual_feedback_display;
150         Setting_GenGroupItem_Data *scroll_speed_slider;
151         Setting_GenGroupItem_Data *smart_screen_help;
152         Setting_GenGroupItem_Data *try_tilting_head;
153         Setting_GenGroupItem_Data *try_tilting_device;
154         Setting_GenGroupItem_Data *data_smart_screen_image;
155         Setting_GenGroupItem_Data *data_smart_screen_rotation_image;
156
157         /*int bright_value; */
158         int low_bat;
159
160         setting_view *view_to_load;
161
162         Evas_Object *popup_chk;
163         Evas_Object *popup;
164
165         Elm_Genlist_Item_Class itc_1text_1icon;
166         Elm_Genlist_Item_Class itc_1text;
167         Elm_Genlist_Item_Class itc_screen_mode;
168         Elm_Genlist_Item_Class itc_2text_3;
169         Elm_Genlist_Item_Class itc_1icon;
170
171
172         ui_gadget_h ug_gallery;
173         ui_gadget_h ug_imageviewer;
174         Eina_Bool isLoading;
175         Setting_GenGroupItem_Data *data_backlight_always_on;
176         Setting_GenGroupItem_Data *data_backlight_15sec;
177         Setting_GenGroupItem_Data *data_backlight_30sec;
178         Setting_GenGroupItem_Data *data_backlight_1min;
179         Setting_GenGroupItem_Data *data_backlight_2min;
180         Setting_GenGroupItem_Data *data_backlight_5min;
181         Setting_GenGroupItem_Data *data_backlight_10min;
182         /*Improve response speed */
183         Ecore_Idler *set_idler;
184         Ecore_Timer *set_timer;
185
186         /* genlist */
187         Evas_Object *genlist;
188
189         DBusConnection *bus;
190         Ecore_Event_Handler *help_event_handler;
191         Evas_Object *help_popup;
192         char *uri;
193
194         /*for brightness*/
195         Eina_Bool is_event_registered;
196         int last_requested_level;
197         display_viewtype display_viewtype;
198
199         /*for smart screen try it*/
200         Evas_Object *smart_stay_image;
201         Evas_Object *smart_rotation_image;
202         Evas_Object *smart_stay_sublayout;
203         Evas_Object *smart_rotation_sublayout;
204         Ecore_Timer *timer_show_guide;
205
206         DisplayExpandState display_expand_state;
207
208 };
209
210 extern setting_view setting_view_display_main;
211 extern setting_view setting_view_display_brightness;
212 extern setting_view setting_view_display_backlight;
213
214 void setting_display_layout_ug_cb(ui_gadget_h ug, enum ug_mode mode,
215                                   void *priv);
216
217 extern int setting_display_set_auto_adjust_tone(int value);
218 Eina_Bool __show_smartstay_guide_popup(void *data);
219 Eina_Bool __show_smartrotation_guide_popup(void *data);
220
221 extern void destruct_brightness(void *data);
222 extern void construct_brightness(void *data, Evas_Object *genlist);
223
224
225 #endif                          /* __SETTING_DISPLAY_H__ */