IMAPFolder Class Reference

IMAP folder implementation. More...

Inheritance diagram for IMAPFolder:
Inheritance graph
[legend]
Collaboration diagram for IMAPFolder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

int getMode () const
int getType ()
int getFlags ()
const folder::path::component getName () const
const folder::path getFullPath () const
void open (const int mode, bool failIfModeIsNotAvailable=false)
void close (const bool expunge)
void create (const int type)
bool exists ()
void destroy ()
bool isOpen () const
ref< messagegetMessage (const int num)
std::vector< ref< message > > getMessages (const int from=1, const int to=-1)
std::vector< ref< message > > getMessages (const std::vector< int > &nums)
int getMessageCount ()
ref< foldergetFolder (const folder::path::component &name)
std::vector< ref< folder > > getFolders (const bool recursive=false)
void rename (const folder::path &newPath)
void deleteMessage (const int num)
void deleteMessages (const int from=1, const int to=-1)
void deleteMessages (const std::vector< int > &nums)
void setMessageFlags (const int from, const int to, const int flags, const int mode=message::FLAG_MODE_SET)
void setMessageFlags (const std::vector< int > &nums, const int flags, const int mode=message::FLAG_MODE_SET)
void addMessage (ref< vmime::message > msg, const int flags=message::FLAG_UNDEFINED, vmime::datetime *date=NULL, utility::progressListener *progress=NULL)
void addMessage (utility::inputStream &is, const int size, const int flags=message::FLAG_UNDEFINED, vmime::datetime *date=NULL, utility::progressListener *progress=NULL)
void copyMessage (const folder::path &dest, const int num)
void copyMessages (const folder::path &dest, const int from=1, const int to=-1)
void copyMessages (const folder::path &dest, const std::vector< int > &nums)
void status (int &count, int &unseen)
void expunge ()
ref< foldergetParent ()
ref< const storegetStore () const
ref< storegetStore ()
void fetchMessages (std::vector< ref< message > > &msg, const int options, utility::progressListener *progress=NULL)
void fetchMessage (ref< message > msg, const int options)
int getFetchCapabilities () const

Detailed Description

IMAP folder implementation.


Member Function Documentation

void addMessage ( utility::inputStream is,
const int  size,
const int  flags = message::FLAG_UNDEFINED,
vmime::datetime date = NULL,
utility::progressListener progress = NULL 
) [virtual]

Add a message to this folder.

Parameters:
is message to add (data: header + body)
size size of the message to add (in bytes)
flags flags for the new message
date date/time for the new message (if NULL, the current time is used)
progress progress listener, or NULL if not used
Exceptions:
net_exception if an error occurs

Implements folder.

References IMAPFolder::addMessage().

void addMessage ( ref< vmime::message msg,
const int  flags = message::FLAG_UNDEFINED,
vmime::datetime date = NULL,
utility::progressListener progress = NULL 
) [virtual]

Add a message to this folder.

Parameters:
msg message to add (data: header + body)
flags flags for the new message
date date/time for the new message (if NULL, the current time is used)
progress progress listener, or NULL if not used
Exceptions:
net_exception if an error occurs

Implements folder.

Referenced by IMAPFolder::addMessage().

void close ( const bool  expunge  )  [virtual]

Close this folder.

Parameters:
expunge if set to true, deleted messages are expunged
Exceptions:
net_exception if an error occurs

Implements folder.

void copyMessage ( const folder::path dest,
const int  num 
) [virtual]

Copy a message from this folder to another folder.

Parameters:
dest destination folder path
num sequence number of the message to copy
Exceptions:
net_exception if an error occurs

Implements folder.

void copyMessages ( const folder::path dest,
const std::vector< int > &  nums 
) [virtual]

Copy messages from this folder to another folder.

Parameters:
dest destination folder path
nums sequence numbers of the messages to copy
Exceptions:
net_exception if an error occurs

Implements folder.

References messageCountEvent::TYPE_ADDED.

void copyMessages ( const folder::path dest,
const int  from = 1,
const int  to = -1 
) [virtual]

Copy messages from this folder to another folder.

Parameters:
dest destination folder path
from sequence number of the first message to copy
to sequence number of the last message to copy
Exceptions:
net_exception if an error occurs

Implements folder.

References messageCountEvent::TYPE_ADDED.

void create ( const int  type  )  [virtual]

Create this folder.

Parameters:
type folder type (see folder::Types)
Exceptions:
net_exception if an error occurs

Implements folder.

void deleteMessage ( const int  num  )  [virtual]

Remove a message in this folder.

Parameters:
num sequence number of the message to delete
Exceptions:
net_exception if an error occurs

Implements folder.

void deleteMessages ( const std::vector< int > &  nums  )  [virtual]

Remove one or more messages from this folder.

Parameters:
nums sequence numbers of the messages to delete
Exceptions:
net_exception if an error occurs

Implements folder.

void deleteMessages ( const int  from = 1,
const int  to = -1 
) [virtual]

Remove one or more messages from this folder.

Parameters:
from sequence number of the first message to delete
to sequence number of the last message to delete
Exceptions:
net_exception if an error occurs

Implements folder.

void destroy (  )  [virtual]

Delete this folder.

The folder should be closed before attempting to delete it.

Exceptions:
net_exception if an error occurs

Implements folder.

bool exists (  )  [virtual]

Test whether this folder exists.

Returns:
true if the folder exists, false otherwise

Implements folder.

void expunge (  )  [virtual]

Expunge deleted messages.

Exceptions:
net_exception if an error occurs

Implements folder.

References messageCountEvent::TYPE_ADDED.

void fetchMessage ( ref< message msg,
const int  options 
) [virtual]

