3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 * http://floralicense.org/license/
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.
18 #include <setting-powersaving-about.h>
20 #define CPU_PS_DESC_DETAIL "IDS_ST_BODY_THIS_OPTION_LIMITS_THE_MAXIMUM_CPU_PERFORMANCE_AND_HELPS_TO_CONSERVE_BATTERY_LIFE_IT_WILL_NOT_EFFECT_NORMAL_USAGE_LIKE_BROWSING_AND_VIDEO_PLAYBACK_MSG"
21 #define CPU_PS_DESC KeyStr_CPU_PS
23 #define DISPLAY_PS_DESC_DETAIL "IDS_ST_BODY_THIS_OPTION_REDUCES_THE_SCREEN_FRAME_RATE_AND_LOWERS_THE_BRIGHTNESS_IT_HELPS_TO_EXTEND_BATTERY_LIFE_WHEN_THE_SCREEN_IS_TURNED_ON"
24 #define DISPLAY_PS_DESC KeyStr_DISPLAY_PS
26 #define BG_COLOR_DESC_DETAIL "IDS_ST_BODY_THIS_OPTION_CHANGES_THE_BACKGROUND_COLOUR_BRIGHTNESS_LEVEL_SO_THAT_IT_CONSUMES_LESS_BATTERY_MSG"
27 #define BG_COLOR_DESC KeyStr_BG_COLOR
29 #define VIBRATION_DESC_DETAIL "IDS_ST_BODY_THE_VIBRATE_FUNCTION_USES_ADDITIONAL_BATTERY_POWER"
30 #define VIBRATION_DESC KeyStr_SCREEN_VIB
32 #define MAIN_DESC "1. System power saving settings<br>"\
33 "Set system functions below<br>"\
34 " 1.Dual core max<br>"\
36 " 3.UI rendering speed"
38 #define WIFI_DESC "2. Wi-Fi<br>"\
39 "Turn off Wi-Fi, Turning off Wi-Fi can extend battery life, "\
40 "However, if you surf the Web frequently, using Wi-Fi can "\
41 "save more battery than using the cellular network."
43 #define BT_DESC "3. Bluetooth<br>"\
44 "Turn off Bluetooth. Not using Bluetooth headset or Car home "\
45 "mode can extend battery life"
47 #define GPS_DESC "4. GPS<br>"\
48 "Applications using GPS location data reduce battery life. "\
49 "Turning off BDU GPS can extend battery life"
51 #define SYNC_DESC "5. Data sync<br>"\
52 "Applications such as Gmail, Calendar, and Twitter are auto"\
53 "synced via wireless network at specific intervals. Syncing "\
54 "data manually can extend battery life"
56 #define HOTSPOT_DESC "6. Portable Wi-Fi hotspot<br>"\
57 "Turn off Portable Wi-Fi hotspot. Sharing mobile internet"\
58 " connection with other devices can reduce battery life. "\
59 "Turn off portable Wi-Fi hotspot to extend battery life."
61 #define BRIGHT_DESC "7. Brightness<br>"\
62 "Lowering the brightness of the screen can extend battery life."\
63 "Selecting Automatic brightness will adjust screen brightness"\
64 " to ambient automatically"
66 #define ETC_DESC "8. Etc.<br>"\
67 "1.Disabling Use packet data(Settings > Wireless and network >"\
68 " Mobile networks) helps extend battery.<br>"\
69 "2.Disabling Auto sync (Settings > Account and sync) "\
70 "helps extend battery"
72 static int setting_powersaving_about_create(void *cb);
73 static int setting_powersaving_about_destroy(void *cb);
74 static int setting_powersaving_about_update(void *cb);
75 static int setting_powersaving_about_cleanup(void *cb);
77 setting_view setting_view_powersaving_about = {
78 .create = setting_powersaving_about_create,
79 .destroy = setting_powersaving_about_destroy,
80 .update = setting_powersaving_about_update,
81 .cleanup = setting_powersaving_about_cleanup,
84 /* ***************************************************
88 ***************************************************/
90 static int setting_powersaving_about_create(void *cb)
92 retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
94 SettingPowersavingUG *ad = (SettingPowersavingUG *) cb;
95 char temp[MAX_COMMON_BUFFER_LEN] ={0,};
98 setting_push_layout_navi_bar_genlist(ad->win_main_layout,
100 _(KeyStr_Powersaving_About),
101 _("IDS_COM_BODY_BACK"),
103 setting_powersaving_about_click_back_cb,
104 NULL, ad, &genlist, ad->navi_bar);
106 Setting_GenGroupItem_Data *item_data = NULL;
107 snprintf(temp, MAX_COMMON_BUFFER_LEN, "1. %s<br>%s", _(CPU_PS_DESC), _(CPU_PS_DESC_DETAIL));
108 item_data = setting_create_Gendial_field_def(genlist, &itc_multiline_text,
111 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
112 NULL, NULL, 0, temp, NULL, NULL);
113 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
115 memset(temp, 0x00, MAX_COMMON_BUFFER_LEN);
116 snprintf(temp, MAX_COMMON_BUFFER_LEN, "2. %s<br>%s", _(VIBRATION_DESC), _(VIBRATION_DESC_DETAIL));
117 item_data = setting_create_Gendial_field_def(genlist, &itc_multiline_text,
120 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
121 NULL, NULL, 0, temp, NULL, NULL);
122 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
124 setting_create_Gendial_field_def(genlist, &itc_multiline_text,
127 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
128 NULL, NULL, 0, MAIN_DESC, NULL, NULL);
130 setting_create_Gendial_field_def(genlist, &itc_multiline_text,
133 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
134 NULL, NULL, 0, WIFI_DESC, NULL, NULL);
136 setting_create_Gendial_field_def(genlist, &itc_multiline_text,
139 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
140 NULL, NULL, 0, BT_DESC, NULL, NULL);
142 setting_create_Gendial_field_def(genlist, &itc_multiline_text,
145 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
146 NULL, NULL, 0, GPS_DESC, NULL, NULL);
147 setting_create_Gendial_field_def(genlist, &itc_multiline_text, NULL, ad,
148 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
149 NULL, NULL, 0, SYNC_DESC, NULL, NULL);
151 setting_create_Gendial_field_def(genlist, &itc_multiline_text,
154 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
155 NULL, NULL, 0, HOTSPOT_DESC, NULL,
158 setting_create_Gendial_field_def(genlist, &itc_multiline_text,
161 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
162 NULL, NULL, 0, BRIGHT_DESC, NULL,
165 setting_create_Gendial_field_def(genlist, &itc_multiline_text, NULL, ad,
166 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
167 NULL, NULL, 0, ETC_DESC, NULL, NULL);
169 setting_view_powersaving_about.is_create = 1;
171 return SETTING_RETURN_SUCCESS;
174 static int setting_powersaving_about_destroy(void *cb)
177 retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
179 SettingPowersavingUG *ad = (SettingPowersavingUG *) cb;
181 elm_naviframe_item_pop(ad->navi_bar);
182 setting_view_powersaving_about.is_create = 0;
184 return SETTING_RETURN_SUCCESS;
187 static int setting_powersaving_about_update(void *cb)
189 return SETTING_RETURN_SUCCESS;
192 static int setting_powersaving_about_cleanup(void *cb)
194 return setting_powersaving_about_destroy(cb);
197 /* ***************************************************
201 ***************************************************/
203 /* ***************************************************
207 ***************************************************/
210 setting_powersaving_about_click_back_cb(void *data, Evas_Object *obj,
214 setting_retm_if(data == NULL, " Data parameter is NULL");
216 SettingPowersavingUG *ad = (SettingPowersavingUG *) data;
217 setting_view_change(&setting_view_powersaving_about,
218 &setting_view_powersaving_main, ad);