KIMAP Library
#include <fetchjob.h>
Inherits KIMAP::Job.
Classes | |
class | FetchScope |
Signals | |
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) |
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) |
void | messagesReceived (const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessagePtr > &messages) |
void | messagesReceived (const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessageAttribute > &attrs, const QMap< qint64, KIMAP::MessagePtr > &messages) |
void | partsReceived (const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessageParts > &parts) |
void | partsReceived (const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessageAttribute > &attrs, const QMap< qint64, KIMAP::MessageParts > &parts) |
Public Member Functions | |
FetchJob (Session *session) | |
KIMAP_DEPRECATED QMap< qint64, MessageFlags > | flags () const |
bool | isUidBased () const |
KIMAP_DEPRECATED QMap< qint64, MessagePtr > | messages () const |
KIMAP_DEPRECATED QMap< qint64, MessageParts > | parts () const |
FetchScope | scope () const |
ImapSet | sequenceSet () const |
void | setGmailExtensionsEnabled (bool enabled) |
bool | setGmailExtensionsEnabled () const |
void | setScope (const FetchScope &scope) |
void | setSequenceSet (const ImapSet &set) |
void | setUidBased (bool uidBased) |
KIMAP_DEPRECATED QMap< qint64, qint64 > | sizes () const |
KIMAP_DEPRECATED QMap< qint64, qint64 > | uids () const |
Protected Member Functions | |
virtual void | doStart () |
virtual void | handleResponse (const Message &response) |
Detailed Description
Fetch message data from the server.
All data is returned using the signals, so you need to connect to the relevant signal (or all of them) before starting the job.
This job will always use BODY.PEEK rather than BODY to fetch message content, so it will not set the flag.
This job can only be run when the session is in the selected state.
Definition at line 58 of file fetchjob.h.
Member Function Documentation
QMap< qint64, MessageFlags > FetchJob::flags | ( | ) | const |
- Deprecated:
- returns an empty map; use the signals instead
Definition at line 187 of file fetchjob.cpp.
|
signal |
Provides header and message results.
This signal will be emitted if the requested scope mode was FetchScope::Full, FetchScope::Flags or FetchScope::Headers with no parts specified
This signal may be emitted any number of times before the result() signal is emitted. The result() signal will only be emitted once all results have been reported via one of the signals.
Note that, depending on the scope, some of the parameters of this signal may be empty maps.
- Parameters
-
mailBox the name of the mailbox the fetch job was executed on uids a map from message sequence numbers to message UIDs; this will always be populated sizes a map from message sequence numbers to message sizes (sizes are in octets and refer to the transfer encoding of the message); populated if the scope is FetchScope::Full or FetchScope::Headers flags a map from message sequence numbers to message flags; populated if the scope is FetchScope::Flags, FetchScope::Full of FetchScope::Headers messages a map from message sequence numbers to message contents (including headers); populated if the scope is FetchScope::Full, FetchScope::Headers or FetchScope::Structure
|
signal |
An overloaded version of headersReceived(), which includes additional attribute specified in the FETCH response, but that don't belong to actual content of the message.
- Parameters
-
mailBox the name of the mailbox the fetch job was executed on uids a map from message sequence numbers to message UIDs; this will always be populated attrs a map from message sequence numbers to a pair of attribute name and value sizes a map from message sequence numbers to message sizes (sizes are in octets and refer to the transfer encoding of the message); populated if the scope is FetchScope::Full or FetchScope::Headers flags a map from message sequence numbers to message flags; populated if the scope is FetchScope::Flags, FetchScope::Full of FetchScope::Headers messages a map from message sequence numbers to message contents (including headers); populated if the scope is FetchScope::Full, FetchScope::Headers or FetchScope::Structure
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Since
- 4.14
bool FetchJob::isUidBased | ( | ) | const |
How to interpret the sequence set.
- Returns
- if
true
the result of sequenceSet() should be interpreted as UIDs, iffalse
it should be interpreted as sequence numbers
Definition at line 147 of file fetchjob.cpp.
QMap< qint64, MessagePtr > FetchJob::messages | ( | ) | const |
- Deprecated:
- returns an empty map; use the signals instead
Definition at line 177 of file fetchjob.cpp.
|
signal |
Provides header and message results.
This signal will be emitted if the requested scope mode was FetchScope::Content or FetchScope::Headers with no parts specified or FetchScope::Structure.
This signal may be emitted any number of times before the result() signal is emitted. The result() signal will only be emitted once all results have been reported via one of the signals.
- Parameters
-
mailBox the name of the mailbox the fetch job was executed on uids a map from message sequence numbers to message UIDs messages a map from message sequence numbers to message contents
|
signal |
An overloaded version of messagesReceived(), which includes additional attribute specified in the FETCH response, but that don't belong to actual content of the message.
- Parameters
-
mailBox the name of the mailbox the fetch job was executed on uids a map from message sequence numbers to message UIDs attrs a map from message sequence numbers to pair of attribute name and it's value messages a map from message sequence numbers to message contents
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Since
- 4.14
QMap< qint64, MessageParts > FetchJob::parts | ( | ) | const |
- Deprecated:
- returns an empty map; use the signals instead
Definition at line 182 of file fetchjob.cpp.
|
signal |
Provides header and message results.
This signal will be emitted if the requested scope mode was FetchScope::Content or FetchScope::Headers with specified parts.
This signal may be emitted any number of times before the result() signal is emitted. The result() signal will only be emitted once all results have been reported via one of the signals.
- Parameters
-
mailBox the name of the mailbox the fetch job was executed on uids a map from message sequence numbers to message UIDs parts a map from message sequence numbers to message part collections
|
signal |
An overloaded version of partsReceived(), which includes additional attribute specified in the FETCH response, but that don't belong to actual content of the message.
- Parameters
-
mailBox the name of the mailbox the fetch job was executed on uids a map from message sequence numbers to message UIDs attrs a map from message sequence numbers to pair of attribute parts a map from message sequence numbers to message part collections
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Since
- 4.14
FetchJob::FetchScope FetchJob::scope | ( | ) | const |
Specifies what data will be fetched.
Definition at line 159 of file fetchjob.cpp.
ImapSet FetchJob::sequenceSet | ( | ) | const |
The messages that will be fetched.
Definition at line 135 of file fetchjob.cpp.
void FetchJob::setGmailExtensionsEnabled | ( | bool | enabled | ) |
Enables retrieving of Gmail-specific extensions.
The FETCH response will contain X-GM-MSGID, X-GM-THRID and X-GM-LABELS
Do NOT enable this, unless talking to Gmail servers, otherwise the request may fail.
- Parameters
-
enabled Whether the Gmail support should be enabled
- Since
- 4.14
Definition at line 171 of file fetchjob.cpp.
bool FetchJob::setGmailExtensionsEnabled | ( | ) | const |
Returns whether Gmail support is enabled.
- Since
- 4.14
- See also
- setGmailExtensionsEnabled()
Definition at line 165 of file fetchjob.cpp.
void FetchJob::setScope | ( | const FetchScope & | scope | ) |
Sets what data should be fetched.
The default scope is FetchScope::Content (all content parts).
- Parameters
-
scope a FetchScope object describing what data should be fetched
Definition at line 153 of file fetchjob.cpp.
void FetchJob::setSequenceSet | ( | const ImapSet & | set | ) |
Set which messages to fetch data for.
If sequence numbers are given, isUidBased() should be false. If UIDs are given, isUidBased() should be true.
- Parameters
-
set the sequence numbers or UIDs of the messages to fetch data for
Definition at line 128 of file fetchjob.cpp.
void FetchJob::setUidBased | ( | bool | uidBased | ) |
Set how the sequence set should be interpreted.
- Parameters
-
uidBased if true
the argument to setSequenceSet will be interpreted as UIDs, iffalse
it will be interpreted as sequence numbers
Definition at line 141 of file fetchjob.cpp.
QMap< qint64, qint64 > FetchJob::sizes | ( | ) | const |
- Deprecated:
- returns an empty map; use the signals instead
Definition at line 192 of file fetchjob.cpp.
QMap< qint64, qint64 > FetchJob::uids | ( | ) | const |
- Deprecated:
- returns an empty map; use the signals instead
Definition at line 197 of file fetchjob.cpp.
The documentation for this class was generated from the following files:
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.