• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 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
33namespace KIMAP {
34
35class Session;
36struct Message;
37class FetchJobPrivate;
38
39typedef boost::shared_ptr<KMime::Content> ContentPtr;
40typedef QMap<QByteArray, ContentPtr> MessageParts;
41
42typedef boost::shared_ptr<KMime::Message> MessagePtr;
43typedef QList<QByteArray> MessageFlags;
44
45typedef QPair<QByteArray, QVariant> MessageAttribute;
46
58class 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
Used to indicate what message data should be fetched.
Definition fetchjob.h:74
KIMAP::FetchJob::FetchScope::changedSince
quint64 changedSince
Specify to fetch only items with mod-sequence higher then changedSince.
Definition fetchjob.h:176
KIMAP::FetchJob::FetchScope::mode
Mode mode
Specify what message data should be fetched.
Definition fetchjob.h:165
KIMAP::FetchJob::FetchScope::Mode
Mode
Used to indicate what part of the message should be fetched.
Definition fetchjob.h:81
KIMAP::FetchJob::FetchScope::Full
@ Full
Fetch the complete message.
Definition fetchjob.h:114
KIMAP::FetchJob::FetchScope::Headers
@ Headers
Fetch RFC-2822 or MIME message headers.
Definition fetchjob.h:95
KIMAP::FetchJob::FetchScope::Structure
@ Structure
Fetch the MIME message body structure (the UID is also fetched)
Definition fetchjob.h:103
KIMAP::FetchJob::FetchScope::Content
@ Content
Fetch the message content (the UID is also fetched)
Definition fetchjob.h:110
KIMAP::FetchJob::FetchScope::HeaderAndContent
@ HeaderAndContent
Fetch the message MIME headers and the content of parts specified in the parts field.
Definition fetchjob.h:132
KIMAP::FetchJob::FetchScope::Flags
@ Flags
Fetch the message flags (the UID is also fetched)
Definition fetchjob.h:99
KIMAP::FetchJob::FetchScope::parts
QList< QByteArray > parts
Specify which message parts to operate on.
Definition fetchjob.h:161
KIMAP::FetchJob
Fetch message data from the server.
Definition fetchjob.h:59
KIMAP::FetchJob::partsReceived
void partsReceived(const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessageParts > &parts)
Provides header and message results.
KIMAP::FetchJob::headersReceived
void headersReceived(const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, qint64 > &sizes, const QMap< qint64, KIMAP::MessageFlags > &flags, const QMap< qint64, KIMAP::MessagePtr > &messages)
Provides header and message results.
KIMAP::FetchJob::messagesReceived
void messagesReceived(const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessageAttribute > &attrs, const QMap< qint64, KIMAP::MessagePtr > &messages)
An overloaded version of messagesReceived(), which includes additional attribute specified in the FET...
KIMAP::FetchJob::partsReceived
void partsReceived(const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessageAttribute > &attrs, const QMap< qint64, KIMAP::MessageParts > &parts)
An overloaded version of partsReceived(), which includes additional attribute specified in the FETCH ...
KIMAP::FetchJob::messagesReceived
void messagesReceived(const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessagePtr > &messages)
Provides header and message results.
KIMAP::FetchJob::headersReceived
void headersReceived(const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, qint64 > &sizes, const QMap< qint64, KIMAP::MessageAttribute > &attrs, const QMap< qint64, KIMAP::MessageFlags > &flags, const QMap< qint64, KIMAP::MessagePtr > &messages)
An overloaded version of headersReceived(), which includes additional attribute specified in the FETC...
KIMAP::ImapSet
Represents a set of natural numbers (1-> ) in a as compact as possible form.
Definition imapset.h:141
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 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.14.10 API Reference

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