2012-10-31 01:45:54 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2012, Haiku Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _MAIL_DAEMON_H
|
|
|
|
#define _MAIL_DAEMON_H
|
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>
|
2012-10-31 01:45:54 +04:00
|
|
|
#include <Messenger.h>
|
2011-02-21 10:24:29 +03:00
|
|
|
|
|
|
|
|
2012-10-31 03:21:55 +04:00
|
|
|
enum {
|
|
|
|
B_MAIL_BODY_FETCHED = '_Mbf'
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-10-31 01:45:54 +04:00
|
|
|
class BMailDaemon {
|
|
|
|
public:
|
|
|
|
BMailDaemon();
|
|
|
|
virtual ~BMailDaemon();
|
2011-02-09 04:49:01 +03:00
|
|
|
|
2012-10-31 01:45:54 +04:00
|
|
|
bool IsRunning();
|
2011-02-09 04:49:01 +03:00
|
|
|
|
2012-10-31 01:45:54 +04:00
|
|
|
status_t CheckMail(int32 accountID = -1);
|
|
|
|
status_t CheckAndSendQueuedMail(int32 accountID = -1);
|
2011-10-29 20:21:17 +04:00
|
|
|
|
2012-10-31 01:45:54 +04:00
|
|
|
status_t SendQueuedMail();
|
2011-10-29 20:21:17 +04:00
|
|
|
|
2012-10-31 01:45:54 +04:00
|
|
|
int32 CountNewMessages(
|
2011-02-09 04:49:01 +03:00
|
|
|
bool waitForFetchCompletion = false);
|
2012-10-31 01:45:54 +04:00
|
|
|
status_t MarkAsRead(int32 account, const entry_ref& ref,
|
2011-02-21 10:24:29 +03:00
|
|
|
read_flags flag = B_READ);
|
2012-10-31 01:45:54 +04:00
|
|
|
status_t FetchBody(const entry_ref& ref,
|
2011-03-03 12:05:04 +03:00
|
|
|
BMessenger* listener = NULL);
|
2012-10-31 01:45:54 +04:00
|
|
|
|
|
|
|
status_t Quit();
|
|
|
|
status_t Launch();
|
|
|
|
|
|
|
|
private:
|
|
|
|
BMessenger fDaemon;
|
2004-09-21 02:34:03 +04:00
|
|
|
};
|
|
|
|
|
2012-10-31 01:45:54 +04:00
|
|
|
|
|
|
|
#endif // _MAIL_DAEMON_H
|