3 * Copyright 2012 Samsung Electronics Co., Ltd
5 * Licensed under the Flora License, Version 1.1 (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
9 * http://floralicense.org/license/
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.
19 #ifndef __CALENDAR_H__
20 #define __CALENDAR_H__
22 #include <Elementary.h>
24 #include <calendar2.h>
25 #include <ui-gadget.h>
26 #include <notification.h>
30 #include "cld-utils.h"
31 #include "appcontrol.h"
33 #define CAL_QUICKADD_LONG_PRESS_TIME 0.5
35 #if !defined(CALENDAR_RING)
36 #define CALENDAR_RING "calendar-ring"
40 #define API __attribute__ ((visibility("default")))
43 #if !defined(CALENDAR)
44 # define CALENDAR "calendar"
48 # define VENDOR "org.tizen"
51 #if !defined(CALENDAR_PACKAGE)
52 # define CALENDAR_PACKAGE VENDOR"."CALENDAR
56 # define RESDIR "/usr/apps/"CALENDAR_PACKAGE"/res/"
59 #if !defined(LOCALEDIR)
60 # define LOCALEDIR "/usr/apps/"CALENDAR_PACKAGE"/res/locale"
63 #if !defined(VCALENDAR_DATA_LEN)
64 #define VCALENDAR_DATA_LEN 3000
67 #if !defined(EMAIL_LINK_FLAG)
68 #define EMAIL_LINK_FLAG "#email_viewer_link#"
71 #define CAL_APPSVC_PARAM_CALLER "caller"
72 #define CAL_APPSVC_PARAM_COUNT "count"
73 #define CAL_APPSVC_PARAM_TYPE "type"
74 #define CAL_APPSVC_PARAM_INDEX "index"
75 #define CAL_APPSVC_PARAM_REMINDER_ID "calendar-service/id"
76 #define CAL_APPSVC_PARAM_LOCATION_REMINDER "location_reminder"
94 typedef enum ug_type {
106 Evas_Object *ly; //content
108 Evas_Object *entry; //for title
111 Evas_Object *start_time;
112 Evas_Object *end_time;
113 Ecore_Timer *hold_timer;
115 Evas_Object *segment;
116 Elm_Object_Item *event_item;
117 Elm_Object_Item *task_item;
118 Eina_Bool is_task_selected;
119 Evas_Object *genlist;
137 Eina_Bool is_deleted;
141 CAL_WINDOW_ROTATION_0 = 0,
142 CAL_WINDOW_ROTATION_90 = 90,
143 CAL_WINDOW_ROTATION_180 = 180,
144 CAL_WINDOW_ROTATION_270 = 270,
146 } cal_window_rotation;
148 typedef struct appdata
150 Evas_Object *win; //window
151 Evas_Coord win_w; //width of window
152 Evas_Coord win_h; //height of window
153 app_device_orientation_e orientation; // direction of device
154 Evas_Object *conform; //conformants
155 Evas_Object *base; //base layout
156 Evas_Object *naviframe; //naviframe
157 Evas_Object *title; //title
158 Evas_Object *main; //main view( has year, month, day, list tabs)
159 Evas_Object *bg; //background
160 Evas_Object *cbar; //coontrol bar(calendar,today,delete,create)
162 Elm_Object_Item* main_navi_item; //Naviframe item for main layout.
164 enum cld_view previous_tab;
165 enum cld_view current_tab;
167 enum cld_view request_view; //initial or requested view to show, when app is relaunched,
168 enum cld_view current_view;
169 enum cld_view tapbar_focus_view;// only be CV_YEAR, CV_MONTH, CV_WEEK,CV_DAY,CV_LIST,CV_TODO.
171 Eina_Bool is_update_view; //only update when it is needed
172 Eina_Bool is_pause; //prevent updating view during app pause state
174 struct tm base_tm; //base time
175 int base_hour; // This can be replace to base_tm.tm_hour
176 struct tm today_tm; //today time
177 Ecore_Timer *today_tmr; //to update today when day is changed.
178 Evas_Object *today_edj; //edj for content of month tab, Need to change name to calendar_edj.
180 int wday_start; //0~6, since sunday
182 int cid; //calendar id. for detail, edit view
183 struct tm tm_start; //for detail, edit view
184 struct tm tm_end; //for detail, edit view
186 int acct_id; //this variable always have ALL_VISIBLE_ACCOUT == -2
188 Evas_Object *new_event_button; //button for "Create event"
189 Evas_Object *new_task_button;
190 Elm_Object_Item *bt_delete; //button for "Delete" in controlbar
191 Elm_Object_Item *bt_view; //button for "View" in controlbar
192 Elm_Object_Item *bt_search; //button for "Search" in controlbar
193 Elm_Object_Item *today_item; // scroll to top item of today in list view.
195 Eina_Bool is_aul; //to check wheather launching with AUL
196 Elm_Object_Item* content; //pop all aul content & jump to calendar content.
198 Eina_Bool daily_events_mode; //check whethere monthly tab is for weekly or not.
200 ui_gadget_h ug; //can access to ui_gadget* from ug_data
201 ug_type u_type; //ug type
202 cal_appcontrol_item_type item_type; //request item type for appcontrol
203 calendar_record_h vcalendar; //for vcard raw data used in calendar viewer.
205 int tm_year; //It would be better, if these are changed to struct tm. to save event with specific time
206 int tm_mon; //It would be better, if these are changed to struct tm. to save event with specific time
207 int tm_mday; //It would be better, if these are changed to struct tm. to save event with specific time
209 char *strnote; //to save str from memo
210 Eina_Bool show_save_popup; //to show save popup when edit UG is destroyed
212 Elm_Theme *theme; //theme customization
214 int account_id; //for email sharing feature
215 int mail_id; //for email sharing feature
216 char *src_box; //for email sharing feature
218 Eina_Bool is_magnifying;
219 Eina_Bool is_contracted;
223 Eina_Bool is_display_complete_todo;
225 int is_display_weeknumber;
227 Eina_Bool is_landscape_mode;
229 Evas_Object *navi_title;
231 Eina_Bool need_to_show_popup; // to keep popup for rotating
233 cal_window_rotation rotation;
239 #endif /* __CALENDAR_H__ */