tizen 2.3.1 release
[apps/home/b2-clocksetting.git] / include / setting-clock.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-clock.h
19  *
20  *  Created on: Oct 8, 2013
21  *      Author: min-hoyun
22  */
23
24 #ifndef SETTING_CLOCK_H_
25 #define SETTING_CLOCK_H_
26
27 #include <Elementary.h>
28 #include <libintl.h>
29 #include <string.h>
30 #include <vconf.h>
31 #include <langinfo.h>
32 #include <time.h>
33 #include <dd-deviced-managed.h>
34 #include <dd-deviced.h>
35 #include <libxml/xmlmemory.h>
36 #include <libxml/parser.h>
37 #include <libxml/tree.h>
38
39 #define CLOCK_LIST_XML_FILE_PATH        "/usr/apps/org.tizen.clocksetting/data/clocklist.xml"
40 #define WALLPAPER_PATH_PREFIX   "/opt/share/settings/Wallpapers"
41
42 #define CLOCK_DATE_AND_TIME_COUNT       3
43
44 #define IDLE_CLOCK_CATEGROY2    "org.tizen.wmanager.WATCH_CLOCK"
45 #define IDLE_CLOCK_CATEGROY     "http://tizen.org/category/wearable_clock"
46
47 enum {
48         HOURLY_ALERT_OFF,
49         HOURLY_ALERT_SOUND,
50         HOURLY_ALERT_VIBRATION
51 };
52
53
54 struct _clock_menu_item {
55         char *name;
56         int type_num;
57         void (*func)(void *data, Evas_Object *obj, void *event_info);
58 };
59
60 struct _dt_menu_item {
61         char *name;
62         char *date_or_time;
63         void (*func)(void *data, Evas_Object *obj, void *event_info);
64 };
65
66 typedef struct dt_Item_Data {
67         int index;
68         Elm_Object_Item *item;
69         Evas_Object *check;
70         Evas_Object *state_label;
71 } DT_Item_Data;
72
73 typedef struct alert_Item_Data {
74         int index;
75         Elm_Object_Item *item;
76         Evas_Object *radio;
77         Evas_Object *radio_group;
78 } Alert_Item_Data;
79
80 typedef struct _clock_page_data clock_page_data;
81 struct _clock_page_data {
82         Evas_Object *mapbuf[32];
83 };
84
85 enum {
86         CLOCKTYPE_INVALID = -1,
87         CLOCKTYPE_FUNCTION,
88         CLOCKTYPE_STYLE,
89         CLOCKTYPE_3RD
90 };
91
92 typedef struct _clock_type_item {
93         int index;
94         char *appid;
95         char *pkgid;
96         char *name;
97         char *icon;
98 } Clock_Type_Item;
99
100 static Eina_List *g_clock_list[3];
101
102 int is_alert_on_or_off;
103 int is_running_clock;
104
105 void  _clear_clock_cb(void *data , Evas *e, Evas_Object *obj, void *event_info);
106 void _dt_cb(void *data, Evas_Object *obj, void *event_info);
107 void _hourly_alert_cb(void *data, Evas_Object *obj, void *event_info);
108 char *_gl_Clock_title_get(void *data, Evas_Object *obj, const char *part);
109 Evas_Object *_create_clock_list(void *data);
110 char *_gl_date_and_time_title_get(void *data, Evas_Object *obj, const char *part);
111 void _show_date_and_time_list(void *data);
112
113 void _alert_sel_changed_cb(void *data, Evas_Object *obj, void *event_info);
114 char *_gl_alert_title_get(void *data, Evas_Object *obj, const char *part);
115 Evas_Object *_gl_alert_ridio_get(void *data, Evas_Object *obj, const char *part);
116 char *_gl_alert_title_get(void *data, Evas_Object *obj, const char *part);
117 void _show_hourly_alert_list(void *data);
118
119 Evas_Object *_clock_type_cb(void *data);
120
121 void initialize_clock(void *data);
122
123 void _clocklist_load();
124 Eina_List *_get_clock_type_list();
125 void _clocklist_destroy();
126
127 #endif /* SETTING_CLOCK_H_ */