• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KCalCore Library

  • kcalcore
recurrence.h
1 /*
2  This file is part of the kcalcore library.
3 
4  Copyright (c) 1998 Preston Brown <pbrown@kde.org>
5  Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
6  Copyright (c) 2002,2006 David Jarvie <software@astrojar.org.uk>
7  Copyright (C) 2005 Reinhold Kainhofer <reinhold@kainhofer.com>
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Library General Public
11  License as published by the Free Software Foundation; either
12  version 2 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Library General Public License for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with this library; see the file COPYING.LIB. If not, write to
21  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  Boston, MA 02110-1301, USA.
23 */
24 #ifndef KCALCORE_RECURRENCE_H
25 #define KCALCORE_RECURRENCE_H
26 
27 #include "kcalcore_export.h"
28 #include "recurrencerule.h"
29 
30 class QBitArray;
31 
32 namespace KCalCore {
33 
34 class RecurrenceRule;
35 
87 class KCALCORE_EXPORT Recurrence : public RecurrenceRule::RuleObserver
88 {
89  public:
90  class RecurrenceObserver
91  {
92  public:
93  virtual ~RecurrenceObserver();
95  virtual void recurrenceUpdated( Recurrence *r ) = 0;
96  };
97 
99  enum {
100  rNone = 0,
101  rMinutely = 0x001,
102  rHourly = 0x0002,
103  rDaily = 0x0003,
104  rWeekly = 0x0004,
105  rMonthlyPos = 0x0005,
106  rMonthlyDay = 0x0006,
107  rYearlyMonth = 0x0007,
108  rYearlyDay = 0x0008,
109  rYearlyPos = 0x0009,
110  rOther = 0x000A,
111  rMax=0x00FF
112  };
113 
117  Recurrence();
118 
123  Recurrence( const Recurrence &r );
124 
128  ~Recurrence();
129 
135  bool operator==( const Recurrence &r ) const;
136 
142  bool operator!=( const Recurrence &r ) const { return !operator==(r); }
143 
148  Recurrence &operator=( const Recurrence &r );
149 
152  KDateTime startDateTime() const;
154  QDate startDate() const;
160  void setStartDateTime( const KDateTime &start );
161 
168  bool allDay() const;
172  void setAllDay( bool allDay );
173 
175  void setRecurReadOnly( bool readOnly );
176 
178  bool recurReadOnly() const;
179 
181  bool recurs() const;
182 
185  ushort recurrenceType() const;
186 
192  static ushort recurrenceType( const RecurrenceRule *rrule );
193 
200  bool recursOn( const QDate &date, const KDateTime::Spec &timeSpec ) const;
201 
209  bool recursAt( const KDateTime &dt ) const;
210 
215  void unsetRecurs();
216 
220  void clear();
221 
228  TimeList recurTimesOn( const QDate &date, const KDateTime::Spec &timeSpec ) const;
229 
242  DateTimeList timesInInterval( const KDateTime &start, const KDateTime &end ) const;
243 
250  KDateTime getNextDateTime( const KDateTime &preDateTime ) const;
251 
260  KDateTime getPreviousDateTime( const KDateTime &afterDateTime ) const;
261 
263  int frequency() const;
264 
266  void setFrequency( int freq );
267 
272  int duration() const;
273 
276  void setDuration( int duration );
277 
281  int durationTo( const KDateTime &dt ) const;
282 
286  int durationTo( const QDate &date ) const;
287 
291  KDateTime endDateTime() const;
292 
296  QDate endDate() const;
297 
301  void setEndDate( const QDate &endDate );
302 
305  void setEndDateTime( const KDateTime &endDateTime );
306 
321  void shiftTimes( const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec );
322 
333  void setMinutely( int freq );
334 
348  void setHourly( int freq );
349 
363  void setDaily( int freq );
364 
376  void setWeekly( int freq, int weekStart = 1 );
389  void setWeekly( int freq, const QBitArray &days, int weekStart = 1 );
390 
394  void addWeeklyDays( const QBitArray &days );
400  int weekStart() const;
401 
403  QBitArray days() const; // Emulate the old behavior
404 
419  void setMonthly( int freq );
420 
428  void addMonthlyPos( short pos, const QBitArray &days );
429  void addMonthlyPos( short pos, ushort day );
430 
435  void addMonthlyDate( short day );
436 
438  QList<RecurrenceRule::WDayPos> monthPositions() const;
439 
441  // Emulate old behavior
442  QList<int> monthDays() const;
443 
466  void setYearly( int freq );
467 
474  void addYearlyDay( int day );
475 
484  void addYearlyDate( int date );
485 
491  void addYearlyMonth( short _rNum );
492 
509  void addYearlyPos( short pos, const QBitArray &days );
510 
516  QList<int> yearDays() const;
517 
525  QList<int> yearDates() const;
526 
535  QList<int> yearMonths() const;
536 
546  QList<RecurrenceRule::WDayPos> yearPositions() const;
547 
549  static const QDate MAX_DATE;
550 
554  void dump() const;
555 
556  // RRULE
557  RecurrenceRule::List rRules() const;
562  void addRRule( RecurrenceRule *rrule );
563 
570  void removeRRule( RecurrenceRule *rrule );
571 
576  void deleteRRule( RecurrenceRule *rrule );
577 
578  // EXRULE
579  RecurrenceRule::List exRules() const;
580 
585  void addExRule( RecurrenceRule *exrule );
586 
593  void removeExRule( RecurrenceRule *exrule );
594 
599  void deleteExRule( RecurrenceRule *exrule );
600 
601  // RDATE
602  DateTimeList rDateTimes() const;
603  DateList rDates() const;
604  void setRDateTimes( const DateTimeList &rdates );
605  void setRDates( const DateList &rdates );
606  void addRDateTime( const KDateTime &rdate );
607  void addRDate( const QDate &rdate );
608 
609  // ExDATE
610  DateTimeList exDateTimes() const;
611  DateList exDates() const;
612  void setExDateTimes( const DateTimeList &exdates );
613  void setExDates( const DateList &exdates );
614  void addExDateTime( const KDateTime &exdate );
615  void addExDate( const QDate &exdate );
616 
617  RecurrenceRule *defaultRRule( bool create = false ) const;
618  RecurrenceRule *defaultRRuleConst() const;
619  void updated();
620 
628  void addObserver( RecurrenceObserver *observer );
635  void removeObserver( RecurrenceObserver *observer );
636 
637  void recurrenceChanged( RecurrenceRule * );
638 
639  protected:
640  RecurrenceRule *setNewRecurrenceType( RecurrenceRule::PeriodType type, int freq );
641 
642  private:
643  //@cond PRIVATE
644  class Private;
645  Private *const d;
646  //@endcond
647 };
648 
649 }
650 
651 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:24:52 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

Skip menu "KCalCore Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal