kmail
annotationjobs.h00001
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 ANNOTATIONJOBS_H
00033 #define ANNOTATIONJOBS_H
00034
00035 #include <kio/job.h>
00036 #include <qvaluevector.h>
00037
00038 namespace KMail {
00039
00041 struct AnnotationAttribute {
00042 AnnotationAttribute() {}
00043 AnnotationAttribute( const QString& e, const QString& n, const QString& v )
00044 : entry( e ), name( n ), value( v ) {}
00045 QString entry;
00046 QString name;
00047 QString value;
00048 };
00049
00050 typedef QValueVector<AnnotationAttribute> AnnotationList;
00051
00059 namespace AnnotationJobs {
00060
00068 KIO::SimpleJob* setAnnotation( KIO::Slave* slave, const KURL& url, const QString& entry,
00069 const QMap<QString,QString>& attributes );
00070
00071 class MultiSetAnnotationJob;
00075 MultiSetAnnotationJob* multiSetAnnotation( KIO::Slave* slave, const KURL& url, const AnnotationList& annotations );
00076
00077 class GetAnnotationJob;
00085 GetAnnotationJob* getAnnotation( KIO::Slave* slave, const KURL& url, const QString& entry,
00086 const QStringList& attributes );
00087
00088 class MultiGetAnnotationJob;
00093 MultiGetAnnotationJob* multiGetAnnotation( KIO::Slave* slave, const KURL& url, const QStringList& entries );
00094
00096 class GetAnnotationJob : public KIO::SimpleJob
00097 {
00098 Q_OBJECT
00099 public:
00100 GetAnnotationJob( const KURL& url, const QString& entry, const QByteArray &packedArgs,
00101 bool showProgressInfo );
00102
00103 const AnnotationList& annotations() const { return mAnnotations; }
00104
00105 protected slots:
00106 void slotInfoMessage( KIO::Job*, const QString& );
00107 private:
00108 AnnotationList mAnnotations;
00109 QString mEntry;
00110 };
00111
00113 class MultiGetAnnotationJob : public KIO::Job
00114 {
00115 Q_OBJECT
00116
00117 public:
00118 MultiGetAnnotationJob( KIO::Slave* slave, const KURL& url, const QStringList& entries, bool showProgressInfo );
00119
00120 signals:
00121
00122 void annotationResult( const QString& entry, const QString& value, bool found );
00123
00124 protected slots:
00125 virtual void slotStart();
00126 virtual void slotResult( KIO::Job *job );
00127
00128 private:
00129 KIO::Slave* mSlave;
00130 const KURL mUrl;
00131 const QStringList mEntryList;
00132 QStringList::const_iterator mEntryListIterator;
00133 };
00134
00136 class MultiSetAnnotationJob : public KIO::Job
00137 {
00138 Q_OBJECT
00139
00140 public:
00141 MultiSetAnnotationJob( KIO::Slave* slave, const KURL& url, const AnnotationList& annotations, bool showProgressInfo );
00142
00143 signals:
00144
00145 void annotationChanged( const QString& entry, const QString& attribute, const QString& value );
00146
00147 protected slots:
00148 virtual void slotStart();
00149 virtual void slotResult( KIO::Job *job );
00150
00151 private:
00152 KIO::Slave* mSlave;
00153 const KURL mUrl;
00154 const AnnotationList mAnnotationList;
00155 AnnotationList::const_iterator mAnnotationListIterator;
00156 };
00157
00158 }
00159
00160 }
00161
00162 #endif
00163
|