Public Types | Public Member Functions
Tonido::Data::MailManager Class Reference

Manages Messages sent via Tonido. More...

List of all members.

Public Types

typedef boost::shared_ptr
< MailManager
SharedPtr

Public Member Functions

 MailManager (void)
 Ctor.
 ~MailManager (void)
 Dtor.
bool messageAdd (Mail::SharedPtr &a_message)
 Adds a Message.
Mail::SharedPtr messageGet (const Poco::UUID &a_messageID)
 Gets a Message.
bool messageCollectionGet (Mail::Collection &a_collection, const std::string &status)
 Gets the full list of Messages.
bool messageCollectionGet (Mail::Collection &a_collection, const std::string &status, int offset, int limit)
 Gets the full list of Messages with specified limit, offset.
bool messageSearch (Mail::Collection &a_collection, const std::string &keyword, int offset, int limit, int &a_total)
 Searches the message list for a specific keyword.
int messageCount (const std::string &a_status)
 Gets the count of messages for a given message status.
bool messageDelete (const Poco::UUID &a_messageID)
 Deletes the specified Message.
bool messageRead (const Poco::UUID &a_messageID)
 Mark the specified message as read.
bool messageUnRead (const Poco::UUID &a_messageID)
 Mark the specified message as UnRead.
bool messageSent (const Poco::UUID &a_messageID)
 Mark the specified message as Sent.
bool messageDelivered (const Poco::UUID &a_messageID)
 Mark the specified message as Delivered.
bool messageDeliveryFailed (const Poco::UUID &a_messageID)
 Mark the specified message as Delivery Failed.
bool messageStatusUpdate (const Poco::UUID &a_messageID, const std::string &status)
 Updates the status of a given message.
bool messageDateUpdate (const Poco::UUID &a_messageID, const std::string &a_date)
 Changes the date of a message.
uint32_bt messagesUnreadCount ()
 Returns number of unread messages.
void sendMessage (const Mail::SharedPtr &a_message)
 Sends a message to the intended reciepient.
void onMessageReceived (Message::SharedPtr &args)
 Processes a Message Received Message from another Peer.
void onMailMessageOK (Message::SharedPtr &args)
 Processes a Message Received OK Message from another Peer.
void processPeerConnect (const PeerID &a_peer)
 Processes a Peer Connection Event.
void processNetworkOnline ()
 Processes a Network Online Event.
void onTimer ()
 Processes the Message Timer.

Detailed Description

Manages Messages sent via Tonido.


Constructor & Destructor Documentation

Tonido::Data::MailManager::MailManager ( void  )

Ctor.

details if needed ...

Tonido::Data::MailManager::~MailManager ( void  )

Dtor.

details if needed ...


Member Function Documentation

bool Tonido::Data::MailManager::messageAdd ( Mail::SharedPtr &  a_message)

Adds a Message.

Parameters:
[in]a_messagemessage to add
Returns:
true on successs, false otherwise
bool Tonido::Data::MailManager::messageCollectionGet ( Mail::Collection &  a_collection,
const std::string &  status 
)

Gets the full list of Messages.

Parameters:
[out]a_collectionlist of messages
[in]statusmessage status
Returns:
true on successs, false otherwise
bool Tonido::Data::MailManager::messageCollectionGet ( Mail::Collection &  a_collection,
const std::string &  status,
int  offset,
int  limit 
)

Gets the full list of Messages with specified limit, offset.

Parameters:
[out]a_collectionlist of messages
[in]statusmessage status
[in]offsetfirst position to get
[in]limitmessage count
Returns:
true on successs, false otherwise
int Tonido::Data::MailManager::messageCount ( const std::string &  a_status)

Gets the count of messages for a given message status.

Parameters:
[in]statusmessage status
Returns:
the count of messages
bool Tonido::Data::MailManager::messageDateUpdate ( const Poco::UUID &  a_messageID,
const std::string &  a_date 
)

Changes the date of a message.

Parameters:
[in]a_messageIDmessage id to update
[in]a_datenew date
Returns:
true on successs, false otherwise
bool Tonido::Data::MailManager::messageDelete ( const Poco::UUID &  a_messageID)

Deletes the specified Message.

Parameters:
[in]a_messageIDmessage id to delete
Returns:
true on successs, false otherwise
bool Tonido::Data::MailManager::messageDelivered ( const Poco::UUID &  a_messageID)

Mark the specified message as Delivered.

Parameters:
[in]a_messageIDmessage id to mark
Returns:
true on successs, false otherwise
bool Tonido::Data::MailManager::messageDeliveryFailed ( const Poco::UUID &  a_messageID)

Mark the specified message as Delivery Failed.

Parameters:
[in]a_messageIDmessage id to mark
Returns:
true on successs, false otherwise
Mail::SharedPtr Tonido::Data::MailManager::messageGet ( const Poco::UUID &  a_messageID)

Gets a Message.

Parameters:
[in]a_messageIDmessage id to get
Returns:
mail message if found
bool Tonido::Data::MailManager::messageRead ( const Poco::UUID &  a_messageID)

Mark the specified message as read.

Parameters:
[in]a_messageIDmessage id to mark
Returns:
true on successs, false otherwise
bool Tonido::Data::MailManager::messageSearch ( Mail::Collection &  a_collection,
const std::string &  keyword,
int  offset,
int  limit,
int &  a_total 
)

Searches the message list for a specific keyword.

Parameters:
[out]a_collectionlist of messages
[in]keywordstring to search
[in]offsetfirst position to get
[in]limitmessage count
[out]a_totaltotal found messages
Returns:
true on successs, false otherwise
bool Tonido::Data::MailManager::messageSent ( const Poco::UUID &  a_messageID)

Mark the specified message as Sent.

Parameters:
[in]a_messageIDmessage id to mark
Returns:
true on successs, false otherwise
bool Tonido::Data::MailManager::messageStatusUpdate ( const Poco::UUID &  a_messageID,
const std::string &  status 
)

Updates the status of a given message.

Parameters:
[in]a_messageIDmessage id to update
[in]statusmessage status
Returns:
true on successs, false otherwise
uint32_bt Tonido::Data::MailManager::messagesUnreadCount ( )

Returns number of unread messages.

Returns:
number of unread messages
bool Tonido::Data::MailManager::messageUnRead ( const Poco::UUID &  a_messageID)

Mark the specified message as UnRead.

Parameters:
[in]a_messageIDmessage id to mark
Returns:
true on successs, false otherwise
void Tonido::Data::MailManager::onMailMessageOK ( Message::SharedPtr &  args)

Processes a Message Received OK Message from another Peer.

Internal Use Only

Parameters:
[in]argsmessage to process
void Tonido::Data::MailManager::onMessageReceived ( Message::SharedPtr &  args)

Processes a Message Received Message from another Peer.

Internal Use Only

Parameters:
[in]argsmessage to process
void Tonido::Data::MailManager::onTimer ( )

Processes the Message Timer.

Internal Use Only

void Tonido::Data::MailManager::processNetworkOnline ( )

Processes a Network Online Event.

Internal Use Only

void Tonido::Data::MailManager::processPeerConnect ( const PeerID a_peer)

Processes a Peer Connection Event.

Internal Use Only

Parameters:
[in]a_peerpeer id to process
void Tonido::Data::MailManager::sendMessage ( const Mail::SharedPtr &  a_message)

Sends a message to the intended reciepient.

Parameters:
[in]a_messagemessage to send

Generated on Wed Oct 12 2011 21:46:53. © CodeLathe LLC 2007-2011. All Rights Reserved.