xref: /haiku/headers/os/mail/MailDaemon.h (revision 7749d0bb0c358a3279b1b9cc76d8376e900130a5)
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 const uint32 kMsgBodyFetched = 'mbfe';
23 
24 
25 class BMailDaemon {
26 public:
27 	//! accountID = -1 means check all accounts
28 	static status_t				CheckMail(int32 accountID = -1);
29 	static status_t				CheckAndSendQueuedMail(int32 accountID = -1);
30 	static status_t				SendQueuedMail();
31 	static int32				CountNewMessages(
32 									bool waitForFetchCompletion = false);
33 	static status_t				MarkAsRead(int32 account, const entry_ref& ref,
34 									read_flags flag = B_READ);
35 	static status_t				FetchBody(const entry_ref& ref,
36 									BMessenger* listener = NULL);
37 	static status_t				Quit();
38 };
39 
40 #endif	// MAIL_DAEMON_H
41