libkcal
icalformatimpl.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
00022 #ifndef KCAL_ICALFORMATIMPL_H
00023 #define KCAL_ICALFORMATIMPL_H
00024
00025 #include <qstring.h>
00026 #include <qdict.h>
00027
00028 #include "scheduler.h"
00029 #include "freebusy.h"
00030
00031
00032 extern "C" {
00033 #include <ical.h>
00034 }
00035
00036 namespace KCal {
00037
00038 class Compat;
00039
00045 class ICalFormatImpl
00046 {
00047 public:
00049 ICalFormatImpl( ICalFormat *parent );
00050 virtual ~ICalFormatImpl();
00051
00052 bool populate( Calendar *, icalcomponent *fs);
00053
00054 icalcomponent *writeIncidence(IncidenceBase *incidence, Scheduler::Method method = Scheduler::Request );
00055 icalcomponent *writeTodo(Todo *todo);
00056 icalcomponent *writeEvent(Event *event);
00057 icalcomponent *writeFreeBusy(FreeBusy *freebusy,
00058 Scheduler::Method method = Scheduler::Publish );
00059 icalcomponent *writeJournal(Journal *journal);
00060 void writeIncidence(icalcomponent *parent,Incidence *incidence);
00061 icalproperty *writeAttendee(Attendee *attendee);
00062 icalproperty *writeOrganizer( const Person &organizer );
00063 icalproperty *writeAttachment(Attachment *attach);
00064 icalproperty *writeRecurrenceRule(Recurrence *);
00065 icalrecurrencetype writeRecurrenceRule( RecurrenceRule *recur );
00066 icalcomponent *writeAlarm(Alarm *alarm);
00067
00068 QString extractErrorProperty(icalcomponent *);
00069 Todo *readTodo(icalcomponent *vtodo);
00070 Event *readEvent(icalcomponent *vevent, icalcomponent *vtimezone);
00071 FreeBusy *readFreeBusy(icalcomponent *vfreebusy);
00072 Journal *readJournal(icalcomponent *vjournal);
00073 Attendee *readAttendee(icalproperty *attendee);
00074 Person readOrganizer( icalproperty *organizer );
00075 Attachment *readAttachment(icalproperty *attach);
00076 void readIncidence(icalcomponent *parent, icaltimezone *timezone, Incidence *incidence);
00077 void readRecurrenceRule(icalproperty *rrule,Incidence *event );
00078 void readExceptionRule( icalproperty *rrule, Incidence *incidence );
00079 void readRecurrence( const struct icalrecurrencetype &r, RecurrenceRule* recur );
00080 void readAlarm(icalcomponent *alarm,Incidence *incidence);
00082 const QString &loadedProductId() { return mLoadedProductId; }
00083
00084 static icaltimetype writeICalDate(const QDate &);
00085 static QDate readICalDate(icaltimetype);
00086 icaltimetype writeICalDateTime(const QDateTime &);
00087 QDateTime readICalDateTime( icaltimetype&, icaltimezone* tz = 0 );
00088 static icaldurationtype writeICalDuration(int seconds);
00089 static int readICalDuration(icaldurationtype);
00090 static icaldatetimeperiodtype writeICalDatePeriod( const QDate &date );
00091 icaldatetimeperiodtype writeICalDateTimePeriod( const QDateTime &date );
00092
00093 icalcomponent *createCalendarComponent(Calendar * = 0);
00094 icalcomponent *createScheduleComponent(IncidenceBase *,Scheduler::Method);
00095
00096 protected:
00097 void dumpIcalRecurrence(icalrecurrencetype);
00098 private:
00099 void writeIncidenceBase(icalcomponent *parent,IncidenceBase *);
00100 void readIncidenceBase(icalcomponent *parent, IncidenceBase *);
00101 void writeCustomProperties(icalcomponent *parent,CustomProperties *);
00102 void readCustomProperties(icalcomponent *parent,CustomProperties *);
00103 void readTimezone(icalcomponent *vtimezone);
00104
00105 ICalFormat *mParent;
00106 Calendar *mCalendar;
00107
00108 QString mLoadedProductId;
00109
00110 Event::List mEventsRelate;
00111 Todo::List mTodosRelate;
00112
00113 static const int mSecondsPerWeek;
00114 static const int mSecondsPerDay;
00115 static const int mSecondsPerHour;
00116 static const int mSecondsPerMinute;
00117
00118 Compat *mCompat;
00119
00120 class ToComponentVisitor;
00121 class Private;
00122 Private *d;
00123 };
00124
00125 }
00126
00127 #endif
|