2011-02-09 04:49:01 +03:00
|
|
|
#ifndef MAIL_DAEMON_H
|
|
|
|
#define MAIL_DAEMON_H
|
2004-09-21 02:34:03 +04:00
|
|
|
/* Daemon - talking to the mail daemon
|
2011-02-09 04:49:01 +03:00
|
|
|
*
|
|
|
|
* Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
|
|
|
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
|
2004-09-21 02:34:03 +04:00
|
|
|
*/
|
|
|
|
|
2011-02-09 04:49:01 +03:00
|
|
|
|
2011-02-21 10:24:29 +03:00
|
|
|
#include <E-mail.h>
|
|
|
|
|
|
|
|
|
2011-10-29 20:21:17 +04:00
|
|
|
#define B_MAIL_DAEMON_SIGNATURE "application/x-vnd.Be-POST"
|
|
|
|
|
2011-02-09 04:49:01 +03:00
|
|
|
const uint32 kMsgCheckAndSend = 'mbth';
|
|
|
|
const uint32 kMsgCheckMessage = 'mnow';
|
|
|
|
const uint32 kMsgSendMessages = 'msnd';
|
|
|
|
const uint32 kMsgSettingsUpdated = 'mrrs';
|
|
|
|
const uint32 kMsgAccountsChanged = 'macc';
|
|
|
|
const uint32 kMsgSetStatusWindowMode = 'shst';
|
|
|
|
const uint32 kMsgCountNewMessages = 'mnum';
|
|
|
|
const uint32 kMsgMarkMessageAsRead = 'mmar';
|
2011-02-15 05:19:49 +03:00
|
|
|
const uint32 kMsgFetchBody = 'mfeb';
|
2011-03-03 12:05:04 +03:00
|
|
|
const uint32 kMsgBodyFetched = 'mbfe';
|
2011-02-09 04:49:01 +03:00
|
|
|
|
|
|
|
|
2011-10-29 20:21:17 +04:00
|
|
|
class BMessenger;
|
|
|
|
|
|
|
|
|
2004-09-21 02:34:03 +04:00
|
|
|
class BMailDaemon {
|
2011-02-09 04:49:01 +03:00
|
|
|
public:
|
|
|
|
//! accountID = -1 means check all accounts
|
|
|
|
static status_t CheckMail(int32 accountID = -1);
|
|
|
|
static status_t CheckAndSendQueuedMail(int32 accountID = -1);
|
|
|
|
static status_t SendQueuedMail();
|
|
|
|
static int32 CountNewMessages(
|
|
|
|
bool waitForFetchCompletion = false);
|
|
|
|
static status_t MarkAsRead(int32 account, const entry_ref& ref,
|
2011-02-21 10:24:29 +03:00
|
|
|
read_flags flag = B_READ);
|
2011-02-20 10:55:47 +03:00
|
|
|
static status_t FetchBody(const entry_ref& ref,
|
2011-03-03 12:05:04 +03:00
|
|
|
BMessenger* listener = NULL);
|
2011-02-09 04:49:01 +03:00
|
|
|
static status_t Quit();
|
2004-09-21 02:34:03 +04:00
|
|
|
};
|
|
|
|
|
2011-02-09 04:49:01 +03:00
|
|
|
#endif // MAIL_DAEMON_H
|