VMime
IMAPStore Class Reference

#include <IMAPStore.hpp>

Inheritance diagram for IMAPStore:
Collaboration diagram for IMAPStore:

Public Member Functions

 IMAPStore (shared_ptr< session > sess, shared_ptr< security::authenticator > auth, const bool secured=false)
 
 ~IMAPStore ()
 
const string getProtocolName () const
 
shared_ptr< folder > getDefaultFolder ()
 
shared_ptr< folder > getRootFolder ()
 
shared_ptr< folder > getFolder (const folder::path &path)
 
bool isValidFolderName (const folder::path::component &name) const
 
const serviceInfos & getInfos () const
 
void connect ()
 
bool isConnected () const
 
void disconnect ()
 
void noop ()
 
int getCapabilities () const
 
bool isIMAPS () const
 
bool isSecuredConnection () const
 
shared_ptr< connectionInfos > getConnectionInfos () const
 
shared_ptr< IMAPConnection > getConnection ()
 
- Public Member Functions inherited from store
Type getType () const
 
- Public Member Functions inherited from service
virtual ~service ()
 
shared_ptr< const session > getSession () const
 
shared_ptr< session > getSession ()
 
shared_ptr< const security::authenticator > getAuthenticator () const
 
shared_ptr< security::authenticator > getAuthenticator ()
 
void setAuthenticator (shared_ptr< security::authenticator > auth)
 
void setCertificateVerifier (shared_ptr< security::cert::certificateVerifier > cv)
 
shared_ptr< security::cert::certificateVerifier > getCertificateVerifier ()
 
void setSocketFactory (shared_ptr< socketFactory > sf)
 
shared_ptr< socketFactory > getSocketFactory ()
 
void setTimeoutHandlerFactory (shared_ptr< timeoutHandlerFactory > thf)
 
shared_ptr< timeoutHandlerFactory > getTimeoutHandlerFactory ()
 
void setTracerFactory (shared_ptr< tracerFactory > tf)
 
shared_ptr< tracerFactory > getTracerFactory ()
 
template<typename TYPE >
void setProperty (const string &name, const TYPE &value)
 

Static Public Member Functions

static const serviceInfos & getInfosInstance ()
 

Protected Member Functions

shared_ptr< IMAPConnection > connection ()
 
void registerFolder (IMAPFolder *folder)
 
void unregisterFolder (IMAPFolder *folder)
 
- Protected Member Functions inherited from store
 store (shared_ptr< session > sess, const serviceInfos &infos, shared_ptr< security::authenticator > auth)
 
- Protected Member Functions inherited from service
 service (shared_ptr< session > sess, const serviceInfos &infos, shared_ptr< security::authenticator > auth)
 
- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
object & operator= (const object &)
 
virtual ~object ()
 

Protected Attributes

shared_ptr< IMAPConnection > m_connection
 
std::list< IMAPFolder * > m_folders
 
const bool m_isIMAPS
 

Static Protected Attributes

static IMAPServiceInfos sm_infos
 

Additional Inherited Members

- Public Types inherited from store
enum  Capabilities {
  CAPABILITY_CREATE_FOLDER = (1 << 0) , CAPABILITY_RENAME_FOLDER = (1 << 1) , CAPABILITY_ADD_MESSAGE = (1 << 2) , CAPABILITY_COPY_MESSAGE = (1 << 3) ,
  CAPABILITY_DELETE_MESSAGE = (1 << 4) , CAPABILITY_PARTIAL_FETCH = (1 << 5) , CAPABILITY_MESSAGE_FLAGS = (1 << 6) , CAPABILITY_EXTRACT_PART = (1 << 7)
}
 
- Public Types inherited from service
enum  Type { TYPE_STORE = 0 , TYPE_TRANSPORT }
 

Detailed Description

IMAP store service.

Constructor & Destructor Documentation

◆ IMAPStore()

IMAPStore ( shared_ptr< session >  sess,
shared_ptr< security::authenticator >  auth,
const bool  secured = false 
)

◆ ~IMAPStore()

Member Function Documentation

◆ connect()

void connect ( )
virtual

◆ connection()

shared_ptr< IMAPConnection > connection ( )
protected

◆ disconnect()

void disconnect ( )
virtual

Disconnect from service.

Implements service.

