Readloop remove special cases
[citadel.git] / webcit / calendar.h
1 /*
2  * Copyright (c) 1996-2010 by the citadel.org team
3  *
4  * This program is open source software.  You can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 3 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */
18
19 #ifndef __CALENDAR_H__
20 #define __CALENDAR_H__
21 /*
22  * calview contains data passed back and forth between the message fetching loop
23  * and the calendar view renderer.
24  */
25 enum {
26         calview_month,
27         calview_day,
28         calview_week,
29         calview_brief,
30         calview_summary
31 };
32
33 typedef struct _calview {
34         int view;
35         int year;
36         int month;
37         int day;
38         time_t lower_bound;
39         time_t upper_bound;
40 }calview;
41
42 typedef void (*IcalCallbackFunc)(icalcomponent *, long, char*, int, calview *);
43
44 void display_individual_cal(icalcomponent *cal, long msgnum, char *from, int unread, calview *calv);
45 void load_ical_object(long msgnum, int unread,
46                       icalcomponent_kind which_kind,
47                       IcalCallbackFunc CallBack,
48                       calview *calv,
49                       int RenderAsync
50         );
51
52 int calendar_LoadMsgFromServer(SharedMessageStatus *Stat, 
53                                void **ViewSpecific, 
54                                message_summary* Msg, 
55                                int is_new, 
56                                int i);
57 int calendar_RenderView_or_Tail(SharedMessageStatus *Stat, 
58                                 void **ViewSpecific, 
59                                 long oper);
60
61 int calendar_GetParamsGetServerCall(SharedMessageStatus *Stat, 
62                                     void **ViewSpecific, 
63                                     long oper, 
64                                     char *cmd, 
65                                     long len,
66                                     char *filter,
67                                     long flen);
68
69 int calendar_Cleanup(void **ViewSpecific);
70 int __calendar_Cleanup(void **ViewSpecific);
71
72 void render_calendar_view(calview *c);
73 void display_edit_individual_event(icalcomponent *supplied_vtodo, long msgnum, char *from,
74         int unread, calview *calv);
75 void save_individual_event(icalcomponent *supplied_vtodo, long msgnum, char *from,
76         int unread, calview *calv);
77 void ical_dezonify(icalcomponent *cal);
78
79 int tasks_LoadMsgFromServer(SharedMessageStatus *Stat, 
80                             void **ViewSpecific, 
81                             message_summary* Msg, 
82                             int is_new, 
83                             int i);
84
85 void display_edit_task(void);
86 void display_edit_event(void);
87
88 icaltimezone *get_default_icaltimezone(void);
89 void display_icaltimetype_as_webform(struct icaltimetype *, char *, int);
90 void icaltime_from_webform(struct icaltimetype *result, char *prefix);
91 void icaltime_from_webform_dateonly(struct icaltimetype *result, char *prefix);
92 void partstat_as_string(char *buf, icalproperty *attendee);
93 icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp);
94 void check_attendee_availability(icalcomponent *supplied_vevent);
95 int ical_ctdl_is_overlap(
96                         struct icaltimetype t1start,
97                         struct icaltimetype t1end,
98                         struct icaltimetype t2start,
99                         struct icaltimetype t2end
100 );
101
102
103 #endif