Fetch objects for the specified message.

Parameters:
msg the message
options objects to fetch (combination of folder::FetchOptions flags)
Exceptions:
net_exception if an error occurs

Implements folder.

References progressListener::stop().

void fetchMessages ( std::vector< ref< message > > &  msg,
const int  options,
utility::progressListener progress = NULL 
) [virtual]

Fetch objects for the specified messages.

Parameters:
msg list of message sequence numbers
options objects to fetch (combination of folder::FetchOptions flags)
progress progress listener, or NULL if not used
Exceptions:
net_exception if an error occurs

Implements folder.

int getFetchCapabilities (  )  const [virtual]

Return the list of fetchable objects supported by the underlying protocol (see folder::FetchOptions).

Returns:
list of supported fetchable objects

Implements folder.

References IMAPFolder::isOpen().

int getFlags (  )  [virtual]

Return the flags of this folder.

Returns:
folder flags (see folder::Flags)

Implements folder.

References folder::TYPE_CONTAINS_FOLDERS.

ref< folder > getFolder ( const folder::path::component name  )  [virtual]

Get a new reference to a sub-folder in this folder.

Parameters:
name sub-folder name
Returns:
a new object referencing the specified folder
Exceptions:
net_exception if an error occurs

Implements folder.

std::vector< ref< folder > > getFolders ( const bool  recursive = false  )  [virtual]

Get the list of all sub-folders in this folder.

Parameters:
recursive if set to true, all the descendant are returned. If set to false, only the direct children are returned.
Returns:
list of sub-folders
Exceptions:
net_exception if an error occurs

Implements folder.

const folder::path getFullPath (  )  const [virtual]

Return the fully qualified path name of this folder.

Returns:
absolute path of the folder

Implements folder.

ref< message > getMessage ( const int  num  )  [virtual]

Get a new reference to a message in this folder.

Parameters:
num message sequence number
Returns:
a new object referencing the specified message
Exceptions:
net_exception if an error occurs

Implements folder.

int getMessageCount (  )  [virtual]

Return the number of messages in this folder.

Returns:
number of messages in the folder

Implements folder.

std::vector< ref< message > > getMessages ( const std::vector< int > &  nums  )  [virtual]

Get new references to messages in this folder.

Parameters:
nums sequence numbers of the messages to delete
Returns:
new objects referencing the specified messages
Exceptions:
net_exception if an error occurs

Implements folder.

std::vector< ref< message > > getMessages ( const int  from = 1,
const int  to = -1 
) [virtual]

Get new references to messages in this folder.

Parameters:
from sequence number of the first message to get
to sequence number of the last message to get
Returns:
new objects referencing the specified messages
Exceptions:
net_exception if an error occurs

Implements folder.

References IMAPFolder::isOpen().

int getMode (  )  const [virtual]

Return the mode in which the folder has been open.

Returns:
folder opening mode (see folder::Modes)

Implements folder.

const folder::path::component getName (  )  const [virtual]

Return the name of this folder.

Returns:
folder name

Implements folder.

References folder::FLAG_CHILDREN, and folder::FLAG_NO_OPEN.

ref< folder > getParent (  )  [virtual]

Return a new folder object referencing the parent folder of this folder.

Returns:
parent folder object

Implements folder.

ref< store > getStore (  )  [virtual]

Return a reference to the store to which this folder belongs.

Returns:
the store object to which this folder is attached

Implements folder.

ref< const store > getStore (  )  const [virtual]

Return a reference to the store to which this folder belongs.

Returns:
the store object to which this folder is attached

Implements folder.

int getType (  )  [virtual]

Return the type of this folder.

Returns:
folder type (see folder::Types)

Implements folder.

bool isOpen (  )  const [virtual]

Test whether this folder is open.

Returns:
true if the folder is open, false otherwise

Implements folder.

Referenced by IMAPFolder::getFetchCapabilities(), and IMAPFolder::getMessages().

void open ( const int  mode,
bool  failIfModeIsNotAvailable = false 
) [virtual]

Open this folder.

Parameters:
mode open mode (see folder::Modes)
failIfModeIsNotAvailable if set to false and if the requested mode is not available, a more restricted mode will be selected automatically. If set to true and if the requested mode is not available, the opening will fail.
Exceptions:
net_exception if an error occurs

Implements folder.

void rename ( const folder::path newPath  )  [virtual]

Rename (move) this folder to another location.

Parameters:
newPath new path of the folder
Exceptions:
net_exception if an error occurs

Implements folder.

References messageCountEvent::TYPE_REMOVED.

void setMessageFlags ( const std::vector< int > &  nums,
const int  flags,
const int  mode = message::FLAG_MODE_SET 
) [virtual]

Change the flags for one or more messages in this folder.

Parameters:
nums sequence numbers of the messages to modify
flags set of flags (see message::Flags)
mode indicate how to treat old and new flags (see message::FlagsModes)
Exceptions:
net_exception if an error occurs

Implements folder.

void setMessageFlags ( const int  from,
const int  to,
const int  flags,
const int  mode = message::FLAG_MODE_SET 
) [virtual]

Change the flags for one or more messages in this folder.

Parameters:
from sequence number of the first message to modify
to sequence number of the last message to modify
flags set of flags (see message::Flags)
mode indicate how to treat old and new flags (see message::FlagsModes)
Exceptions:
net_exception if an error occurs

Implements folder.

void status ( int &  count,
int &  unseen 
) [virtual]

Request folder status without opening it.

Parameters:
count will receive the number of messages in the folder
unseen will receive the number of unseen messages in the folder
Exceptions:
net_exception if an error occurs

Implements folder.


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

Generated by  doxygen 1.6.2