KCal Library
vcalformat.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
00038 #ifndef KCAL_VCALFORMAT_H
00039 #define KCAL_VCALFORMAT_H
00040
00041 #include "calformat.h"
00042 #include "todo.h"
00043 #include "event.h"
00044 #include "kcal_export.h"
00045
00046 #include <kdatetime.h>
00047
00048 #include <QtCore/QByteArray>
00049
00050 #define _VCAL_VERSION "1.0"
00051
00052 struct VObject;
00053
00054 namespace KCal {
00055
00056 class KCAL_EXPORT VCalFormat : public CalFormat
00057 {
00058 public:
00059 VCalFormat();
00060 virtual ~VCalFormat();
00061
00066 bool load( Calendar *calendar, const QString &fileName );
00067
00072 bool save( Calendar *calendar, const QString &fileName );
00073
00078 bool fromString( Calendar *calendar, const QString &string );
00079
00084 QString toString( Calendar *calendar );
00085
00090 bool fromRawString( Calendar *calendar, const QByteArray &string );
00091
00092 protected:
00096 Todo *VTodoToEvent( VObject *vtodo );
00097
00101 Event *VEventToEvent( VObject *vevent );
00102
00106 VObject *eventToVTodo( const Todo *anEvent );
00107
00111 VObject *eventToVEvent( const Event *anEvent );
00112
00116 QString qDateToISO( const QDate &date );
00117
00121 QString kDateTimeToISO( const KDateTime &date, bool zulu=true );
00122
00126 KDateTime ISOToKDateTime( const QString &dtStr );
00127
00131 QDate ISOToQDate( const QString &dtStr );
00132
00137 void populate( VObject *vcal );
00138
00145 const char *dayFromNum( int day );
00146
00148 int numFromDay( const QString &day );
00149
00150 Attendee::PartStat readStatus( const char *s ) const;
00151 QByteArray writeStatus( Attendee::PartStat status ) const;
00152
00153 private:
00157 enum PilotState {
00158 SYNCNONE = 0,
00159 SYNCMOD = 1,
00160 SYNCDEL = 3
00161 };
00162
00163
00164 Q_DISABLE_COPY( VCalFormat )
00165 class Private;
00166 Private *const d;
00167
00168 };
00169
00170 }
00171
00172 #endif