kmail Library API Documentation

annotationjobs.h

00001 
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() {} // for QValueVector
00043   AnnotationAttribute( const QString& e, const QString& n, const QString& v )
00044     : entry( e ), name( n ), value( v ) {}
00045   QString entry; // e.g. /comment
00046   QString name;  // e.g. value.shared
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 
00095 class MultiUrlGetAnnotationJob;
00101 MultiUrlGetAnnotationJob* multiUrlGetAnnotation( KIO::Slave* slave,
00102                                               const KURL& baseUrl,
00103                                               const QStringList& paths,
00104                                               const QString& annotation );
00105 
00106 
00108 class GetAnnotationJob : public KIO::SimpleJob
00109 {
00110   Q_OBJECT
00111 public:
00112   GetAnnotationJob( const KURL& url, const QString& entry, const QByteArray &packedArgs,
00113                     bool showProgressInfo );
00114 
00115   const AnnotationList& annotations() const { return mAnnotations; }
00116 
00117 protected slots:
00118   void slotInfoMessage( KIO::Job*, const QString& );
00119 private:
00120   AnnotationList mAnnotations;
00121   QString mEntry;
00122 };
00123 
00125 class MultiGetAnnotationJob : public KIO::Job
00126 {
00127   Q_OBJECT
00128 
00129 public:
00130   MultiGetAnnotationJob( KIO::Slave* slave, const KURL& url, const QStringList& entries, bool showProgressInfo );
00131 
00132 signals:
00133   // Emitted when a given annotation was found - or not found
00134   void annotationResult( const QString& entry, const QString& value, bool found );
00135 
00136 protected slots:
00137   virtual void slotStart();
00138   virtual void slotResult( KIO::Job *job );
00139 
00140 private:
00141   KIO::Slave* mSlave;
00142   const KURL mUrl;
00143   const QStringList mEntryList;
00144   QStringList::const_iterator mEntryListIterator;
00145 };
00146 
00148 class MultiUrlGetAnnotationJob : public KIO::Job
00149 {
00150   Q_OBJECT
00151 
00152 public:
00153   MultiUrlGetAnnotationJob( KIO::Slave* slave, const KURL& baseUrl,
00154                             const QStringList& paths, const QString& annotation );
00155 
00156   QMap<QString, QString> annotations() const;
00157 
00158 protected slots:
00159   virtual void slotStart();
00160   virtual void slotResult( KIO::Job *job );
00161 
00162 private:
00163   KIO::Slave* mSlave;
00164   const KURL mUrl;
00165   const QStringList mPathList;
00166   QStringList::const_iterator mPathListIterator;
00167   QString mAnnotation;
00168   QMap<QString, QString> mAnnotations;
00169 };
00170 
00172 class MultiSetAnnotationJob : public KIO::Job
00173 {
00174   Q_OBJECT
00175 
00176 public:
00177   MultiSetAnnotationJob( KIO::Slave* slave, const KURL& url, const AnnotationList& annotations, bool showProgressInfo );
00178 
00179 signals:
00180   // Emitted when a given annotation was successfully changed
00181   void annotationChanged( const QString& entry, const QString& attribute, const QString& value );
00182 
00183 protected slots:
00184   virtual void slotStart();
00185   virtual void slotResult( KIO::Job *job );
00186 
00187 private:
00188   KIO::Slave* mSlave;
00189   const KURL mUrl;
00190   const AnnotationList mAnnotationList;
00191   AnnotationList::const_iterator mAnnotationListIterator;
00192 };
00193 
00194 } // AnnotationJobs namespace
00195 
00196 } // KMail namespace
00197 
00198 #endif /* ANNOTATIONJOBS_H */
00199 
KDE Logo
This file is part of the documentation for kmail Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jan 31 15:54:40 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003