• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KIMAP Library

fetchjob.h

00001 /*
00002     Copyright (c) 2009 Kevin Ottens <ervin@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef KIMAP_FETCHJOB_H
00021 #define KIMAP_FETCHJOB_H
00022 
00023 #include "kimap_export.h"
00024 
00025 #include "imapset.h"
00026 #include "job.h"
00027 
00028 #include "kmime/kmime_content.h"
00029 #include "kmime/kmime_message.h"
00030 
00031 #include <boost/shared_ptr.hpp>
00032 
00033 namespace KIMAP {
00034 
00035 class Session;
00036 struct Message;
00037 class FetchJobPrivate;
00038 
00039 typedef boost::shared_ptr<KMime::Content> ContentPtr;
00040 typedef QMap<QByteArray, ContentPtr> MessageParts;
00041 
00042 typedef boost::shared_ptr<KMime::Message> MessagePtr;
00043 typedef QList<QByteArray> MessageFlags;
00044 
00056 class KIMAP_EXPORT FetchJob : public Job
00057 {
00058   Q_OBJECT
00059   Q_DECLARE_PRIVATE(FetchJob)
00060 
00061   friend class SessionPrivate;
00062 
00063   public:
00071     struct FetchScope
00072     {
00089       QList<QByteArray> parts;
00093       enum Mode {
00107         Headers,
00111         Flags,
00115         Structure,
00122         Content,
00126         Full
00127       } mode;
00128     };
00129 
00130     explicit FetchJob( Session *session );
00131     virtual ~FetchJob();
00132 
00141     void setSequenceSet( const ImapSet &set );
00145     ImapSet sequenceSet() const;
00146 
00154     void setUidBased(bool uidBased);
00162     bool isUidBased() const;
00163 
00172     void setScope( const FetchScope &scope );
00176     FetchScope scope() const;
00177 
00185     QMap<qint64, MessagePtr> messages() const;
00193     QMap<qint64, MessageParts> parts() const;
00201     QMap<qint64, MessageFlags> flags() const;
00211     QMap<qint64, qint64> sizes() const;
00220     QMap<qint64, qint64> uids() const;
00221 
00222   Q_SIGNALS:
00253     void headersReceived( const QString &mailBox,
00254                           const QMap<qint64, qint64> &uids,
00255                           const QMap<qint64, qint64> &sizes,
00256                           const QMap<qint64, KIMAP::MessageFlags> &flags,
00257                           const QMap<qint64, KIMAP::MessagePtr> &messages );
00258 
00277     void messagesReceived( const QString &mailBox,
00278                            const QMap<qint64, qint64> &uids,
00279                            const QMap<qint64, KIMAP::MessagePtr> &messages );
00280 
00298     void partsReceived( const QString &mailBox,
00299                         const QMap<qint64, qint64> &uids,
00300                         const QMap<qint64, KIMAP::MessageParts> &parts );
00301 
00302   protected:
00303     virtual void doStart();
00304     virtual void handleResponse(const Message &response);
00305 
00306   private:
00307     Q_PRIVATE_SLOT( d_func(), void emitPendings() )
00308 };
00309 
00310 }
00311 
00312 #endif

KIMAP Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.1
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