tizen 2.4 release
[apps/home/settings.git] / setting-time / include / setting-time.h
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #ifndef __SETTING_TIME_H__
22 #define __SETTING_TIME_H__
23
24 #include <stdio.h>
25 #include <time.h>
26 #include <sys/ioctl.h>
27 #include <linux/rtc.h>
28 #include <fcntl.h>
29 #include <unistd.h>
30 #include <Elementary.h>
31 #include <alarm.h>
32
33 #include <glib-object.h>
34
35 #include <setting-common-draw-widget.h>
36 #include <setting-common-view.h>
37
38 #define ERR_BIGGER_THAN_2037 "Cannot Set the year bigger than 2037"
39 #define AUTO_TIME_UPDATE_ON  "Automatic time update is ON!"
40 #define SETTING_TIME_AUTO_UPDATE_DESC  "IDS_ST_BODY_USE_TIME_PROVIDED_BY_NETWORK"
41 #define NOT_SUPPORT_AUTO_UPDATE_DESC "IDS_ST_POP_AUTO_TIME_UPDATE_UNAVAILABLE_CHOOSE_ALTERNATIVE_TIME_SET_MODE_JPN_SBM"
42
43
44 #define DATE_TIME_STR_AUTOMATIC_UPDATE "IDS_ST_MBODY_AUTO_UPDATE"
45 #define DATE_TIME_STR_TIME_ZONE         "IDS_ST_BODY_TIME_ZONE"
46 #define DATE_TIME_STR_DATE_AND_TIME "IDS_ST_BODY_DATE_AND_TIME"
47 #define DATE_TIME_STR_TIME_FORMAT   "IDS_ST_BODY_MSG_TIME_FORMAT"
48
49
50 typedef struct _SettingTimeUG SettingTimeUG;
51
52 /**
53  * Setting Time UG context
54  * all UG function has void* as an agument. this is casted back to SettingTimeUG
55  * and the functions access app context.
56  */
57 struct _SettingTimeUG {
58
59         ui_gadget_h ug; /**< ug struct itself */
60
61         /* add more variables here (move your appdata to here) */
62         int noti_fd;
63
64         app_control_h bundle_data; /**< when loading this UG, bundle is stored */
65         Evas *evas;
66         Evas_Object *win_main_layout;
67         Evas_Object *win_get;
68         Evas_Object *ly_main;
69
70         ui_gadget_h ug_loading;
71
72         Evas_Object *navi_bar;
73         Evas_Object *scrl_main;
74         char *caller;
75
76 #ifdef USE_TIMER_UPDATE_TIME_IN_TIME_VIEW
77         Ecore_Timer *update_timer;
78 #endif
79         Evas_Object *pop_progress;
80         Evas_Object *pop;
81         Eina_Bool is_datefield_selected;
82
83         /*  UI   */
84         Setting_GenGroupItem_Data *data_auto;
85         Setting_GenGroupItem_Data *data_tz;
86         Setting_GenGroupItem_Data *data_time;
87         Setting_GenGroupItem_Data *data_time_fmt;
88         Setting_GenGroupItem_Data *data_date_fmt;
89
90         /*Evas_Object *chk_dst; */
91         /*Evas_Object *chk_auto; */
92
93         Elm_Genlist_Item_Class itc_2text_2;
94         Elm_Genlist_Item_Class itc_2text_arrow;
95         Elm_Genlist_Item_Class itc_1text_1icon;
96         Elm_Genlist_Item_Class itc_layout;
97         Elm_Genlist_Item_Class itc_2text_3_parent;
98         Elm_Genlist_Item_Class itc_1icon_1text_sub;
99
100         Ecore_Idler *update_timezone_idler;
101         Ecore_Idler *refresh_time_idler;
102
103         int is_expand_time_format_list;
104 };
105
106 extern setting_view setting_view_time_main;
107
108 #endif                          /* __SETTING_TIME_H__ */