upload codes for TIZEN 2.0
[apps/home/clock.git] / alarm / include / alarm_app.h
1 /*
2 *
3 * Copyright 2012  Samsung Electronics Co., Ltd
4 *
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
8 *
9 *    http://www.tizenopensource.org/license
10 *
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.
16 *
17 */
18
19 #ifndef __ALARM_H__
20 #define __ALARM_H__
21
22 #include <Elementary.h>
23 #include <appcore-efl.h>
24 #include <vconf.h>
25 #include <vconf-keys.h>
26 #include <alarm.h>
27 #include <alarm-engine.h>
28 #include <mm_session_private.h>
29 #include <mm_message.h>
30 #include <mm_player.h>
31 #include <mm_types.h>
32 #include <mm_error.h>
33 #include <utilX.h>
34 #include <Ecore_X.h>
35 #include <Ecore_File.h>
36 #include <ui-gadget.h>
37 #include <ui-gadget-module.h>
38 #include "alarm_lib.h"
39 #include "alarm_define.h"
40 #include "alarm_fwk_db.h"
41 #include "alarm_fwk_alarmmgr.h"
42 #include "alarm_fwk_genlist.h"
43 #include "alarm_fwk_icu.h"
44 #include "clock_fwk_sound.h"
45 #include "clock_fwk_view.h"
46 #include "alarm_fwk_widget.h"
47 /**********************************************************************
48 ******************define, struct ,typedef, union, enum, global val *************************************
49 ***********************************************************************/
50
51 //******************typedef *************************************
52 typedef struct _genlist_view genlist_view;
53 typedef struct _delete_view delete_view;
54 typedef struct _setting_view setting_view;
55 typedef struct _snooze_view snooze_view;
56 //typedef struct appdata          appdata;
57
58 //******************enum *************************************
59 typedef enum {
60         PAGE_ALARM_GENLIST = 0x01,
61         PAGE_ALARM_SETTING,
62         PAGE_ALARM_DELETE,
63         PAGE_ALARM_SNOOZE,
64         PAGE_ALARM_TONE,
65         PAGE_ALARM_MAX,
66 } TYPE_CURRENT_PAGE;
67
68 typedef enum {
69         TYPE_ENTER_PG_SETTING_NORMAL = 0,
70         TYPE_ENTER_PG_SETTING_MORNINGCALL,
71         TYPE_ENTER_PG_SETTING_MAX,
72 } TYPE_ENTER_PG_SETTING;
73 //******************struct *************************************
74
75 //genlist view
76 struct _genlist_view {
77         Evas_Object *eo_parent; //parent
78         Evas_Object *eo_navibar;        //navi_bar
79         Elm_Object_Item *ei_naviframe;
80         Evas_Object *eo_controlbar;     //controlbar
81         Evas_Object *eo_btn_lft, *eo_btn_rht;   //button
82         Elm_Object_Item *eci_btn_lft, *eci_btn_rht;
83         Evas_Object *eo_btn_back;       //button back
84         Evas_Object *eo_layout; //layout
85         Evas_Object *eo_content;        //content
86         //
87         Evas_Object *eo_genlist;        //genlist
88         Evas_Object *eo_noalarm;        //noalarm
89         int total_number;       //total number
90 };
91 //
92 struct _delete_view {
93         Evas_Object *eo_parent; //parent
94         Evas_Object *eo_navibar;        //navi_bar
95         Elm_Object_Item *ei_naviframe;
96         Evas_Object *eo_controlbar;     //controlbar
97         Evas_Object *eo_btn_lft, *eo_btn_rht;   //button
98         Elm_Object_Item *eci_btn_lft, *eci_btn_rht;
99         Evas_Object *eo_btn_back;       //button back
100         Evas_Object *eo_layout; //layout
101         Evas_Object *eo_content;        //content
102         //
103         Evas_Object *eo_selectall_ly;   //selectall
104         Evas_Object *eo_selectall_chk;  //selectall
105         Evas_Object *eo_genlist;        //genlist
106         int total_number;       //total number
107         int chk_number;         //check number
108         Eina_Bool bSelectAll;   //select all is selected
109
110         Evas_Object *eo_notify_ly;      //layout for notify
111         Evas_Object *eo_notify; //notify
112 };
113 //
114 struct _setting_view {
115         Evas_Object *eo_parent; //parent
116         Evas_Object *eo_navibar;        //navi_bar
117         Elm_Object_Item *ei_naviframe; //naviframe
118         Evas_Object *eo_controlbar;     //controlbar
119         Evas_Object *eo_btn_lft;        //save button on the top
120         Evas_Object *eo_btn_rht;        //cancel button on the top
121         Elm_Object_Item *eci_btn_lft; // save button on the  bottom
122         Elm_Object_Item *eci_btn_rht; //cancel button on the bottom
123         Evas_Object *eo_btn_back;       //button back
124         Evas_Object *eo_layout; //layout
125         Evas_Object *eo_content;        //content
126         Evas_Object *eo_genlist;        //genlist
127         Evas_Object *eo_conform;        //conform
128         AData tmp_alarm;
129         //time
130         Evas_Object *eo_datefield;
131         Elm_Object_Item *item_time;
132         //repeat
133         Elm_Object_Item *item_repeat;
134         //snooze
135         Elm_Object_Item *item_snooze;
136         Elm_Object_Item *item_snooze_setting;
137         //name
138         Evas_Object *eo_name_editfield;
139         Evas_Object *eo_name_entry;
140         Ecore_IMF_Context *imf_name;
141         Elm_Object_Item *item_name;
142         //type
143         Evas_Object *eo_type_radiogroup;
144         clk_sound_mgr_t *pSoundMgrForType;
145         Elm_Object_Item *item_type;
146         //tone
147         Ecore_File_Monitor *pFileMonitor;
148         struct ui_gadget *gadget;
149         Evas_Object *eo_ug_ly_effect;   //for ug effect
150         Elm_Object_Item *item_tone;
151         //volume
152         Evas_Object *eo_volume_slider, *eo_volume_sub, *eo_volume_add;
153         clk_sound_mgr_t *pSoundMgrForVolume;
154         Elm_Object_Item *item_volume;
155 };
156 //
157 struct _snooze_view {
158         Evas_Object *eo_parent; //parent
159         Evas_Object *eo_navibar;        //navi_bar
160         Elm_Object_Item *ei_naviframe;
161         //Evas_Object *eo_controlbar;    //controlbar
162         //Evas_Object *eo_btn_lft, *eo_btn_rht;   //button
163         Evas_Object *eo_btn_back;       //button back
164         Evas_Object *eo_layout; //layout
165         Evas_Object *eo_content;        //content
166         //
167         Evas_Object *eo_genlist;        //genlist
168         //duration
169         Evas_Object *eo_radiogroup_duration;    //radiogroup for duration
170         Elm_Object_Item *item_duration;
171         //repeat
172         Evas_Object *eo_radiogroup_repeat;      //radiogroup for repeat
173         Elm_Object_Item *item_repeat;
174 };
175 //
176 struct appdata {
177         //main view
178         Evas *evas;
179         Evas_Object *win_main;
180         Evas_Object *bg;
181         Evas_Object *layout_main;
182         Evas_Object *parent;
183         //
184         Evas_Object *layout;
185         Evas_Object *navi_bar;
186         alarm_set_controlbar_visible alarmapp_controlbar_cb;
187         AData *alarm;
188         Eina_Bool is_new;       //is a new alarm or not, for enter setting view
189         Eina_Bool is_alarm;     //clock current view is alarm
190         int time_format;        //VCONFKEY_TIME_FORMAT_12/VCONFKEY_TIME_FORMAT_24
191         TYPE_CURRENT_PAGE page; //current view page
192         TYPE_ENTER_PG_SETTING type_enter_pg_setting;    //enum TYPE_ENTER_PG_SETTING
193         //
194         genlist_view *view_genlist;
195         delete_view *view_delete;
196         setting_view *view_setting;
197         snooze_view *view_snooze;
198 };
199
200 extern clk_view alarm_view_delete;
201 extern clk_view alarm_view_genlist;
202 extern clk_view alarm_view_setting;
203 extern clk_view alarm_view_snooze;
204
205 #endif                          /* __ALARM_H__ */