KIMAP::FetchJob

Search for usage in LXR

#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()

FetchJob::FetchJob ( Session * session)
explicit

Definition at line 96 of file fetchjob.cpp.

Member Function Documentation

◆ doStart()

void FetchJob::doStart ( )
overrideprotected

Definition at line 160 of file fetchjob.cpp.

◆ handleResponse()

void FetchJob::handleResponse ( const Response & response)
overrideprotected

Definition at line 239 of file fetchjob.cpp.

◆ headersReceived [1/2]

KIMAP_DEPRECATED void KIMAP::FetchJob::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 )
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
mailBoxthe name of the mailbox the fetch job was executed on
uidsa map from message sequence numbers to message UIDs; this will always be populated
attrsa map from message sequence numbers to a pair of attribute name and value
sizesa 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
flagsa map from message sequence numbers to message flags; populated if the scope is FetchScope::Flags, FetchScope::Full of FetchScope::Headers
messagesa 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]

KIMAP_DEPRECATED void KIMAP::FetchJob::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 )
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
mailBoxthe name of the mailbox the fetch job was executed on
uidsa map from message sequence numbers to message UIDs; this will always be populated
sizesa 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
flagsa map from message sequence numbers to message flags; populated if the scope is FetchScope::Flags, FetchScope::Full of FetchScope::Headers
messagesa 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()

bool FetchJob::isUidBased ( ) const
nodiscard

How to interpret the sequence set.

Returns
if true the result of sequenceSet() should be interpreted as UIDs, if false it should be interpreted as sequence numbers

Definition at line 124 of file fetchjob.cpp.

◆ mailBox()

QString FetchJob::mailBox ( ) const
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

void KIMAP::FetchJob::messagesAvailable ( const QMap< qint64, KIMAP::Message > & messages)
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
messagesA map from message sequence number to message. Not all fields may be populated, depending on the fetch scope.
Since
5.6

◆ messagesReceived [1/2]

KIMAP_DEPRECATED void KIMAP::FetchJob::messagesReceived ( const QString & mailBox,
const QMap< qint64, qint64 > & uids,
const QMap< qint64, KIMAP::MessageAttribute > & attrs,
const QMap< qint64, KIMAP::MessagePtr > & messages )
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
mailBoxthe name of the mailbox the fetch job was executed on
uidsa map from message sequence numbers to message UIDs
attrsa map from message sequence numbers to pair of attribute name and it's value
messagesa 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]

KIMAP_DEPRECATED void KIMAP::FetchJob::messagesReceived ( const QString & mailBox,
const QMap< qint64, qint64 > & uids,
const QMap< qint64, KIMAP::MessagePtr > & messages )
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
mailBoxthe name of the mailbox the fetch job was executed on
uidsa map from message sequence numbers to message UIDs
messagesa map from message sequence numbers to message contents
Deprecated
Use messagesAvailable() instead.

◆ messagesVanished

void KIMAP::FetchJob::messagesVanished ( const KIMAP::ImapSet & uids)
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
uidsUIDs of messages that have been removed from the mailbox since the specified modification sequence.
Since
5.16

◆ partsReceived [1/2]

KIMAP_DEPRECATED void KIMAP::FetchJob::partsReceived ( const QString & mailBox,
const QMap< qint64, qint64 > & uids,
const QMap< qint64, KIMAP::MessageAttribute > & attrs,
const QMap< qint64, KIMAP::MessageParts > & parts )
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
mailBoxthe name of the mailbox the fetch job was executed on
uidsa map from message sequence numbers to message UIDs
attrsa map from message sequence numbers to pair of attribute
partsa 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]

KIMAP_DEPRECATED void KIMAP::FetchJob::partsReceived ( const QString & mailBox,
const QMap< qint64, qint64 > & uids,
const QMap< qint64, KIMAP::MessageParts > & parts )
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
mailBoxthe name of the mailbox the fetch job was executed on
uidsa map from message sequence numbers to message UIDs
partsa map from message sequence numbers to message part collections
Deprecated
Use messagesAvailable() instead.

◆ scope()

FetchJob::FetchScope FetchJob::scope ( ) const
nodiscard

Specifies what data will be fetched.

Definition at line 136 of file fetchjob.cpp.

◆ sequenceSet()

ImapSet FetchJob::sequenceSet ( ) const
nodiscard

The messages that will be fetched.

Definition at line 112 of file fetchjob.cpp.

◆ setGmailExtensionsEnabled() [1/2]

bool FetchJob::setGmailExtensionsEnabled ( ) const
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
enabledWhether 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
scopea 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
setthe 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
uidBasedif true the argument to setSequenceSet will be interpreted as UIDs, if false 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:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:06:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.