• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kmail

annotationjobs.h

Go to the documentation of this file.
00001 /*
00002  * annotationjobs.h
00003  *
00004  * Copyright (c) 2004 David Faure <faure@kde.org>
00005  *
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; version 2 of the License
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  *  In addition, as a special exception, the copyright holders give
00021  *  permission to link the code of this program with any edition of
00022  *  the Qt library by Trolltech AS, Norway (or with modified versions
00023  *  of Qt that use the same license as Qt), and distribute linked
00024  *  combinations including the two.  You must obey the GNU General
00025  *  Public License in all respects for all of the code used other than
00026  *  Qt.  If you modify this file, you may extend this exception to
00027  *  your version of the file, but you are not obligated to do so.  If
00028  *  you do not wish to do so, delete this exception statement from
00029  *  your version.
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() {} // for QValueVector
00045   AnnotationAttribute( const QString& e, const QString& n, const QString& v )
00046     : entry( e ), name( n ), value( v ) {}
00047   QString entry; // e.g. /comment
00048   QString name;  // e.g. value.shared
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   // Emitted when a given annotation was found - or not found
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   // Emitted when a given annotation was successfully changed
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 } // AnnotationJobs namespace
00196 
00197 } // KMail namespace
00198 
00199 #endif /* ANNOTATIONJOBS_H */
00200 

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal