• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KIMAP Library

  • KIMAP
  • KIMAP::FetchJob
Classes | Signals | Public Member Functions | Protected Member Functions

KIMAP::FetchJob Class Reference

Fetch message data from the server. More...

#include <fetchjob.h>

Inherits KIMAP::Job.

List of all members.

Classes

struct  FetchScope
 Used to indicate what message data should be fetched. More...

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 messagesReceived (const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessagePtr > &messages)
void partsReceived (const QString &mailBox, const QMap< qint64, qint64 > &uids, const QMap< qint64, KIMAP::MessageParts > &parts)

Public Member Functions

 FetchJob (Session *session)
QMap< qint64, MessageFlags > flags () const
bool isUidBased () const
QMap< qint64, MessagePtr > messages () const
QMap< qint64, MessageParts > parts () const
FetchScope scope () const
ImapSet sequenceSet () const
void setScope (const FetchScope &scope)
void setSequenceSet (const ImapSet &set)
void setUidBased (bool uidBased)
QMap< qint64, qint64 > sizes () const
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 56 of file fetchjob.h.


Member Function Documentation

QMap< qint64, MessageFlags > FetchJob::flags (  )  const

All the flags that have been received.

This may be empty, depending on the scope of the fetch.

Returns:
a map from message sequence numbers to message flags

Definition at line 174 of file fetchjob.cpp.

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:
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
bool FetchJob::isUidBased (  )  const

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 144 of file fetchjob.cpp.

QMap< qint64, MessagePtr > FetchJob::messages (  )  const

All the messages that have been received.

This may be empty, depending on the scope of the fetch.

Returns:
a map from message sequence numbers to message contents (including headers)

Definition at line 162 of file fetchjob.cpp.

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:
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
QMap< qint64, MessageParts > FetchJob::parts (  )  const

All the parts that have been received.

Empty unless parts were specified in the scope.

Returns:
a map from message sequence numbers to message part collections

Definition at line 168 of file fetchjob.cpp.

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:
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
FetchJob::FetchScope FetchJob::scope (  )  const

Specifies what data will be fetched.

Definition at line 156 of file fetchjob.cpp.

ImapSet FetchJob::sequenceSet (  )  const

The messages that will be fetched.

Definition at line 132 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 150 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 125 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, if false it will be interpreted as sequence numbers

Definition at line 138 of file fetchjob.cpp.

QMap< qint64, qint64 > FetchJob::sizes (  )  const

All the message sizes that have been received.

This may be empty, depending on the scope of the fetch.

Returns:
a map from message sequence numbers to message sizes (sizes are in octets and refer to the transfer encoding of the message)

Definition at line 180 of file fetchjob.cpp.

QMap< qint64, qint64 > FetchJob::uids (  )  const

All the message UIDs that have been received.

This will be populated with all the messages that data was fetched for.

Returns:
a map from message sequence numbers to message UIDs

Definition at line 186 of file fetchjob.cpp.


The documentation for this class was generated from the following files:
  • fetchjob.h
  • fetchjob.cpp

KIMAP Library

Skip menu "KIMAP Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal