xref: /haiku/src/servers/notification/NotificationWindow.h (revision 226f6c8bf18d1d1250d91dc630de3662bdc03ec8)
1 /*
2  * Copyright 2010-2017, Haiku, Inc. All Rights Reserved.
3  * Copyright 2008-2009, Pier Luigi Fiorini. All Rights Reserved.
4  * Copyright 2004-2008, Michael Davidson. All Rights Reserved.
5  * Copyright 2004-2007, Mikael Eiman. All Rights Reserved.
6  * Distributed under the terms of the MIT License.
7  */
8 #ifndef _NOTIFICATION_WINDOW_H
9 #define _NOTIFICATION_WINDOW_H
10 
11 #include <cmath>
12 #include <vector>
13 #include <map>
14 
15 #include <AppFileInfo.h>
16 #include <Path.h>
17 #include <String.h>
18 #include <Window.h>
19 
20 #include "NotificationView.h"
21 
22 
23 class AppGroupView;
24 class AppUsage;
25 
26 struct property_info;
27 
28 typedef std::map<BString, AppGroupView*> appview_t;
29 typedef std::map<BString, AppUsage*> appfilter_t;
30 
31 const uint32 kRemoveGroupView = 'RGVi';
32 
33 
34 class NotificationWindow : public BWindow {
35 public:
36 									NotificationWindow();
37 	virtual							~NotificationWindow();
38 
39 	virtual	bool					QuitRequested();
40 	virtual	void					MessageReceived(BMessage*);
41 	virtual	void					WorkspaceActivated(int32, bool);
42 	virtual	void					FrameResized(float width, float height);
43 	virtual	void					ScreenChanged(BRect frame, color_space mode);
44 
45 			icon_size				IconSize();
46 			int32					Timeout();
47 			float					Width();
48 
49 			void					_ShowHide();
50 
51 private:
52 	friend class AppGroupView;
53 
54 			void					SetPosition();
55 			void					_LoadSettings(bool startMonitor = false);
56 			void					_LoadAppFilters(BMessage& settings);
57 			void					_LoadGeneralSettings(BMessage& settings);
58 			void					_LoadDisplaySettings(BMessage& settings);
59 
60 			appview_t				fAppViews;
61 			appfilter_t				fAppFilters;
62 
63 			float					fWidth;
64 			icon_size				fIconSize;
65 			int32					fTimeout;
66 			uint32					fPosition;
67 			bool					fShouldRun;
68 			BPath					fCachePath;
69 };
70 
71 extern property_info main_prop_list[];
72 
73 #endif	// _NOTIFICATION_WINDOW_H
74