1#ifndef MAIL_DAEMON_H
2#define MAIL_DAEMON_H
3/* Daemon - talking to the mail daemon
4 *
5 * Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
6 * Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
7*/
8
9
10#include <E-mail.h>
11
12
13#define B_MAIL_DAEMON_SIGNATURE "application/x-vnd.Be-POST"
14
15const uint32 kMsgCheckAndSend = 'mbth';
16const uint32 kMsgCheckMessage = 'mnow';
17const uint32 kMsgSendMessages = 'msnd';
18const uint32 kMsgSettingsUpdated = 'mrrs';
19const uint32 kMsgAccountsChanged = 'macc';
20const uint32 kMsgSetStatusWindowMode = 'shst';
21const uint32 kMsgCountNewMessages = 'mnum';
22const uint32 kMsgMarkMessageAsRead = 'mmar';
23const uint32 kMsgFetchBody = 'mfeb';
24const uint32 kMsgBodyFetched = 'mbfe';
25
26
27class BMessenger;
28
29
30class BMailDaemon {
31public:
32	//! accountID = -1 means check all accounts
33	static status_t				CheckMail(int32 accountID = -1);
34	static status_t				CheckAndSendQueuedMail(int32 accountID = -1);
35	static status_t				SendQueuedMail();
36	static int32				CountNewMessages(
37									bool waitForFetchCompletion = false);
38	static status_t				MarkAsRead(int32 account, const entry_ref& ref,
39									read_flags flag = B_READ);
40	static status_t				FetchBody(const entry_ref& ref,
41									BMessenger* listener = NULL);
42	static status_t				Quit();
43};
44
45#endif	// MAIL_DAEMON_H
46