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 <tdeio/job.h>
00036 #include <tqvaluevector.h>
00037
00038 namespace KMail {
00039
00041 struct AnnotationAttribute {
00042 AnnotationAttribute() {}
00043 AnnotationAttribute( const TQString& e, const TQString& n, const TQString& v )
00044 : entry( e ), name( n ), value( v ) {}
00045 TQString entry;
00046 TQString name;
00047 TQString value;
00048 };
00049
00050 typedef TQValueVector<AnnotationAttribute> AnnotationList;
00051
00059 namespace AnnotationJobs {
00060
00068 TDEIO::SimpleJob* setAnnotation( TDEIO::Slave* slave, const KURL& url, const TQString& entry,
00069 const TQMap<TQString,TQString>& attributes );
00070
00071 class MultiSetAnnotationJob;
00075 MultiSetAnnotationJob* multiSetAnnotation( TDEIO::Slave* slave, const KURL& url, const AnnotationList& annotations );
00076
00077 class GetAnnotationJob;
00085 GetAnnotationJob* getAnnotation( TDEIO::Slave* slave, const KURL& url, const TQString& entry,
00086 const TQStringList& attributes );
00087
00088 class MultiGetAnnotationJob;
00093 MultiGetAnnotationJob* multiGetAnnotation( TDEIO::Slave* slave, const KURL& url, const TQStringList& entries );
00094
00095 class MultiUrlGetAnnotationJob;
00101 MultiUrlGetAnnotationJob* multiUrlGetAnnotation( TDEIO::Slave* slave,
00102 const KURL& baseUrl,
00103 const TQStringList& paths,
00104 const TQString& annotation );
00105
00106
00108 class GetAnnotationJob : public TDEIO::SimpleJob
00109 {
00110 Q_OBJECT
00111
00112 public:
00113 GetAnnotationJob( const KURL& url, const TQString& entry, const TQByteArray &packedArgs,
00114 bool showProgressInfo );
00115
00116 const AnnotationList& annotations() const { return mAnnotations; }
00117
00118 protected slots:
00119 void slotInfoMessage( TDEIO::Job*, const TQString& );
00120 private:
00121 AnnotationList mAnnotations;
00122 TQString mEntry;
00123 };
00124
00126 class MultiGetAnnotationJob : public TDEIO::Job
00127 {
00128 Q_OBJECT
00129
00130
00131 public:
00132 MultiGetAnnotationJob( TDEIO::Slave* slave, const KURL& url, const TQStringList& entries, bool showProgressInfo );
00133
00134 signals:
00135
00136 void annotationResult( const TQString& entry, const TQString& value, bool found );
00137
00138 protected slots:
00139 virtual void slotStart();
00140 virtual void slotResult( TDEIO::Job *job );
00141
00142 private:
00143 TDEIO::Slave* mSlave;
00144 const KURL mUrl;
00145 const TQStringList mEntryList;
00146 TQStringList::const_iterator mEntryListIterator;
00147 };
00148
00150 class MultiUrlGetAnnotationJob : public TDEIO::Job
00151 {
00152 Q_OBJECT
00153
00154
00155 public:
00156 MultiUrlGetAnnotationJob( TDEIO::Slave* slave, const KURL& baseUrl,
00157 const TQStringList& paths, const TQString& annotation );
00158
00159 TQMap<TQString, TQString> annotations() const;
00160
00161 protected slots:
00162 virtual void slotStart();
00163 virtual void slotResult( TDEIO::Job *job );
00164
00165 private:
00166 TDEIO::Slave* mSlave;
00167 const KURL mUrl;
00168 const TQStringList mPathList;
00169 TQStringList::const_iterator mPathListIterator;
00170 TQString mAnnotation;
00171 TQMap<TQString, TQString> mAnnotations;
00172 };
00173
00175 class MultiSetAnnotationJob : public TDEIO::Job
00176 {
00177 Q_OBJECT
00178
00179
00180 public:
00181 MultiSetAnnotationJob( TDEIO::Slave* slave, const KURL& url, const AnnotationList& annotations, bool showProgressInfo );
00182
00183 signals:
00184
00185 void annotationChanged( const TQString& entry, const TQString& attribute, const TQString& value );
00186
00187 protected slots:
00188 virtual void slotStart();
00189 virtual void slotResult( TDEIO::Job *job );
00190
00191 private:
00192 TDEIO::Slave* mSlave;
00193 const KURL mUrl;
00194 const AnnotationList mAnnotationList;
00195 AnnotationList::const_iterator mAnnotationListIterator;
00196 };
00197
00198 }
00199
00200 }
00201
00202 #endif
00203