• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KIMAP Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kimap
fetchjob.h
1 /*
2  Copyright (c) 2009 Kevin Ottens <ervin@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef KIMAP_FETCHJOB_H
21 #define KIMAP_FETCHJOB_H
22 
23 #include "kimap_export.h"
24 
25 #include "imapset.h"
26 #include "job.h"
27 
28 #include "kmime/kmime_content.h"
29 #include "kmime/kmime_message.h"
30 
31 #include <boost/shared_ptr.hpp>
32 
33 namespace KIMAP {
34 
35 class Session;
36 struct Message;
37 class FetchJobPrivate;
38 
39 typedef boost::shared_ptr<KMime::Content> ContentPtr;
40 typedef QMap<QByteArray, ContentPtr> MessageParts;
41 
42 typedef boost::shared_ptr<KMime::Message> MessagePtr;
43 typedef QList<QByteArray> MessageFlags;
44 
56 class KIMAP_EXPORT FetchJob : public Job
57 {
58  Q_OBJECT
59  Q_DECLARE_PRIVATE( FetchJob )
60 
61  friend class SessionPrivate;
62 
63  public:
71  class KIMAP_EXPORT FetchScope
72  {
73  public:
74  FetchScope();
75 
79  enum Mode {
93  Headers,
97  Flags,
101  Structure,
108  Content,
112  Full,
130  HeaderAndContent,
131 
140  FullHeaders
141  };
142 
159  QList<QByteArray> parts;
163  Mode mode;
164 
174  quint64 changedSince;
175  };
176 
177  explicit FetchJob( Session *session );
178  virtual ~FetchJob();
179 
188  void setSequenceSet( const ImapSet &set );
192  ImapSet sequenceSet() const;
193 
201  void setUidBased(bool uidBased);
209  bool isUidBased() const;
210 
219  void setScope( const FetchScope &scope );
223  FetchScope scope() const;
224 
225  // XXX: [alexmerry, 2010-07-24]: BIC? Behaviour change
227  KIMAP_DEPRECATED QMap<qint64, MessagePtr> messages() const;
229  KIMAP_DEPRECATED QMap<qint64, MessageParts> parts() const;
231  KIMAP_DEPRECATED QMap<qint64, MessageFlags> flags() const;
233  KIMAP_DEPRECATED QMap<qint64, qint64> sizes() const;
235  KIMAP_DEPRECATED QMap<qint64, qint64> uids() const;
236 
237  Q_SIGNALS:
268  void headersReceived( const QString &mailBox,
269  const QMap<qint64, qint64> &uids,
270  const QMap<qint64, qint64> &sizes,
271  const QMap<qint64, KIMAP::MessageFlags> &flags,
272  const QMap<qint64, KIMAP::MessagePtr> &messages );
273 
292  void messagesReceived( const QString &mailBox,
293  const QMap<qint64, qint64> &uids,
294  const QMap<qint64, KIMAP::MessagePtr> &messages );
295 
313  void partsReceived( const QString &mailBox,
314  const QMap<qint64, qint64> &uids,
315  const QMap<qint64, KIMAP::MessageParts> &parts );
316 
317  protected:
318  virtual void doStart();
319  virtual void handleResponse(const Message &response);
320 
321  private:
322  Q_PRIVATE_SLOT( d_func(), void emitPendings() )
323 };
324 
325 }
326 
327 #endif
KIMAP::FetchJob::FetchScope::Mode
Mode
Used to indicate what part of the message should be fetched.
Definition: fetchjob.h:79
KIMAP::FetchJob::FetchScope::Content
Fetch the message content (the UID is also fetched)
Definition: fetchjob.h:108
KIMAP::FetchJob::FetchScope::parts
QList< QByteArray > parts
Specify which message parts to operate on.
Definition: fetchjob.h:159
KIMAP::FetchJob::FetchScope::changedSince
quint64 changedSince
Specify to fetch only items with mod-sequence higher then changedSince.
Definition: fetchjob.h:174
KIMAP::FetchJob::FetchScope::Full
Fetch the complete message.
Definition: fetchjob.h:112
KIMAP::FetchJob::FetchScope::Structure
Fetch the MIME message body structure (the UID is also fetched)
Definition: fetchjob.h:101
KIMAP::FetchJob::FetchScope::mode
Mode mode
Specify what message data should be fetched.
Definition: fetchjob.h:163
KIMAP::FetchJob::FetchScope::Headers
Fetch RFC-2822 or MIME message headers.
Definition: fetchjob.h:93
KIMAP::FetchJob
Fetch message data from the server.
Definition: fetchjob.h:56
KIMAP::FetchJob::FetchScope::HeaderAndContent
Fetch the message MIME headers and the content of parts specified in the parts field.
Definition: fetchjob.h:130
KIMAP::FetchJob::FetchScope::Flags
Fetch the message flags (the UID is also fetched)
Definition: fetchjob.h:97
KIMAP::ImapSet
Represents a set of natural numbers (1-> ) in a as compact as possible form.
Definition: imapset.h:140
KIMAP::FetchJob::FetchScope
Used to indicate what message data should be fetched.
Definition: fetchjob.h:71
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIMAP Library

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

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal