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

KIMAP Library

  • 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  struct FetchScope
72  {
76  enum Mode {
90  Headers,
94  Flags,
98  Structure,
105  Content,
109  Full,
127  HeaderAndContent
128  };
129 
146  QList<QByteArray> parts;
150  Mode mode;
151  };
152 
153  explicit FetchJob( Session *session );
154  virtual ~FetchJob();
155 
164  void setSequenceSet( const ImapSet &set );
168  ImapSet sequenceSet() const;
169 
177  void setUidBased(bool uidBased);
185  bool isUidBased() const;
186 
195  void setScope( const FetchScope &scope );
199  FetchScope scope() const;
200 
201  // XXX: [alexmerry, 2010-07-24]: BIC? Behaviour change
203  KDE_DEPRECATED QMap<qint64, MessagePtr> messages() const;
205  KDE_DEPRECATED QMap<qint64, MessageParts> parts() const;
207  KDE_DEPRECATED QMap<qint64, MessageFlags> flags() const;
209  KDE_DEPRECATED QMap<qint64, qint64> sizes() const;
211  KDE_DEPRECATED QMap<qint64, qint64> uids() const;
212 
213  Q_SIGNALS:
244  void headersReceived( const QString &mailBox,
245  const QMap<qint64, qint64> &uids,
246  const QMap<qint64, qint64> &sizes,
247  const QMap<qint64, KIMAP::MessageFlags> &flags,
248  const QMap<qint64, KIMAP::MessagePtr> &messages );
249 
268  void messagesReceived( const QString &mailBox,
269  const QMap<qint64, qint64> &uids,
270  const QMap<qint64, KIMAP::MessagePtr> &messages );
271 
289  void partsReceived( const QString &mailBox,
290  const QMap<qint64, qint64> &uids,
291  const QMap<qint64, KIMAP::MessageParts> &parts );
292 
293  protected:
294  virtual void doStart();
295  virtual void handleResponse(const Message &response);
296 
297  private:
298  Q_PRIVATE_SLOT( d_func(), void emitPendings() )
299 };
300 
301 }
302 
303 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:25:16 by doxygen 1.8.3.1 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-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 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
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