00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef KMAILICALIFACE_H
00033 #define KMAILICALIFACE_H
00034
00035 #include <dcopobject.h>
00036 #include <qstringlist.h>
00037 #include <kurl.h>
00038
00039
00040
00041
00042
00043 #include <kmail/kmailicalIface.h>
00044
00045 class KMailICalIface : virtual public DCOPObject
00046 {
00047 K_DCOP
00048
00049 public:
00050 k_dcop:
00051 struct SubResource {
00052
00053 SubResource() {}
00054 SubResource( const QString& loc, const QString& lab, bool rw )
00055 : location( loc ), label( lab ), writable( rw ) {}
00056 QString location;
00057 QString label;
00058 bool writable;
00059 };
00060
00066 enum StorageFormat { StorageIcalVcard, StorageXML };
00067
00069 enum FolderChanges { NoChange = 0, Contents = 1, ACL = 2 };
00070
00071 virtual bool isWritableFolder( const QString& type,
00072 const QString& resource ) = 0;
00073
00074 virtual KMailICalIface::StorageFormat storageFormat( const QString& resource ) = 0;
00075
00076 virtual KURL getAttachment( const QString& resource,
00077 Q_UINT32 sernum,
00078 const QString& filename ) = 0;
00079
00082 virtual Q_UINT32 update( const QString& resource,
00083 Q_UINT32 sernum,
00084 const QString& subject,
00085 const QString& plainTextBody,
00086 const QMap<QCString, QString>& customHeaders,
00087 const QStringList& attachmentURLs,
00088 const QStringList& attachmentMimetypes,
00089 const QStringList& attachmentNames,
00090 const QStringList& deletedAttachments ) = 0;
00091
00092 virtual bool deleteIncidenceKolab( const QString& resource,
00093 Q_UINT32 sernum ) = 0;
00094
00097 virtual int incidencesKolabCount( const QString& mimetype,
00098 const QString& resource ) = 0;
00099
00100 virtual QMap<Q_UINT32, QString> incidencesKolab( const QString& mimetype,
00101 const QString& resource,
00102 int startIndex,
00103 int nbMessages ) = 0;
00108 virtual QValueList<KMailICalIface::SubResource> subresourcesKolab( const QString& contentsType ) = 0;
00109
00113 virtual bool triggerSync( const QString & ) = 0;
00114
00115 k_dcop_signals:
00116 void incidenceAdded( const QString& type, const QString& folder,
00117 Q_UINT32 sernum, int format, const QString& entry );
00118 void asyncLoadResult( const QMap<Q_UINT32, QString>, const QString& type,
00119 const QString& folder );
00120 void incidenceDeleted( const QString& type, const QString& folder,
00121 const QString& uid );
00122 void signalRefresh( const QString& type, const QString& folder );
00123 void subresourceAdded( const QString& type, const QString& resource,
00124 const QString& label );
00125 void subresourceDeleted( const QString& type, const QString& resource );
00126 };
00127
00128 inline QDataStream& operator<<( QDataStream& str, const KMailICalIface::SubResource& subResource )
00129 {
00130 str << subResource.location << subResource.label << subResource.writable;
00131 return str;
00132 }
00133 inline QDataStream& operator>>( QDataStream& str, KMailICalIface::SubResource& subResource )
00134 {
00135 str >> subResource.location >> subResource.label >> subResource.writable;
00136 return str;
00137 }
00138
00139 inline QDataStream& operator<<( QDataStream& str, const KMailICalIface::StorageFormat& format )
00140 {
00141 Q_UINT32 foo = format;
00142 str << foo;
00143 return str;
00144 }
00145
00146 inline QDataStream& operator>>( QDataStream& str, KMailICalIface::StorageFormat& format )
00147 {
00148 Q_UINT32 foo;
00149 str >> foo;
00150 format = ( KMailICalIface::StorageFormat )foo;
00151 return str;
00152 }
00153
00154
00155 #endif