xref: /haiku/headers/os/mail/MailDaemon.h (revision e8cd7007416a323259791ac09c013dcce2956976)
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 const uint32 kMsgCheckAndSend = 'mbth';
14 const uint32 kMsgCheckMessage = 'mnow';
15 const uint32 kMsgSendMessages = 'msnd';
16 const uint32 kMsgSettingsUpdated = 'mrrs';
17 const uint32 kMsgAccountsChanged = 'macc';
18 const uint32 kMsgSetStatusWindowMode = 'shst';
19 const uint32 kMsgCountNewMessages = 'mnum';
20 const uint32 kMsgMarkMessageAsRead = 'mmar';
21 const uint32 kMsgFetchBody = 'mfeb';
22 
23 
24 class BMailDaemon {
25 public:
26 	//! accountID = -1 means check all accounts
27 	static status_t				CheckMail(int32 accountID = -1);
28 	static status_t				CheckAndSendQueuedMail(int32 accountID = -1);
29 	static status_t				SendQueuedMail();
30 	static int32				CountNewMessages(
31 									bool waitForFetchCompletion = false);
32 	static status_t				MarkAsRead(int32 account, const entry_ref& ref,
33 									read_flags flag = B_READ);
34 	static status_t				FetchBody(const entry_ref& ref,
35 									BMessage* launchMessage = NULL);
36 	static status_t				Quit();
37 };
38 
39 #endif	// MAIL_DAEMON_H
40