References vmime::dynamicCast(), IMAPStore::isConnected(), IMAPStore::m_connection, and IMAPStore::m_folders.

Referenced by IMAPStore::~IMAPStore().

◆ getCapabilities()

int getCapabilities ( ) const
virtual

Return the features supported by this service.

This is a combination of store::CAPABILITY_xxx flags.

Returns
features supported by this service

Implements store.

References store::CAPABILITY_ADD_MESSAGE, store::CAPABILITY_COPY_MESSAGE, store::CAPABILITY_CREATE_FOLDER, store::CAPABILITY_DELETE_MESSAGE, store::CAPABILITY_EXTRACT_PART, store::CAPABILITY_MESSAGE_FLAGS, store::CAPABILITY_PARTIAL_FETCH, and store::CAPABILITY_RENAME_FOLDER.

◆ getConnection()

shared_ptr< IMAPConnection > getConnection ( )

◆ getConnectionInfos()

shared_ptr< connectionInfos > getConnectionInfos ( ) const
virtual

Get information about the connection.

Returns
information about the connection

Implements service.

References vmime::dynamicCast(), and IMAPStore::m_connection.

◆ getDefaultFolder()

shared_ptr< folder > getDefaultFolder ( )
virtual

Return the default folder.

This is protocol dependent and usually is the INBOX folder.

Returns
default folder

Implements store.

References vmime::dynamicCast(), IMAPStore::IMAPFolder, and IMAPStore::isConnected().

◆ getFolder()

shared_ptr< folder > getFolder ( const folder::path &  path)
virtual

Return the folder specified by the path.

Parameters
pathabsolute folder path
Returns
folder at the specified path

Implements store.

References vmime::dynamicCast(), IMAPStore::IMAPFolder, and IMAPStore::isConnected().

◆ getInfos()

const serviceInfos & getInfos ( ) const
virtual

Return information about this service.

Returns
information about the service

Implements service.

References IMAPStore::sm_infos.

◆ getInfosInstance()

const serviceInfos & getInfosInstance ( )
static

References IMAPStore::sm_infos.

◆ getProtocolName()

const string getProtocolName ( ) const
virtual

Return the protocol name of this service.

Returns
protocol name

Implements service.

◆ getRootFolder()

shared_ptr< folder > getRootFolder ( )
virtual

Return the root folder.

This is protocol dependent and usually is the user's mail drop root folder.

Returns
root folder

Implements store.

References vmime::dynamicCast(), IMAPStore::IMAPFolder, and IMAPStore::isConnected().

◆ isConnected()

bool isConnected ( ) const
virtual

Test whether this service is connected.

Returns
true if the service is connected, false otherwise

Implements service.

References IMAPStore::m_connection.

Referenced by IMAPStore::connect(), IMAPStore::disconnect(), IMAPStore::getDefaultFolder(), IMAPStore::getFolder(), IMAPStore::getRootFolder(), IMAPStore::noop(), and IMAPStore::~IMAPStore().

◆ isIMAPS()

bool isIMAPS ( ) const

References IMAPStore::m_isIMAPS.

◆ isSecuredConnection()

bool isSecuredConnection ( ) const
virtual

Check whether the connection is secured.

Returns
true if the connection is secured, false otherwise

Implements service.

References vmime::dynamicCast(), and IMAPStore::m_connection.

◆ isValidFolderName()

bool isValidFolderName ( const folder::path::component &  name) const
virtual

Test whether the specified folder name is a syntactically a valid name.

Returns
true if the specified folder name is valid, false otherwise

Implements store.

◆ noop()

void noop ( )
virtual

Do nothing but ensure the server do not disconnect (for example, this can reset the auto-logout timer on the server, if one exists).

Implements service.

References vmime::dynamicCast(), IMAPStore::isConnected(), IMAPStore::m_connection, IMAPStore::m_folders, and IMAPCommand::NOOP().

◆ registerFolder()

void registerFolder ( IMAPFolder *  folder)
protected

References IMAPStore::m_folders.

◆ unregisterFolder()

void unregisterFolder ( IMAPFolder *  folder)
protected

Member Data Documentation

◆ m_connection

◆ m_folders

◆ m_isIMAPS

const bool m_isIMAPS
protected

Referenced by IMAPStore::isIMAPS().

◆ sm_infos

IMAPServiceInfos sm_infos
staticprotected

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