xref: /haiku/src/servers/notification/AppGroupView.h (revision f73f5d4c42a01ece688cbb57b5d332cc0f68b2c6)
1 /*
2  * Copyright 2010, 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 _APP_GROUP_VIEW_H
9 #define _APP_GROUP_VIEW_H
10 
11 #include <vector>
12 
13 #include <GroupView.h>
14 #include <String.h>
15 
16 class BGroupView;
17 
18 class NotificationWindow;
19 class NotificationView;
20 
21 typedef std::vector<NotificationView*> infoview_t;
22 
23 class AppGroupView : public BGroupView {
24 public:
25 								AppGroupView(NotificationWindow* win, const char* label);
26 
27 	virtual	void				MouseDown(BPoint point);
28 	virtual	void				MessageReceived(BMessage* msg);
29 			void				Draw(BRect updateRect);
30 
31 			bool				HasChildren();
32 			int32				ChildrenCount();
33 
34 			void				AddInfo(NotificationView* view);
35 
36 			const BString&		Group() const;
37 
38 private:
39 			void				_DrawCloseButton(const BRect& updateRect);
40 
41 			BString				fLabel;
42 			NotificationWindow*	fParent;
43 			infoview_t			fInfo;
44 			bool				fCollapsed;
45 			BRect				fCloseRect;
46 			BRect				fCollapseRect;
47 			bool				fCloseClicked;
48 };
49 
50 #endif	// _APP_GROUP_VIEW_H
51