Provides user level access to the mail_daemon to perform common mail tasks such as check for new messages or send queued messages. More...
Public Member Functions | |
| BMailDaemon () | |
| Creates a BMailDaemon object that communicates with the mail_daemon server. | |
| virtual | ~BMailDaemon () |
| Frees all resources associated with this object. | |
Running status | |
| bool | IsRunning () |
| Checks if the mail_daemon is running. | |
| status_t | Quit () |
| Request the mail_daemon to quit. | |
| status_t | Launch () |
| Launches the mail_daemon. | |
Mail tasks | |
| status_t | CheckMail (int32 accountID=-1) |
| Asks the mail_daemon to check if there are new messages for the account with ID accountID. | |
| status_t | CheckAndSendQueuedMail (int32 accountID=-1) |
| Asks the mail_daemon to check if there are new messages and to send any queued messages pending to be sent, for the account with ID accountID. | |
| status_t | SendQueuedMail () |
| Asks the mail_daemon to send any queued message pending to be sent. | |
| int32 | CountNewMessages (bool waitForFetchCompletion=false) |
| Asks the mail_daemon how many new messages there are. | |
| status_t | MarkAsRead (int32 account, const entry_ref &ref, read_flags flag=B_READ) |
| Requests the mail_daemon to mark an e-mail message as read or unread. | |
| status_t | FetchBody (const entry_ref &ref, BMessenger *listener=NULL) |
| Requests the mail_daemon to retrieve the message's body. | |
Provides user level access to the mail_daemon to perform common mail tasks such as check for new messages or send queued messages.
| BMailDaemon::BMailDaemon | ( | ) |
Creates a BMailDaemon object that communicates with the mail_daemon server.
|
virtual |
Frees all resources associated with this object.
Asks the mail_daemon to check if there are new messages and to send any queued messages pending to be sent, for the account with ID accountID.
If accountID is -1, it will check for new messages and send the queued messages for all the available accounts.
| [in] | accountID | The ID of the account. |
| B_OK | The request has been sent successfully. |
| B_MAIL_NO_DAEMON | The mail_daemon is not currently running. |
Asks the mail_daemon to check if there are new messages for the account with ID accountID.
If accountID is -1, it will check for new messages for all the available accounts.
| [in] | accountID | The ID of the account. |
| B_OK | The request has been sent successfully. |
| B_MAIL_NO_DAEMON | The mail_daemon is not currently running. |
| int32 BMailDaemon::CountNewMessages | ( | bool | waitForFetchCompletion = false | ) |
Asks the mail_daemon how many new messages there are.
| [in] | waitForFetchCompletion | If true, it will make the count once the mail server fetching is completed. |
B_MAIL_NO_DAEMON if the mail_daemon is not currently running.| status_t BMailDaemon::FetchBody | ( | const entry_ref & | ref, |
| BMessenger * | listener = NULL |
||
| ) |
Requests the mail_daemon to retrieve the message's body.
If listener is not NULL, it will receive a B_MAIL_BODY_FETCHED notification after the e-mail message's body was fetched successfully, or else an error code if something went wrong.
| [in] | ref | The entry_ref of the target message. |
| [in] | listener | A BMessenger where a reply will be sent to. |
| B_OK | The request has been sent successfully. |
| B_MAIL_NO_DAEMON | The mail_daemon is not currently running. |
| bool BMailDaemon::IsRunning | ( | ) |
Checks if the mail_daemon is running.
| true | The mail_daemon is running. |
| false | The mail_daemon is not running. |
| status_t BMailDaemon::Launch | ( | ) |
Launches the mail_daemon.
| B_OK | The mail_daemon has been launched successfully. |
| B_ALREADY_RUNNING | The mail_daemon is already running. |
Requests the mail_daemon to mark an e-mail message as read or unread.
| [in] | account | The account's ID. |
| [in] | ref | The entry_ref of the target message. |
| [in] | flag | Can be one of these: B_UNREAD, B_SEEN, B_READ. |
| B_OK | The request has been sent successfully. |
| B_MAIL_NO_DAEMON | The mail_daemon is not currently running. |
| status_t BMailDaemon::Quit | ( | ) |
Request the mail_daemon to quit.
| B_OK | The request has been sent successfully. |
| B_MAIL_NO_DAEMON | The mail_daemon is not currently running. |
| status_t BMailDaemon::SendQueuedMail | ( | ) |
Asks the mail_daemon to send any queued message pending to be sent.
| B_OK | The request has been sent successfully. |
| B_MAIL_NO_DAEMON | The mail_daemon is not currently running. |