fix for applying wayland (removing X)
[apps/home/settings.git] / setting-powersaving / include / setting-powersaving.h
1 /*
2  * setting
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Flora License, Version 1.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://floralicense.org/license/
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an AS IS BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef __SETTING_POWERSAVING_H__
19 #define __SETTING_POWERSAVING_H__
20
21 #include <stdio.h>
22 #include <string.h>
23
24 #include <Elementary.h>
25
26 #include <glib-object.h>
27
28 #include <setting-common-draw-widget.h>
29 #include <setting-common-view.h>
30
31 #define SUPPORT_UI0_3           0
32 #define SUPPORT_UI0_4           1
33
34 /* string resources..*/
35 //in main view
36 #define KeyStr_Powersaving_Mode "IDS_ST_BODY_POWER_SAVING_MODE"
37 #define KeyStr_Powersaving_Mode_DSC "Use default settings for power saving. Settings will be enabled immediately."
38
39 /* To do : strings of custom power saving will be removed. */
40 #define KeyStr_Powersaving_Customed_Mode "Custom power saving mode"
41 #define KeyStr_Powersaving_Customed "Custom power saving settings"
42 #define KeyStr_Powersaving_Level_DSC "Use settings for power saving. Settings will be enabled when battery level is below the value you set."
43
44 #define KeyStr_Powersaving_Tips "IDS_ST_MBODY_POWER_SAVING_TIPS"
45 #define KeyStr_Powersaving_About "IDS_ST_BODY_LEARN_ABOUT_POWER_SAVING"
46
47 //in "Custom settings" view
48 #define __TURN_Off "Turn off "
49 #define KeyStr_WIFI_Off __TURN_Off"Wi-Fi"
50 #define KeyStr_BT_Off __TURN_Off"Bluetooth"
51 #define KeyStr_GPS_Off __TURN_Off"GPS"
52 #define KeyStr_SYNC_Off __TURN_Off"Data sync"
53 #define KeyStr_HOTSPOT_Off __TURN_Off"Portable Wi-Fi hotspot"
54 #define KeyStr_Adjust_Bright "Adjust brightness"
55
56 #define KeyStr_Powersaving_AT "Enable power saving at"
57 #define KeyStr_Screen_Timeout "IDS_ST_BACKLIGHT_TIME"
58
59 #define SETTING_POWERSAVING_AT_10_STR "10% battery power"
60 #define SETTING_POWERSAVING_AT_20_STR "20% battery power"
61 #define SETTING_POWERSAVING_AT_30_STR "30% battery power"
62 #define SETTING_POWERSAVING_AT_40_STR "40% battery power"
63 #define SETTING_POWERSAVING_AT_50_STR "50% battery power"
64 /* To do : end */
65
66
67 //v0.4
68 #define KeyStr_PS_SETTINGS      "IDS_ST_BODY_POWER_SAVING_MODE_SETTINGS"
69 #define KeyStr_CPU_PS           "IDS_ST_BODY_CPU_POWER_SAVING"
70 #define KeyStr_CPU_PS_DSC       "IDS_ST_BODY_LIMIT_THE_MAXIMUM_PERFORMANCE_OF_THE_CPU"
71 #define KeyStr_DISPLAY_PS       "IDS_ST_BODY_SCREEN_POWER_SAVING"
72 #define KeyStr_DISPLAY_PS_DSC   "IDS_ST_BODY_USE_LOW_POWER_LEVEL_FOR_SCREEN"
73 #define KeyStr_BG_COLOR         "IDS_ST_DISPLAYSETTINGS_BODY_MAINGREETINGEDITSTYLEBGCOLOUR"
74 #define KeyStr_BG_COLOR_DSC     "IDS_ST_BODY_CHANGE_BACKGROUND_COLOUR_TO_SAVE_POWER_IN_EMAIL_AND_INTERNET"
75 #define KeyStr_SCREEN_VIB       "IDS_ST_BODY_TURN_OFF_HAPTIC_FEEDBACK"
76 #define KeyStr_SCREEN_VIB_DSC   "IDS_ST_BODY_TURNING_OFF_HAPTIC_FEEDBACK_CAN_EXTEND_BATTERY_LIFE"
77
78 #define SETTING_POWERSAVING_ALL_SUB_ITEMS_OFF "To turn on the Power saving mode. At least one item should be selected"
79
80 typedef struct _SettingPowersavingUG SettingPowersavingUG;
81
82 /**
83  *Setting Powersaving UG context
84  *all UG function has void * as an agument. this is casted back to SettingPowersavingUG
85  *and the functions access app context.
86  */
87 struct _SettingPowersavingUG {
88         ui_gadget_h ug;
89
90         /* add more variables here (move your appdata to here) */
91         Evas *evas;
92         Evas_Object *win_main_layout;
93         Evas_Object *win_get;
94         Evas_Object *popup;
95         Evas_Object *popup_chk;
96
97         Evas_Object *ly_main;
98         Evas_Object *navi_bar;
99
100         Setting_GenGroupItem_Data *data_powersaving_active;
101         Setting_GenGroupItem_Data *data_customed_active;
102         Setting_GenGroupItem_Data *data_customed_setting;
103         Setting_GenGroupItem_Data *data_powersaving_about;
104         //v0.4
105         Setting_GenGroupItem_Data *data_cpu_ps;
106         Setting_GenGroupItem_Data *data_display_ps;
107         Setting_GenGroupItem_Data *data_bg_color;
108         Setting_GenGroupItem_Data *data_screen_vib;
109
110         Setting_GenGroupItem_Data *data_saving_at;
111         Setting_GenGroupItem_Data *data_screen_timeout;
112         Setting_GenGroupItem_Data *data_wifi_off;
113         Setting_GenGroupItem_Data *data_bt_off;
114         Setting_GenGroupItem_Data *data_gps_off;
115         Setting_GenGroupItem_Data *data_sync_off;
116         Setting_GenGroupItem_Data *data_hotspot_off;
117         Setting_GenGroupItem_Data *data_adjust_bright;
118         Setting_GenGroupItem_Data *data_brightness;
119
120         Setting_GenGroupItem_Data *data_br_auto;
121         Setting_GenGroupItem_Data *data_br_sli;
122
123 };
124
125 extern setting_view setting_view_powersaving_main;
126 extern setting_view setting_view_powersaving_customed;
127 extern setting_view setting_view_powersaving_about;
128 extern setting_view setting_view_powersaving_brightness;
129 extern void setting_powersaving_ug_exp_cb(void *data, Evas_Object *obj, void *event_info);
130 extern char *setting_powersaving_ug_get_brightness_str();
131
132 #endif                          /* __SETTING_POWERSAVING_H__ */