libkcal
icalrecur.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00069 #ifndef ICALRECUR_H
00070 #define ICALRECUR_H
00071
00072 #include <time.h>
00073 #include "icaltime.h"
00074
00075
00076
00077
00078
00079 typedef enum icalrecurrencetype_frequency
00080 {
00081
00082
00083
00084 ICAL_SECONDLY_RECURRENCE=0,
00085 ICAL_MINUTELY_RECURRENCE=1,
00086 ICAL_HOURLY_RECURRENCE=2,
00087 ICAL_DAILY_RECURRENCE=3,
00088 ICAL_WEEKLY_RECURRENCE=4,
00089 ICAL_MONTHLY_RECURRENCE=5,
00090 ICAL_YEARLY_RECURRENCE=6,
00091 ICAL_NO_RECURRENCE=7
00092
00093 } icalrecurrencetype_frequency;
00094
00095 typedef enum icalrecurrencetype_weekday
00096 {
00097 ICAL_NO_WEEKDAY,
00098 ICAL_SUNDAY_WEEKDAY,
00099 ICAL_MONDAY_WEEKDAY,
00100 ICAL_TUESDAY_WEEKDAY,
00101 ICAL_WEDNESDAY_WEEKDAY,
00102 ICAL_THURSDAY_WEEKDAY,
00103 ICAL_FRIDAY_WEEKDAY,
00104 ICAL_SATURDAY_WEEKDAY
00105 } icalrecurrencetype_weekday;
00106
00107 enum {
00108 ICAL_RECURRENCE_ARRAY_MAX = 0x7f7f,
00109 ICAL_RECURRENCE_ARRAY_MAX_BYTE = 0x7f
00110 };
00111
00112
00113
00118
00119
00120
00121 #define ICAL_BY_SECOND_SIZE 61
00122 #define ICAL_BY_MINUTE_SIZE 61
00123 #define ICAL_BY_HOUR_SIZE 25
00124 #define ICAL_BY_DAY_SIZE 364
00125 #define ICAL_BY_MONTHDAY_SIZE 32
00126 #define ICAL_BY_YEARDAY_SIZE 367
00127 #define ICAL_BY_WEEKNO_SIZE 54
00128 #define ICAL_BY_MONTH_SIZE 13
00129 #define ICAL_BY_SETPOS_SIZE 367
00130
00132 struct icalrecurrencetype
00133 {
00134 icalrecurrencetype_frequency freq;
00135
00136
00137
00138 struct icaltimetype until;
00139 int count;
00140
00141 short interval;
00142
00143 icalrecurrencetype_weekday week_start;
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 short by_second[ICAL_BY_SECOND_SIZE];
00155 short by_minute[ICAL_BY_MINUTE_SIZE];
00156 short by_hour[ICAL_BY_HOUR_SIZE];
00157 short by_day[ICAL_BY_DAY_SIZE];
00158 short by_month_day[ICAL_BY_MONTHDAY_SIZE];
00159 short by_year_day[ ICAL_BY_YEARDAY_SIZE];
00160 short by_week_no[ICAL_BY_WEEKNO_SIZE];
00161 short by_month[ICAL_BY_MONTH_SIZE];
00162 short by_set_pos[ICAL_BY_SETPOS_SIZE];
00163 };
00164
00165
00166 void icalrecurrencetype_clear(struct icalrecurrencetype *r);
00167
00178 enum icalrecurrencetype_weekday icalrecurrencetype_day_day_of_week(short day);
00179
00181 int icalrecurrencetype_day_position(short day);
00182
00183
00187 struct icalrecurrencetype icalrecurrencetype_from_string(const char* str);
00188 char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur);
00189
00190
00193 typedef struct icalrecur_iterator_impl icalrecur_iterator;
00194
00196 icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule,
00197 struct icaltimetype dtstart);
00198
00200 struct icaltimetype icalrecur_iterator_next(icalrecur_iterator*);
00201
00202 void icalrecur_iterator_decrement_count(icalrecur_iterator*);
00203
00205 void icalrecur_iterator_free(icalrecur_iterator*);
00206
00211 int icalrecur_expand_recurrence(char* rule, time_t start,
00212 int count, time_t* array);
00213
00214
00215 #endif
|