• 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.14
  • 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 
45 typedef QPair<QByteArray, QVariant> MessageAttribute;
46 
58 class KIMAP_EXPORT FetchJob : public Job
59 {
60  Q_OBJECT
61  Q_DECLARE_PRIVATE( FetchJob )
62 
63  friend class SessionPrivate;
64 
65  public:
73  class KIMAP_EXPORT FetchScope
74  {
75  public:
76  FetchScope();
77 
81  enum Mode {
95  Headers,
99  Flags,
103  Structure,
110  Content,
114  Full,
132  HeaderAndContent,
133 
142  FullHeaders
143  };
144 
161  QList<QByteArray> parts;
165  Mode mode;
166 
176  quint64 changedSince;
177  };
178 
179  explicit FetchJob( Session *session );
180  virtual ~FetchJob();
181 
190  void setSequenceSet( const ImapSet &set );
194  ImapSet sequenceSet() const;
195 
203  void setUidBased(bool uidBased);
211  bool isUidBased() const;
212 
221  void setScope( const FetchScope &scope );
225  FetchScope scope() const;
226 
227  // TODO: KF5: Move this to FetchScope
239  void setGmailExtensionsEnabled(bool enabled);
240 
247  bool setGmailExtensionsEnabled() const;
248 
249  // XXX: [alexmerry, 2010-07-24]: BIC? Behaviour change
251  KIMAP_DEPRECATED QMap<qint64, MessagePtr> messages() const;
253  KIMAP_DEPRECATED QMap<qint64, MessageParts> parts() const;
255  KIMAP_DEPRECATED QMap<qint64, MessageFlags> flags() const;
257  KIMAP_DEPRECATED QMap<qint64, qint64> sizes() const;
259  KIMAP_DEPRECATED QMap<qint64, qint64> uids() const;
260 
261  Q_SIGNALS:
292  void headersReceived( const QString &mailBox,
293  const QMap<qint64, qint64> &uids,
294  const QMap<qint64, qint64> &sizes,
295  const QMap<qint64, KIMAP::MessageFlags> &flags,
296  const QMap<qint64, KIMAP::MessagePtr> &messages );
297 
323  void headersReceived( const QString &mailBox,
324  const QMap<qint64, qint64> &uids,
325  const QMap<qint64, qint64> &sizes,
326  const QMap<qint64, KIMAP::MessageAttribute > &attrs,
327  const QMap<qint64, KIMAP::MessageFlags> &flags,
328  const QMap<qint64, KIMAP::MessagePtr> &messages );
329 
348  void messagesReceived( const QString &mailBox,
349  const QMap<qint64, qint64> &uids,
350  const QMap<qint64, KIMAP::MessagePtr> &messages );
351 
352 
368  void messagesReceived( const QString &mailBox,
369  const QMap<qint64, qint64> &uids,
370  const QMap<qint64, KIMAP::MessageAttribute > &attrs,
371  const QMap<qint64, KIMAP::MessagePtr> &messages );
389  void partsReceived( const QString &mailBox,
390  const QMap<qint64, qint64> &uids,
391  const QMap<qint64, KIMAP::MessageParts> &parts );
392 
407  void partsReceived( const QString &mailBox,
408  const QMap<qint64, qint64> &uids,
409  const QMap<qint64, KIMAP::MessageAttribute > &attrs,
410  const QMap<qint64, KIMAP::MessageParts> &parts );
411 
412  protected:
413  virtual void doStart();
414  virtual void handleResponse(const Message &response);
415 
416  private:
417  Q_PRIVATE_SLOT( d_func(), void emitPendings() )
418 };
419 
420 }
421 
422 #endif
KIMAP::FetchJob::FetchScope::Mode
Mode
Used to indicate what part of the message should be fetched.
Definition: fetchjob.h:81
KIMAP::FetchJob::FetchScope::Content
Fetch the message content (the UID is also fetched)
Definition: fetchjob.h:110
KIMAP::FetchJob::FetchScope::parts
QList< QByteArray > parts
Specify which message parts to operate on.
Definition: fetchjob.h:161
QMap
KIMAP::FetchJob::FetchScope::changedSince
quint64 changedSince
Specify to fetch only items with mod-sequence higher then changedSince.
Definition: fetchjob.h:176
KIMAP::FetchJob::FetchScope::Full
Fetch the complete message.
Definition: fetchjob.h:114
KIMAP::FetchJob::FetchScope::Structure
Fetch the MIME message body structure (the UID is also fetched)
Definition: fetchjob.h:103
KIMAP::FetchJob::FetchScope::mode
Mode mode
Specify what message data should be fetched.
Definition: fetchjob.h:165
KIMAP::FetchJob::FetchScope::Headers
Fetch RFC-2822 or MIME message headers.
Definition: fetchjob.h:95
KIMAP::FetchJob
Fetch message data from the server.
Definition: fetchjob.h:58
KIMAP::FetchJob::FetchScope::HeaderAndContent
Fetch the message MIME headers and the content of parts specified in the parts field.
Definition: fetchjob.h:132
KIMAP::FetchJob::FetchScope::Flags
Fetch the message flags (the UID is also fetched)
Definition: fetchjob.h:99
QString
QList< QByteArray >
QPair
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:73
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:03 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
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

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