sptk2 logo
SPTK Home Page

sptk::CImapDS Class Reference
[GUI Classes]

IMAP datasource. More...

#include <CImapDS.h>

Inheritance diagram for sptk::CImapDS:

sptk::CMemoryDS sptk::CDataSource

List of all members.

Public Member Functions

 CImapDS ()
 Default constructor.
virtual ~CImapDS ()
 Destructor.
void host (std::string host_name)
 IMAP host name.
std::string host () const
 IMAP host name.
void user (std::string usr)
 IMAP user name.
std::string user () const
 IMAP user name.
void password (std::string pwd)
 IMAP user password.
std::string password () const
 IMAP user password.
void folder (std::string d)
 IMAP folder name.
const std::string & folder () const
 IMAP folder name.
void messageID (int msgid)
int messageID () const
 Returns the ID of the message when defined to retrieve one message only.
void fetchBody (bool fb)
bool fetchBody () const
virtual bool open ()
void callback (CProgressCallback cb)

Protected Attributes

CImapConnect m_imap
 IMAP socket connector.
std::string m_folder
 IMAP folder name.
std::string m_user
 IMAP user name.
std::string m_password
 IMAP user password.
bool m_fetchbody
 True, if we want to fetch the message headers AND message body.
CProgressCallback m_callback
 Internal prograssion callback for open().
int m_msgid
 Internal message ID.


Detailed Description

IMAP datasource.

Allows to browse the list of messages and folders on IMAP server. It returns a dataset with message headers.


Member Function Documentation

void sptk::CImapDS::callback ( CProgressCallback  cb  )  [inline]

Optional callback for the open() method progression.

Parameters:
cb CProgressCallback, a callback function

References m_callback.

bool sptk::CImapDS::fetchBody (  )  const [inline]

Returns the current value of the fetch body flag

Returns:
the fetch body flag

References m_fetchbody.

void sptk::CImapDS::fetchBody ( bool  fb  )  [inline]

Sets the fetch body flag. Should be called prior to open(). If the fetch body flag is not set, only the message headers will be retrieved and that is much faster.

References m_fetchbody.

void sptk::CImapDS::messageID ( int  msgid  )  [inline]

IMAP message ID (message number in the folder). If defined, the open() will retrieve only the message with the selected ID (if any)

References m_msgid.

virtual bool sptk::CImapDS::open (  )  [virtual]

Opens the IMAP server connection with user name and password defined with user() and password(). Scans the IMAP folder defined with folder(), than closes the IMAP server connection.

Reimplemented from sptk::CMemoryDS.


The documentation for this class was generated from the following file:

Mon Mar 5 11:56:05 2012: SPTK 3.5.7