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
00069
00070 enum Answer { No, Yes, Error };
00071
00073 enum FolderChanges { NoChange = 0, Contents = 1, ACL = 2 };
00074
00075 virtual bool isWritableFolder( const QString& type,
00076 const QString& resource ) = 0;
00077
00078 virtual KMailICalIface::StorageFormat storageFormat( const QString& resource ) = 0;
00079
00080 virtual KURL getAttachment( const QString& resource,
00081 Q_UINT32 sernum,
00082 const QString& filename ) = 0;
00083 virtual QString attachmentMimetype( const QString &resource,
00084 Q_UINT32 sernum,
00085 const QString &filename ) = 0;
00086
00087 virtual QStringList listAttachments( const QString &resource, Q_UINT32 sernum ) = 0;
00088
00091 virtual Q_UINT32 update( const QString& resource,
00092 Q_UINT32 sernum,
00093 const QString& subject,
00094 const QString& plainTextBody,
00095 const QMap<QCString, QString>& customHeaders,
00096 const QStringList& attachmentURLs,
00097 const QStringList& attachmentMimetypes,
00098 const QStringList& attachmentNames,
00099 const QStringList& deletedAttachments ) = 0;
00100
00101 virtual Answer messageReadyForUpdate( const QString &resource, Q_UINT32 sernum ) = 0;
00102
00103 virtual bool deleteIncidenceKolab( const QString& resource,
00104 Q_UINT32 sernum ) = 0;
00105
00108 virtual int incidencesKolabCount( const QString& mimetype ,
00109 const QString& resource ) = 0;
00110
00111 virtual QMap<Q_UINT32, QString> incidencesKolab( const QString& mimetype,
00112 const QString& resource,
00113 int startIndex,
00114 int nbMessages ) = 0;
00119 virtual QValueList<KMailICalIface::SubResource> subresourcesKolab( const QString& contentsType ) = 0;
00120
00126 virtual bool addSubresource( const QString& resource,
00127 const QString& parent,
00128 const QString& contentsType ) = 0;
00133 virtual bool removeSubresource( const QString& resource ) = 0;
00134
00138 virtual int dimapAccounts() = 0;
00139
00143 virtual QString dimapFolderAccountName( const QString &folderPath ) = 0;
00144
00148 virtual bool triggerSync( const QString & ) = 0;
00149 virtual void changeResourceUIName( const QString &folderPath, const QString &newName ) = 0;
00150
00151
00152 k_dcop_signals:
00153 void incidenceAdded( const QString& type, const QString& folder,
00154 Q_UINT32 sernum, int format, const QString& entry );
00155 void asyncLoadResult( const QMap<Q_UINT32, QString>, const QString& type,
00156 const QString& folder );
00157 void incidenceDeleted( const QString& type, const QString& folder,
00158 const QString& uid, Q_INT32 sernum );
00159 void signalRefresh( const QString& type, const QString& folder );
00160 void subresourceAdded( const QString& type, const QString& resource,
00161 const QString& label, bool writable, bool alarmRelevant );
00162 void subresourceDeleted( const QString& type, const QString& resource );
00163 };
00164
00165 inline QDataStream& operator<<( QDataStream& str, const KMailICalIface::SubResource& subResource )
00166 {
00167 str << subResource.location << subResource.label << subResource.writable << subResource.alarmRelevant;
00168 return str;
00169 }
00170 inline QDataStream& operator>>( QDataStream& str, KMailICalIface::SubResource& subResource )
00171 {
00172 str >> subResource.location >> subResource.label >> subResource.writable >> subResource.alarmRelevant;
00173 return str;
00174 }
00175
00176 inline QDataStream& operator<<( QDataStream& str, const KMailICalIface::StorageFormat& format )
00177 {
00178 Q_UINT32 foo = format;
00179 str << foo;
00180 return str;
00181 }
00182
00183 inline QDataStream& operator>>( QDataStream& str, KMailICalIface::StorageFormat& format )
00184 {
00185 Q_UINT32 foo;
00186 str >> foo;
00187 format = ( KMailICalIface::StorageFormat )foo;
00188 return str;
00189 }
00190
00191 inline QDataStream& operator<<( QDataStream& str, const KMailICalIface::Answer& format )
00192 {
00193 Q_UINT32 foo = format;
00194 str << foo;
00195 return str;
00196 }
00197
00198 inline QDataStream& operator>>( QDataStream& str, KMailICalIface::Answer& format )
00199 {
00200 Q_UINT32 foo;
00201 str >> foo;
00202 format = ( KMailICalIface::Answer )foo;
00203 return str;
00204 }
00205
00206
00207 #endif