1/*
2 * Copyright 2012, Haiku Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _MAIL_DAEMON_H
6#define _MAIL_DAEMON_H
7
8
9#include <E-mail.h>
10#include <Messenger.h>
11
12
13enum {
14	B_MAIL_BODY_FETCHED = '_Mbf'
15};
16
17
18class BMailDaemon {
19public:
20								BMailDaemon();
21	virtual						~BMailDaemon();
22
23			bool				IsRunning();
24
25			status_t			CheckMail(int32 accountID = -1);
26			status_t			CheckAndSendQueuedMail(int32 accountID = -1);
27
28			status_t			SendQueuedMail();
29
30			int32				CountNewMessages(
31									bool waitForFetchCompletion = false);
32			status_t			MarkAsRead(int32 account, const entry_ref& ref,
33									read_flags flag = B_READ);
34			status_t			FetchBody(const entry_ref& ref,
35									BMessenger* listener = NULL);
36
37			status_t			Quit();
38			status_t			Launch();
39
40private:
41			BMessenger			fDaemon;
42};
43
44
45#endif	// _MAIL_DAEMON_H
46