kmail
annotationjobs.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
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 <QVector>
00037
00038 namespace KIO { class Slave; }
00039
00040 namespace KMail {
00041
00043 struct AnnotationAttribute {
00044 AnnotationAttribute() {}
00045 AnnotationAttribute( const QString& e, const QString& n, const QString& v )
00046 : entry( e ), name( n ), value( v ) {}
00047 QString entry;
00048 QString name;
00049 QString value;
00050 };
00051
00052 typedef QVector<AnnotationAttribute> AnnotationList;
00053
00061 namespace AnnotationJobs {
00062
00070 KIO::SimpleJob* setAnnotation( KIO::Slave* slave, const KUrl& url, const QString& entry,
00071 const QMap<QString,QString>& attributes );
00072
00073 class MultiSetAnnotationJob;
00077 MultiSetAnnotationJob* multiSetAnnotation( KIO::Slave* slave, const KUrl& url, const AnnotationList& annotations );
00078
00079 class GetAnnotationJob;
00087 GetAnnotationJob* getAnnotation( KIO::Slave* slave, const KUrl& url, const QString& entry,
00088 const QStringList& attributes );
00089
00090 class MultiGetAnnotationJob;
00095 MultiGetAnnotationJob* multiGetAnnotation( KIO::Slave* slave, const KUrl& url, const QStringList& entries );
00096
00097 class MultiUrlGetAnnotationJob;
00103 MultiUrlGetAnnotationJob* multiUrlGetAnnotation( KIO::Slave* slave,
00104 const KUrl& baseUrl,
00105 const QStringList& paths,
00106 const QString& annotation );
00107
00108
00110 class GetAnnotationJob : public KIO::SpecialJob
00111 {
00112 Q_OBJECT
00113 public:
00114 GetAnnotationJob( const KUrl& url, const QString& entry, const QByteArray &packedArgs);
00115
00116 const AnnotationList& annotations() const { return mAnnotations; }
00117
00118 protected slots:
00119 void slotInfoMessage( KJob*, const QString&,const QString& );
00120 private:
00121 AnnotationList mAnnotations;
00122 QString mEntry;
00123 };
00124
00126 class MultiGetAnnotationJob : public KIO::Job
00127 {
00128 Q_OBJECT
00129
00130 public:
00131 MultiGetAnnotationJob( KIO::Slave* slave, const KUrl& url, const QStringList& entries);
00132
00133 signals:
00134
00135 void annotationResult( const QString& entry, const QString& value, bool found );
00136
00137 protected slots:
00138 virtual void slotStart();
00139 virtual void slotResult( KJob *job );
00140
00141 private:
00142 KIO::Slave* mSlave;
00143 const KUrl mUrl;
00144 const QStringList mEntryList;
00145 QStringList::const_iterator mEntryListIterator;
00146 };
00147
00149 class MultiUrlGetAnnotationJob : public KIO::Job
00150 {
00151 Q_OBJECT
00152
00153 public:
00154 MultiUrlGetAnnotationJob( KIO::Slave* slave, const KUrl& baseUrl,
00155 const QStringList& paths, const QString& annotation );
00156
00157 QMap<QString, QString> annotations() const;
00158
00159 protected slots:
00160 virtual void slotStart();
00161 virtual void slotResult( KJob *job );
00162
00163 private:
00164 KIO::Slave* mSlave;
00165 const KUrl mUrl;
00166 const QStringList mPathList;
00167 QStringList::const_iterator mPathListIterator;
00168 QString mAnnotation;
00169 QMap<QString, QString> mAnnotations;
00170 };
00171
00173 class MultiSetAnnotationJob : public KIO::Job
00174 {
00175 Q_OBJECT
00176
00177 public:
00178 MultiSetAnnotationJob( KIO::Slave* slave, const KUrl& url, const AnnotationList& annotations);
00179
00180 signals:
00181
00182 void annotationChanged( const QString& entry, const QString& attribute, const QString& value );
00183
00184 protected slots:
00185 virtual void slotStart();
00186 virtual void slotResult( KJob *job );
00187
00188 private:
00189 KIO::Slave* mSlave;
00190 const KUrl mUrl;
00191 const AnnotationList mAnnotationList;
00192 AnnotationList::const_iterator mAnnotationListIterator;
00193 };
00194
00195 }
00196
00197 }
00198
00199 #endif
00200