MailDaemon.h revision 146357b5
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
13class BMailDaemon {
14public:
15								BMailDaemon();
16	virtual						~BMailDaemon();
17
18			bool				IsRunning();
19
20			status_t			CheckMail(int32 accountID = -1);
21			status_t			CheckAndSendQueuedMail(int32 accountID = -1);
22
23			status_t			SendQueuedMail();
24
25			int32				CountNewMessages(
26									bool waitForFetchCompletion = false);
27			status_t			MarkAsRead(int32 account, const entry_ref& ref,
28									read_flags flag = B_READ);
29			status_t			FetchBody(const entry_ref& ref,
30									BMessenger* listener = NULL);
31
32			status_t			Quit();
33			status_t			Launch();
34
35private:
36			BMessenger			fDaemon;
37};
38
39
40#endif	// _MAIL_DAEMON_H
41