Initialize Tizen 2.3
[apps/home/b2-clocksetting.git] / include / setting-clock.h
1 /*
2  * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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    "http://tizen.org/category/idle-clock"
45 #define IDLE_CLOCK_CATEGROY     "com.samsung.wmanager.WATCH_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 {
68         int index;
69         Elm_Object_Item *item;
70         Evas_Object *check;
71         Evas_Object *state_label;
72 } DT_Item_Data;
73
74 typedef struct alert_Item_Data
75 {
76         int index;
77         Elm_Object_Item *item;
78         Evas_Object *radio;
79         Evas_Object *radio_group;
80 } Alert_Item_Data;
81
82 typedef struct _clock_page_data clock_page_data;
83 struct _clock_page_data
84 {
85         Evas_Object *mapbuf[32];
86 };
87
88 enum {
89         CLOCKTYPE_INVALID = -1,
90         CLOCKTYPE_FUNCTION,
91         CLOCKTYPE_STYLE,
92         CLOCKTYPE_3RD
93 };
94
95 typedef struct _clock_type_item {
96         int index;
97         char *appid;
98         char *pkgid;
99         char *name;
100         char *icon;
101 } Clock_Type_Item;
102
103 static Eina_List *g_clock_list[3];
104
105 int is_alert_on_or_off;
106 int is_running_clock;
107
108 void  _clear_clock_cb(void *data , Evas *e, Evas_Object *obj, void *event_info);
109 void _dt_cb(void *data, Evas_Object *obj, void *event_info);
110 void _hourly_alert_cb(void *data, Evas_Object *obj, void *event_info);
111 char * _gl_Clock_title_get(void *data, Evas_Object *obj, const char *part);
112 Evas_Object* _create_clock_list(void* data);
113 char * _gl_date_and_time_title_get(void *data, Evas_Object *obj, const char *part);
114 void _show_date_and_time_list(void* data);
115
116 void _alert_sel_changed_cb(void *data, Evas_Object *obj, void *event_info);
117 char * _gl_alert_title_get(void *data, Evas_Object *obj, const char *part);
118 Evas_Object * _gl_alert_ridio_get(void *data, Evas_Object *obj, const char *part);
119 char * _gl_alert_title_get(void *data, Evas_Object *obj, const char *part);
120 void _show_hourly_alert_list(void* data);
121
122 Evas_Object *_clock_type_cb(void *data);
123
124 void initialize_clock(void *data);
125
126 void _clocklist_load();
127 Eina_List* _get_clock_type_list();
128 void _clocklist_destroy();
129
130 #endif /* SETTING_CLOCK_H_ */