KCal Library
icalformat_p.h
Go 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
00033 #ifndef KCAL_ICALFORMAT_P_H
00034 #define KCAL_ICALFORMAT_P_H
00035
00036 #include "freebusy.h"
00037 #include "scheduler.h"
00038
00039 #include <ical.h>
00040
00041 #include <kdatetime.h>
00042
00043 #include <QtCore/QString>
00044 #include <QtCore/QList>
00045
00046 namespace KCal {
00047
00048 class Alarm;
00049 class Attachment;
00050 class Incidence;
00051 class ICalTimeZones;
00052 class Recurrence;
00053 class RecurrenceRule;
00054
00055 #define _ICAL_VERSION "2.0"
00056
00067 class ICalFormatImpl
00068 {
00069 public:
00071 explicit ICalFormatImpl( ICalFormat *parent );
00072
00073 virtual ~ICalFormatImpl();
00074
00080 bool populate( Calendar *calendar, icalcomponent *fs );
00081
00082 icalcomponent *writeIncidence( IncidenceBase *incidence,
00083 iTIPMethod method = iTIPRequest );
00084
00085 icalcomponent *writeTodo( Todo *todo, ICalTimeZones *tzlist = 0,
00086 ICalTimeZones *tzUsedList = 0 );
00087
00088 icalcomponent *writeEvent( Event *event, ICalTimeZones *tzlist = 0,
00089 ICalTimeZones *tzUsedList = 0 );
00090
00091 icalcomponent *writeFreeBusy( FreeBusy *freebusy,
00092 iTIPMethod method = iTIPPublish );
00093
00094 icalcomponent *writeJournal( Journal *journal, ICalTimeZones *tzlist = 0,
00095 ICalTimeZones *tzUsedList = 0 );
00096
00097 void writeIncidence( icalcomponent *parent, Incidence *incidence,
00098 ICalTimeZones *tzlist = 0, ICalTimeZones *tzUsedList = 0 );
00099
00100 icalproperty *writeDescription( const QString &description, bool isRich = false );
00101 icalproperty *writeSummary( const QString &summary, bool isRich = false );
00102 icalproperty *writeLocation( const QString &location, bool isRich = false );
00103 icalproperty *writeAttendee( Attendee *attendee );
00104 icalproperty *writeOrganizer( const Person &organizer );
00105 icalproperty *writeAttachment( Attachment *attach );
00106 icalproperty *writeRecurrenceRule( Recurrence * );
00107 icalrecurrencetype writeRecurrenceRule( RecurrenceRule *recur );
00108 icalcomponent *writeAlarm( Alarm *alarm );
00109
00110 QString extractErrorProperty( icalcomponent * );
00111 Todo *readTodo( icalcomponent *vtodo, ICalTimeZones *tzlist );
00112 Event *readEvent( icalcomponent *vevent, ICalTimeZones *tzlist );
00113 FreeBusy *readFreeBusy( icalcomponent *vfreebusy );
00114 Journal *readJournal( icalcomponent *vjournal, ICalTimeZones *tzlist );
00115 Attendee *readAttendee( icalproperty *attendee );
00116 Person readOrganizer( icalproperty *organizer );
00117 Attachment *readAttachment( icalproperty *attach );
00118 void readIncidence( icalcomponent *parent, Incidence *incidence,
00119 ICalTimeZones *tzlist );
00120 void readRecurrenceRule( icalproperty *rrule, Incidence *event );
00121 void readExceptionRule( icalproperty *rrule, Incidence *incidence );
00122 void readRecurrence( const struct icalrecurrencetype &r,
00123 RecurrenceRule *recur );
00124 void readAlarm( icalcomponent *alarm, Incidence *incidence,
00125 ICalTimeZones *tzlist );
00126
00130 QString loadedProductId() const;
00131
00132 static icaltimetype writeICalDate( const QDate & );
00133
00134 static QDate readICalDate(icaltimetype);
00135
00136 static icaltimetype writeICalDateTime( const KDateTime & );
00137
00138 static icaltimetype writeICalUtcDateTime( const KDateTime & );
00139
00155 static icalproperty *writeICalDateTimeProperty( const icalproperty_kind kind,
00156 const KDateTime &dt,
00157 ICalTimeZones *tzlist = 0,
00158 ICalTimeZones *tzUsedList = 0 );
00159
00172 static KDateTime readICalDateTime( icalproperty *p, const icaltimetype &t,
00173 ICalTimeZones *tzlist, bool utc = false );
00174
00182 static KDateTime readICalUtcDateTime( icalproperty *p, icaltimetype &t,
00183 ICalTimeZones *tzlist = 0 )
00184 { return readICalDateTime( p, t, tzlist, true ); }
00185
00196 static KDateTime readICalDateTimeProperty( icalproperty *p,
00197 ICalTimeZones *tzlist, bool utc = false );
00198
00202 static KDateTime readICalUtcDateTimeProperty( icalproperty *p )
00203 { return readICalDateTimeProperty( p, 0, true ); }
00204
00205 static icaldurationtype writeICalDuration( const Duration &duration );
00206
00207 static Duration readICalDuration( icaldurationtype d );
00208
00209 static icaldatetimeperiodtype writeICalDatePeriod( const QDate &date );
00210
00211 icalcomponent *createCalendarComponent( Calendar *calendar = 0 );
00212
00213 icalcomponent *createScheduleComponent( IncidenceBase *incidence,
00214 iTIPMethod method );
00215
00216 protected:
00217 void dumpIcalRecurrence( icalrecurrencetype r );
00218
00219 private:
00220
00221 class Private;
00222 Private *const d;
00223
00224 };
00225
00226 }
00227
00228 #endif