3 * Copyright 2012 Samsung Electronics Co., Ltd
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
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>
30 #include "cld-utils.h"
32 #define CAL_QUICKADD_LONG_PRESS_TIME 0.5
34 #if !defined(CALENDAR_RING)
35 #define CALENDAR_RING "calendar-ring"
39 #define API __attribute__ ((visibility("default")))
42 #if !defined(CALENDAR)
43 # define CALENDAR "calendar"
47 # define VENDOR "org.tizen"
50 #if !defined(CALENDAR_PACKAGE)
51 # define CALENDAR_PACKAGE VENDOR"."CALENDAR
55 # define RESDIR "/usr/apps/"CALENDAR_PACKAGE"/res/"
58 #if !defined(LOCALEDIR)
59 # define LOCALEDIR "/usr/apps/"CALENDAR_PACKAGE"/res/locale"
62 #if !defined(VCALENDAR_DATA_LEN)
63 #define VCALENDAR_DATA_LEN 3000
66 #if !defined(EMAIL_LINK_FLAG)
67 #define EMAIL_LINK_FLAG "#email_viewer_link#"
70 #define CAL_APPCONTROL_ITEM_TYPE "itemType"
71 #define CAL_APPCONTROL_ITEM_TYPE_EVENT "event"
72 #define CAL_APPCONTROL_ITEM_TYPE_TODO "todo"
73 #define CAL_APPCONTROL_ITEM_TYPE_VCS "vcs"
74 #define CAL_APPCONTROL_EVENT_ID "eventId"
75 #define CAL_APPCONTROL_TODO_ID "todoId"
76 #define CAL_APPCONTROL_VCS_PATH "path"
78 #define CAL_APPSVC_PARAM_CALLER "caller"
79 #define CAL_APPSVC_PARAM_COUNT "count"
80 #define CAL_APPSVC_PARAM_TYPE "type"
81 #define CAL_APPSVC_PARAM_INDEX "index"
82 #define CAL_APPSVC_PARAM_REMINDER_ID "calendar-service/id"
83 #define CAL_APPSVC_PARAM_LOCATION_REMINDER "location_reminder"
101 typedef enum ug_type {
109 ITEM_TYPE_UNKNOWN = 0,
114 }cal_appcontrol_item_type;
120 Evas_Object *ly; //content
122 Evas_Object *entry; //for title
125 Evas_Object *start_time;
126 Evas_Object *end_time;
127 Ecore_Timer *hold_timer;
129 Evas_Object *segment;
130 Elm_Object_Item *event_item;
131 Elm_Object_Item *task_item;
132 Eina_Bool is_task_selected;
133 Evas_Object *genlist;
151 Eina_Bool is_deleted;
154 typedef struct appdata
156 Evas_Object *win; //window
157 Evas_Coord win_w; //width of window
158 Evas_Coord win_h; //height of window
159 Evas_Object *conform; //conformants
160 Evas_Object *base; //base layout
161 Evas_Object *naviframe; //naviframe
162 Evas_Object *title; //title
163 Evas_Object *main; //main view( has year, month, day, list tabs)
164 Evas_Object *bg; //background
165 Evas_Object *cbar; //coontrol bar(calendar,today,delete,create)
167 Elm_Object_Item* main_navi_item; //Naviframe item for main layout.
169 enum cld_view previous_tab;
170 enum cld_view current_tab;
172 enum cld_view request_view; //initial or requested view to show, when app is relaunched,
173 enum cld_view current_view;
174 enum cld_view tapbar_focus_view;// only be CV_YEAR, CV_MONTH, CV_WEEK,CV_DAY,CV_LIST,CV_TODO.
176 Eina_Bool is_update_view; //only update when it is needed
177 Eina_Bool is_pause; //prevent updating view during app pause state
179 struct tm base_tm; //base time
180 int base_hour; // This can be replace to base_tm.tm_hour
181 struct tm today_tm; //today time
182 Ecore_Timer *today_tmr; //to update today when day is changed.
183 Evas_Object *today_edj; //edj for content of month tab, Need to change name to calendar_edj.
185 int wday_start; //0~6, since sunday
187 int cid; //calendar id. for detail, edit view
188 struct tm tm_start; //for detail, edit view
189 struct tm tm_end; //for detail, edit view
191 int acct_id; //this variable always have ALL_VISIBLE_ACCOUT == -2
193 Evas_Object *new_event_button; //button for "Create event"
194 Evas_Object *new_task_button;
195 Elm_Object_Item *bt_delete; //button for "Delete" in controlbar
196 Elm_Object_Item *bt_view; //button for "View" in controlbar
197 Elm_Object_Item *bt_search; //button for "Search" in controlbar
198 Elm_Object_Item *today_item; // scroll to top item of today in list view.
200 Eina_Bool is_aul; //to check wheather launching with AUL
201 Elm_Object_Item* content; //pop all aul content & jump to calendar content.
203 Eina_Bool daily_events_mode; //check whethere monthly tab is for weekly or not.
205 ui_gadget_h ug; //can access to ui_gadget* from ug_data
206 ug_type u_type; //ug type
207 cal_appcontrol_item_type item_type; //request item type for appcontrol
208 calendar_record_h vcalendar; //for vcard raw data used in calendar viewer.
210 int tm_year; //It would be better, if these are changed to struct tm. to save event with specific time
211 int tm_mon; //It would be better, if these are changed to struct tm. to save event with specific time
212 int tm_mday; //It would be better, if these are changed to struct tm. to save event with specific time
214 char *strnote; //to save str from memo
215 Eina_Bool show_save_popup; //to show save popup when edit UG is destroyed
217 Elm_Theme *theme; //theme customization
219 int account_id; //for email sharing feature
220 int mail_id; //for email sharing feature
221 char *src_box; //for email sharing feature
223 Eina_Bool is_magnifying;
224 Eina_Bool is_contracted;
228 Eina_Bool is_display_complete_todo;
230 int is_display_weeknumber;
232 Eina_Bool is_landscape_mode;
234 Evas_Object *navi_title;
236 Eina_Bool need_to_show_popup; // to keep popup for rotating
242 #endif /* __CALENDAR_H__ */