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 _APP_GROUP_VIEW_H
9#define _APP_GROUP_VIEW_H
10
11#include <vector>
12
13#include <GroupView.h>
14#include <Messenger.h>
15#include <String.h>
16
17class BGroupView;
18
19class NotificationWindow;
20class NotificationView;
21
22typedef std::vector<NotificationView*> infoview_t;
23
24class AppGroupView : public BGroupView {
25public:
26								AppGroupView(const BMessenger& messenger, const char* label);
27
28	virtual	void				MouseDown(BPoint point);
29	virtual	void				MessageReceived(BMessage* msg);
30			void				Draw(BRect updateRect);
31
32			bool				HasChildren();
33			int32				ChildrenCount();
34
35			void				AddInfo(NotificationView* view);
36			void				SetPreviewModeOn(bool enabled);
37
38			const BString&		Group() const;
39			void				SetGroup(const char* group);
40
41private:
42			void				_DrawCloseButton(const BRect& updateRect);
43
44			BString				fLabel;
45			BMessenger			fMessenger;
46			infoview_t			fInfo;
47			bool				fCollapsed;
48			BRect				fCloseRect;
49			BRect				fCollapseRect;
50			float				fHeaderSize;
51			bool				fCloseClicked;
52			bool				fPreviewModeOn;
53};
54
55#endif	// _APP_GROUP_VIEW_H
56