xref: /haiku/src/servers/mail/DeskbarView.h (revision b671e9bbdbd10268a042b4f4cc4317ccd03d105e)
1 /* DeskbarView - mail_daemon's deskbar menu and view
2  *
3  * Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
4  */
5 #ifndef DESKBAR_VIEW_H
6 #define DESKBAR_VIEW_H
7 
8 
9 #include <View.h>
10 
11 #include "NavMenu.h"
12 
13 
14 enum {
15 	kStatusNoMail = 0,
16 	kStatusNewMail,
17 	kStatusCount
18 };
19 
20 enum MDDeskbarMessages {
21 	MD_CHECK_SEND_NOW = 'MDra',
22 	MD_CHECK_FOR_MAILS,
23 	MD_SEND_MAILS,
24 	MD_OPEN_NEW,
25 	MD_OPEN_PREFS,
26 	MD_REFRESH_QUERY
27 };
28 
29 class BPopUpMenu;
30 class BQuery;
31 class BDirectory;
32 class BEntry;
33 class BPath;
34 
35 class _EXPORT DeskbarView : public BView {
36 public:
37 						DeskbarView(BRect frame);
38 						DeskbarView(BMessage* data);
39 	virtual				~DeskbarView();
40 
41 	virtual void		Draw(BRect updateRect);
42 	virtual void		AttachedToWindow();
43 	static DeskbarView*	Instantiate(BMessage* data);
44 	virtual	status_t	Archive(BMessage* data, bool deep = true) const;
45 	virtual void	 	MouseDown(BPoint);
46 	virtual void	 	MouseUp(BPoint);
47 	virtual void		MessageReceived(BMessage* message);
48 	virtual void		Pulse();
49 
50 private:
51 	void				_RefreshMailQuery();
52 	bool				_CreateMenuLinks(BDirectory&, BPath&);
53 	void				_CreateNewMailQuery(BEntry&);
54 	BPopUpMenu*			_BuildMenu();
55 	void				_InitBitmaps();
56 
57 	BBitmap*			fBitmaps[kStatusCount];
58 	int32				fStatus;
59 
60 	BList				fNewMailQueries;
61 	int32				fNewMessages;
62 
63 	int32				fLastButtons;
64 };
65 
66 #endif	/* DESKBAR_VIEW_H */
67