tizen 2.3.1 release
[apps/home/b2-clocksetting.git] / include / setting-battery.h
1 /*
2  *  Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  *  Licensed under the Flora License, Version 1.0 (the License);
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://floralicense.org/license/
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an AS IS BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  *
16  */
17 /*
18  * setting-battery.h
19  *
20  *  Created on: Oct 12, 2013
21  *      Author: min-hoyun
22  */
23
24 #ifndef SETTING_BATTERY_H_
25 #define SETTING_BATTERY_H_
26
27 #include <Elementary.h>
28 #include <libintl.h>
29 #include <string.h>
30 #include <device.h>
31
32 struct _battery_menu_item {
33         char *name;
34         int is_enable;
35         void (*func)(void *data, Evas_Object *obj, void *event_info);
36 };
37
38 enum {
39         CHARGING_NONE,
40         CHARGING_AC,
41         CHARGING_USB
42 };
43
44 enum {
45         BATT_MENU_STATUS,
46         /*BATT_MENU_PERCENT, */
47         BATT_MENU_POWER_SAVING
48 };
49
50 struct _battery_info {
51         int percent;
52         int is_charging;
53 };
54
55 Ecore_Timer *battery_timer;
56
57 int percent;
58 bool is_charging;
59 bool prev_charging_state;
60 int image_index;
61 int is_alive;
62
63
64 /* ----------------method----------------------// */
65
66 Evas_Object *_create_battery_list(void *data);
67
68 Evas_Object *_battery_status_cb(void *data);
69 void _clear_battery_cb(void *data , Evas *e, Evas_Object *obj, void *event_info);
70 Eina_Bool _clear_battery_list_cb(void *data, Elm_Object_Item *it);
71 void _start_timer_for_update(Evas_Object *obj);
72
73 void _initialize_battery();
74
75 #endif /* SETTING_BATTERY_H_ */