KIMAP::FetchJob
#include <fetchjob.h>
Classes | |
class | FetchScope |
Signals | |
KIMAP_DEPRECATED 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) |
KIMAP_DEPRECATED 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 | messagesAvailable (const QMap< qint64, KIMAP::Message > &messages) |
KIMAP_DEPRECATED void | messagesReceived (const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessageAttribute > &attrs, const QMap< qint64, KIMAP::MessagePtr > &messages) |
KIMAP_DEPRECATED void | messagesReceived (const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessagePtr > &messages) |
void | messagesVanished (const KIMAP::ImapSet &uids) |
KIMAP_DEPRECATED void | partsReceived (const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessageAttribute > &attrs, const QMap< qint64, KIMAP::MessageParts > &parts) |
KIMAP_DEPRECATED void | partsReceived (const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessageParts > &parts) |
Public Member Functions | |
FetchJob (Session *session) | |
bool | isUidBased () const |
QString | mailBox () const |
FetchScope | scope () const |
ImapSet | sequenceSet () const |
bool | setGmailExtensionsEnabled () const |
void | setGmailExtensionsEnabled (bool enabled) |
void | setScope (const FetchScope &scope) |
void | setSequenceSet (const ImapSet &set) |
void | setUidBased (bool uidBased) |
Protected Member Functions | |
void | doStart () override |
void | handleResponse (const Response &response) override |
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 \Seen flag.
This job can only be run when the session is in the selected state.
Definition at line 59 of file fetchjob.h.
Constructor & Destructor Documentation
◆ FetchJob()
|
explicit |
Definition at line 96 of file fetchjob.cpp.
Member Function Documentation
◆ doStart()
|
overrideprotected |
Definition at line 160 of file fetchjob.cpp.
◆ handleResponse()
|
overrideprotected |
Definition at line 239 of file fetchjob.cpp.
◆ headersReceived [1/2]
|
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
- Deprecated
- Use messagesAvailable() instead.
◆ headersReceived [2/2]
|
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
- Deprecated
- Use messagesAvailable() instead.
◆ isUidBased()
|
nodiscard |
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 124 of file fetchjob.cpp.
◆ mailBox()
|
nodiscard |
Returns the name of the mailbox the fetch job is executed on.
Can only be accessed after the job is actually started, before that returns an empty string.
- Since
- 5.6
Definition at line 154 of file fetchjob.cpp.
◆ messagesAvailable
|
signal |
Provides received messages.
This signal is emitted when some data are received. The signal can be emitted multiple times as the messages are being received.
- Parameters
-
messages A map from message sequence number to message. Not all fields may be populated, depending on the fetch scope.
- Since
- 5.6
◆ messagesReceived [1/2]
|
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
- Deprecated
- Use messagesAvailable() instead.
◆ messagesReceived [2/2]
|
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
- Deprecated
- Use messagesAvailable() instead.
◆ messagesVanished
|
signal |
Provides vanished messages.
This signal is emitted when QRESYNC capability (RFC5162) is available and has bee enabled on the server, and FetchScope::qresync
has been set to true
. It contains a list of messages that have vanished from the mailbox since the last modification sequence specified in FetchScope::changedSince
.
- Parameters
-
uids UIDs of messages that have been removed from the mailbox since the specified modification sequence.
- Since
- 5.16
◆ partsReceived [1/2]
|
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
- Deprecated
- Use messagesAvailable() instead.
◆ partsReceived [2/2]
|
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
- Deprecated
- Use messagesAvailable() instead.
◆ scope()
|
nodiscard |
Specifies what data will be fetched.
Definition at line 136 of file fetchjob.cpp.
◆ sequenceSet()
|
nodiscard |
The messages that will be fetched.
Definition at line 112 of file fetchjob.cpp.
◆ setGmailExtensionsEnabled() [1/2]
|
nodiscard |
Returns whether Gmail support is enabled.
- Since
- 4.14
- See also
- setGmailExtensionsEnabled()
Definition at line 142 of file fetchjob.cpp.
◆ setGmailExtensionsEnabled() [2/2]
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 148 of file fetchjob.cpp.
◆ setScope()
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 130 of file fetchjob.cpp.
◆ setSequenceSet()
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 105 of file fetchjob.cpp.
◆ setUidBased()
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 118 of file fetchjob.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:51:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.