2 Copyright (C) 2004-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGiCal_iCalRecurrenceRule_H_
23 #define __NGiCal_iCalRecurrenceRule_H_
25 #import <Foundation/NSObject.h>
30 Encapsulates a (probably complex) recurrence rule by offering
33 NOTE: as of now, only a very limited subset of RFC2445 is implemented.
34 Please see the unit tests for what is covered.
38 iCalRecurrenceFrequenceSecondly = 1,
39 iCalRecurrenceFrequenceMinutely = 2,
40 iCalRecurrenceFrequenceHourly = 3,
41 iCalRecurrenceFrequenceDaily = 4,
42 iCalRecurrenceFrequenceWeekly = 5,
43 iCalRecurrenceFrequenceMonthly = 6,
44 iCalRecurrenceFrequenceYearly = 7,
45 } iCalRecurrenceFrequency;
48 iCalWeekDayMonday = 1,
49 iCalWeekDayTuesday = 2,
50 iCalWeekDayWednesday = 4,
51 iCalWeekDayThursday = 8,
52 iCalWeekDayFriday = 16,
53 iCalWeekDaySaturday = 32,
54 iCalWeekDaySunday = 64,
57 @class NSString, NSCalendarDate, NGCalendarDateRange;
59 @interface iCalRecurrenceRule : NSObject
61 iCalRecurrenceFrequency frequency;
64 NSCalendarDate *untilDate;
66 unsigned weekStart: 7;
73 + (id)recurrenceRuleWithICalRepresentation:(NSString *)_iCalRep;
75 - (void)setFrequency:(iCalRecurrenceFrequency)_frequency;
76 - (iCalRecurrenceFrequency)frequency;
77 - (void)setRepeatInterval:(int)_repeatInterval;
78 - (int)repeatInterval;
80 /* count and untilDate are mutually exclusive */
81 - (void)setRepeatCount:(unsigned)_repeatCount;
82 - (unsigned)repeatCount;
83 - (void)setUntilDate:(NSCalendarDate *)_untilDate;
84 - (NSCalendarDate *)untilDate;
88 /* parse complete iCal RRULE */
89 - (void)setRrule:(NSString *)_rrule;
91 - (NSString *)iCalRepresentation;
95 #endif /* __NGiCal_iCalRecurrenceRule_H_ */