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, bool ar )
00055 : location( loc ), label( lab ), writable( rw ), alarmRelevant( ar ) {}
00056 QString location;
00057 QString label;
00058 bool writable;
00059 bool alarmRelevant;
00060 };
00061
00067 enum StorageFormat { StorageIcalVcard, StorageXML };
00068
00070 enum FolderChanges { NoChange = 0, Contents = 1, ACL = 2 };
00071
00072 virtual bool isWritableFolder( const QString& type,
00073 const QString& resource ) = 0;
00074
00075 virtual KMailICalIface::StorageFormat storageFormat( const QString& resource ) = 0;
00076
00077 virtual KURL getAttachment( const QString& resource,
00078 Q_UINT32 sernum,
00079 const QString& filename ) = 0;
00080 virtual QString attachmentMimetype( const QString &resource,
00081 Q_UINT32 sernum,
00082 const QString &filename ) = 0;
00083
00084 virtual QStringList listAttachments( const QString &resource, Q_UINT32 sernum ) = 0;
00085
00088 virtual Q_UINT32 update( const QString& resource,
00089 Q_UINT32 sernum,
00090 const QString& subject,
00091 const QString& plainTextBody,
00092 const QMap<QCString, QString>& customHeaders,
00093 const QStringList& attachmentURLs,
00094 const QStringList& attachmentMimetypes,
00095 const QStringList& attachmentNames,
00096 const QStringList& deletedAttachments ) = 0;
00097
00098 virtual bool deleteIncidenceKolab( const QString& resource,
00099 Q_UINT32 sernum ) = 0;
00100
00103 virtual int incidencesKolabCount( const QString& mimetype ,
00104 const QString& resource ) = 0;
00105
00106 virtual QMap<Q_UINT32, QString> incidencesKolab( const QString& mimetype,
00107 const QString& resource,
00108 int startIndex,
00109 int nbMessages ) = 0;
00114 virtual QValueList<KMailICalIface::SubResource> subresourcesKolab( const QString& contentsType ) = 0;
00115
00121 virtual bool addSubresource( const QString& resource,
00122 const QString& parent,
00123 const QString& contentsType ) = 0;
00128 virtual bool removeSubresource( const QString& resource ) = 0;
00129
00133 virtual bool triggerSync( const QString & ) = 0;
00134
00135 k_dcop_signals:
00136 void incidenceAdded( const QString& type, const QString& folder,
00137 Q_UINT32 sernum, int format, const QString& entry );
00138 void asyncLoadResult( const QMap<Q_UINT32, QString>, const QString& type,
00139 const QString& folder );
00140 void incidenceDeleted( const QString& type, const QString& folder,
00141 const QString& uid );
00142 void signalRefresh( const QString& type, const QString& folder );
00143 void subresourceAdded( const QString& type, const QString& resource,
00144 const QString& label, bool writable, bool alarmRelevant );
00145 void subresourceDeleted( const QString& type, const QString& resource );
00146 };
00147
00148 inline QDataStream& operator<<( QDataStream& str, const KMailICalIface::SubResource& subResource )
00149 {
00150 str << subResource.location << subResource.label << subResource.writable << subResource.alarmRelevant;
00151 return str;
00152 }
00153 inline QDataStream& operator>>( QDataStream& str, KMailICalIface::SubResource& subResource )
00154 {
00155 str >> subResource.location >> subResource.label >> subResource.writable >> subResource.alarmRelevant;
00156 return str;
00157 }
00158
00159 inline QDataStream& operator<<( QDataStream& str, const KMailICalIface::StorageFormat& format )
00160 {
00161 Q_UINT32 foo = format;
00162 str << foo;
00163 return str;
00164 }
00165
00166 inline QDataStream& operator>>( QDataStream& str, KMailICalIface::StorageFormat& format )
00167 {
00168 Q_UINT32 foo;
00169 str >> foo;
00170 format = ( KMailICalIface::StorageFormat )foo;
00171 return str;
00172 }
00173
00174
00175 #endif