vfs: check userland buffers before reading them.
[haiku.git] / src / servers / mail / DeskbarView.h
blob0eecf3a0ef30fc0b028a90a686f6f7b514b47acf
1 /* DeskbarView - mail_daemon's deskbar menu and view
3 * Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
4 */
5 #ifndef DESKBAR_VIEW_H
6 #define DESKBAR_VIEW_H
9 #include <View.h>
11 #include "NavMenu.h"
14 enum {
15 kStatusNoMail = 0,
16 kStatusNewMail,
17 kStatusCount
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
29 class BPopUpMenu;
30 class BQuery;
31 class BDirectory;
32 class BEntry;
33 class BPath;
35 class _EXPORT DeskbarView : public BView {
36 public:
37 DeskbarView(BRect frame);
38 DeskbarView(BMessage* data);
39 virtual ~DeskbarView();
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();
50 private:
51 bool _EntryInTrash(const entry_ref*);
52 void _RefreshMailQuery();
53 bool _CreateMenuLinks(BDirectory&, BPath&);
54 void _CreateNewMailQuery(BEntry&);
55 BPopUpMenu* _BuildMenu();
56 void _InitBitmaps();
57 status_t _GetNewQueryRef(entry_ref& ref);
59 BBitmap* fBitmaps[kStatusCount];
60 int32 fStatus;
62 BList fNewMailQueries;
63 int32 fNewMessages;
65 int32 fLastButtons;
68 #endif /* DESKBAR_VIEW_H */