Tizen release 1.0
[apps/core/preloaded/calendar.git] / include / cld.h
1 /*
2
3 Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved
4
5 This file is part of org.tizen.efl-calendar
6 Written by Taeho Kang <taeho84.kang@samsung.com>
7
8 PROPRIETARY/CONFIDENTIAL
9
10 This software is the confidential and proprietary information of
11 SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
12 disclose such Confidential Information and shall use it only in
13 accordance with the terms of the license agreement you entered
14 into with SAMSUNG ELECTRONICS.
15
16 SAMSUNG make no representations or warranties about the suitability
17 of the software, either express or implied, including but not limited
18 to the implied warranties of merchantability, fitness for a particular
19 purpose, or non-infringement. SAMSUNG shall not be liable for any
20 damages suffered by licensee as a result of using, modifying or
21 distributing this software or its derivatives.
22
23 */
24
25
26 #ifndef __CALENDAR_H__
27 #define __CALENDAR_H__
28
29 #include <Elementary.h>
30 #include "cld-log.h"
31 #include "cld-utils.h"
32 #include "cal-svc.h"
33 #include "acct-svc.h"
34
35 #if !defined(CALENDAR_RING)
36 #define CALENDAR_RING "calendar-ring"
37 #endif
38
39 #ifndef API
40 #define API __attribute__ ((visibility("default")))
41 #endif
42
43 #if !defined(CALENDAR_PACKAGE)
44 #  define CALENDAR_PACKAGE "efl-calendar"
45 #endif
46
47 #if !defined(LOCALEDIR)
48 #  define LOCALEDIR "/opt/apps/org.tizen.efl-calendar/res/locale"
49 #endif
50
51 #if !defined(VCALENDAR_DATA_LEN)
52 #define VCALENDAR_DATA_LEN 3000
53 #endif
54
55 enum cld_view {
56         CV_UNKNOWN = 0,
57         CV_YEAR,
58         CV_MONTH,
59         CV_DAY,
60         CV_LIST,
61         CV_EDIT,
62         CV_DETAIL,
63 };
64
65 typedef enum ug_type {
66         UG_UNKNOWN = 0,
67         UG_DETAIL,
68         UG_EDIT,
69         UG_MAX,
70 }ug_type;
71
72 typedef struct appdata
73 {
74         Evas_Object *win;                       //window
75         Evas_Coord win_w;                               //width of window
76         Evas_Coord win_h;                                       //height of window
77         Evas_Object *base;                      //base layout
78         Evas_Object *nv;                                //naviframe
79         Evas_Object *title;                     //title
80         Evas_Object *main;                      //main view( has year, month, day, list tabs)
81         Evas_Object *bg;                                //background
82         Evas_Object *cbar;              //coontrol bar(calendar,today,delete,create)
83
84         Elm_Object_Item* main_navi_item;        //Naviframe item for main layout.
85
86         enum cld_view request_view;     //initial or requested view to show, when app is relaunched,
87
88         Eina_Bool is_update_view;       //only update when it is needed
89         Eina_Bool is_pause;                     //prevent updating view during app pause state
90
91         struct tm base_tm;              //base time
92         int base_hour;                  // This can be replace to base_tm.tm_hour
93         struct tm today_tm;             //today time
94         Ecore_Timer *today_tmr;         //to update today when day is changed.
95         Evas_Object *today_edj;         //edj for content of month tab, Need to change name to calendar_edj.
96
97         int wday_start;                 //0~6, since sunday
98
99         int cid;                                        //calendar id. for detail, edit view
100         struct tmnode* tm;              //for repeat event
101         int acct_id;                            //this variable always have ALL_VISIBLE_ACCOUT == -2
102
103         Elm_Object_Item *bt_new;        //button for "Create event" in controlbar
104         Elm_Object_Item *bt_delete; //button for "Delete" in controlbar
105         Elm_Object_Item *today_item;    // scroll to top item of today in list view.
106
107         int notifd;                             //for heynoti
108         cal_struct* ical;                               //for vcard raw data used in calendar viewer.
109         Eina_Bool is_aul;                       //to check wheather launching with AUL
110         Elm_Object_Item* content;               //pop all aul content & jump to calendar content.
111
112         Eina_Bool edit_special_one;     //to remove this, cal_edit_create_view should have 1 more parameter.
113         Eina_Bool is_weekly;                    //check whethere monthly tab is for weekly or not.
114
115         struct ui_gadget *ug;           //can access to ui_gadget* from ug_data
116         ug_type u_type;                 //ug type
117
118         int tm_year;                            //It would be better, if these are changed to struct tm. to save event with specific time
119         int tm_mon;                             //It would be better, if these are changed to struct tm. to save event with specific time
120         int tm_mday;                            //It would be better, if these are changed to struct tm. to save event with specific time
121
122         char *strnote;                  //to save str  from memo
123         Eina_Bool show_save_popup;      //to show save popup when edit UG is destroyed
124         int is_hour24;                  //to show time as 12 or 24 format
125
126         Elm_Theme *theme;               //theme customization
127
128         int account_id;                 //for email sharing feature
129         int mail_id;                            //for email sharing feature
130         char *src_box;                  //for email sharing feature
131
132         Evas_Object *tabbar;
133 }ug_data;
134
135 #endif /* __CALENDAR_H__ */
136