7e1b4d6016a4ff443901edb5bc947740b9418f48
[apps/home/settings.git] / setting-powersaving / include / setting-powersaving.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
22 #ifndef __SETTING_POWERSAVING_H__
23 #define __SETTING_POWERSAVING_H__
24
25 #include <stdio.h>
26 #include <string.h>
27
28 #include <Elementary.h>
29
30 #include <glib-object.h>
31
32 #include <setting-common-draw-widget.h>
33 #include <setting-common-view.h>
34
35 #include <Ecore_X.h>
36 #define SUPPORT_UI0_3           0
37 #define SUPPORT_UI0_4           1
38
39 /* string resources..*/
40 //in main view
41 #define KeyStr_Powersaving_Mode "IDS_ST_BODY_POWER_SAVING_MODE"
42 #define KeyStr_Powersaving_Mode_DSC "Use default settings for power saving. Settings will be enabled immediately."
43
44 /* To do : strings of custom power saving will be removed. */
45 #define KeyStr_Powersaving_Customed_Mode "Custom power saving mode"
46 #define KeyStr_Powersaving_Customed "Custom power saving settings"
47 #define KeyStr_Powersaving_Level_DSC "Use settings for power saving. Settings will be enabled when battery level is below the value you set."
48
49 #define KeyStr_Powersaving_Tips "IDS_ST_MBODY_POWER_SAVING_TIPS"
50 #define KeyStr_Powersaving_About "IDS_ST_BODY_LEARN_ABOUT_POWER_SAVING"
51
52 //in "Custom settings" view
53 #define __TURN_Off "Turn off "
54 #define KeyStr_WIFI_Off __TURN_Off"Wi-Fi"
55 #define KeyStr_BT_Off __TURN_Off"Bluetooth"
56 #define KeyStr_GPS_Off __TURN_Off"GPS"
57 #define KeyStr_SYNC_Off __TURN_Off"Data sync"
58 #define KeyStr_HOTSPOT_Off __TURN_Off"Portable Wi-Fi hotspot"
59 #define KeyStr_Adjust_Bright "Adjust brightness"
60
61 #define KeyStr_Powersaving_AT "Enable power saving at"
62 #define KeyStr_Screen_Timeout "IDS_ST_LIGHTSETTINGS_BODY_BACKLIGHTTIME"
63
64 #define SETTING_POWERSAVING_AT_10_STR "10% battery power"
65 #define SETTING_POWERSAVING_AT_20_STR "20% battery power"
66 #define SETTING_POWERSAVING_AT_30_STR "30% battery power"
67 #define SETTING_POWERSAVING_AT_40_STR "40% battery power"
68 #define SETTING_POWERSAVING_AT_50_STR "50% battery power"
69 /* To do : end */
70
71
72 //v0.4
73 #define KeyStr_PS_SETTINGS      "IDS_ST_BODY_POWER_SAVING_MODE_SETTINGS"
74 #define KeyStr_CPU_PS           "IDS_ST_BODY_CPU_POWER_SAVING"
75 #define KeyStr_CPU_PS_DSC       "IDS_ST_BODY_LIMIT_THE_MAXIMUM_PERFORMANCE_OF_THE_CPU"
76 #define KeyStr_DISPLAY_PS       "IDS_ST_BODY_SCREEN_POWER_SAVING"
77 #define KeyStr_DISPLAY_PS_DSC   "IDS_ST_BODY_USE_LOW_POWER_LEVEL_FOR_SCREEN"
78 #define KeyStr_BG_COLOR         "IDS_ST_DISPLAYSETTINGS_BODY_MAINGREETINGEDITSTYLEBGCOLOUR"
79 #define KeyStr_BG_COLOR_DSC     "IDS_ST_BODY_CHANGE_BACKGROUND_COLOUR_TO_SAVE_POWER_IN_EMAIL_AND_INTERNET"
80 #define KeyStr_SCREEN_VIB       "IDS_ST_BODY_TURN_OFF_HAPTIC_FEEDBACK"
81 #define KeyStr_SCREEN_VIB_DSC   "IDS_ST_BODY_TURNING_OFF_HAPTIC_FEEDBACK_CAN_EXTEND_BATTERY_LIFE"
82
83 #define SETTING_POWERSAVING_ALL_SUB_ITEMS_OFF "To turn on the Power saving mode. At least one item should be selected"
84
85 typedef struct _SettingPowersavingUG SettingPowersavingUG;
86
87 /**
88  *Setting Powersaving UG context
89  *all UG function has void * as an agument. this is casted back to SettingPowersavingUG
90  *and the functions access app context.
91  */
92 struct _SettingPowersavingUG {
93         ui_gadget_h ug;
94
95         /* add more variables here (move your appdata to here) */
96         Evas *evas;
97         Evas_Object *win_main_layout;
98         Evas_Object *win_get;
99         Evas_Object *popup;
100         Evas_Object *popup_chk;
101
102         Evas_Object *ly_main;
103         Evas_Object *navi_bar;
104
105         Setting_GenGroupItem_Data *data_powersaving_active;
106         Setting_GenGroupItem_Data *data_customed_active;
107         Setting_GenGroupItem_Data *data_customed_setting;
108         Setting_GenGroupItem_Data *data_powersaving_about;
109         //v0.4
110         Setting_GenGroupItem_Data *data_cpu_ps;
111         Setting_GenGroupItem_Data *data_display_ps;
112         Setting_GenGroupItem_Data *data_bg_color;
113         Setting_GenGroupItem_Data *data_screen_vib;
114
115         Setting_GenGroupItem_Data *data_saving_at;
116         Setting_GenGroupItem_Data *data_screen_timeout;
117         Setting_GenGroupItem_Data *data_wifi_off;
118         Setting_GenGroupItem_Data *data_bt_off;
119         Setting_GenGroupItem_Data *data_gps_off;
120         Setting_GenGroupItem_Data *data_sync_off;
121         Setting_GenGroupItem_Data *data_hotspot_off;
122         Setting_GenGroupItem_Data *data_adjust_bright;
123         Setting_GenGroupItem_Data *data_brightness;
124
125         Setting_GenGroupItem_Data *data_br_auto;
126         Setting_GenGroupItem_Data *data_br_sli;
127
128 };
129
130 extern setting_view setting_view_powersaving_main;
131 extern setting_view setting_view_powersaving_customed;
132 extern setting_view setting_view_powersaving_about;
133 extern setting_view setting_view_powersaving_brightness;
134 extern void setting_powersaving_ug_exp_cb(void *data, Evas_Object *obj, void *event_info);
135 extern char *setting_powersaving_ug_get_brightness_str();
136
137 #endif                          /* __SETTING_POWERSAVING_H__ */