xref: /haiku/src/apps/haikudepot/ui/PackageListView.h (revision bf57c148f7787f0df15980976997c6dfb70ee067)
1 /*
2  * Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
3  * Copyright 2013, Rene Gollent <rene@gollent.com>.
4  * All rights reserved. Distributed under the terms of the MIT License.
5  */
6 #ifndef PACKAGE_LIST_VIEW_H
7 #define PACKAGE_LIST_VIEW_H
8 
9 
10 #include <ColumnListView.h>
11 #include <ColumnTypes.h>
12 #include <Locker.h>
13 
14 #include "PackageInfo.h"
15 
16 
17 class PackageRow;
18 class PackageListener;
19 
20 class PackageListView : public BColumnListView {
21 public:
22 								PackageListView(BLocker* modelLock);
23 	virtual						~PackageListView();
24 
25 	virtual void				AttachedToWindow();
26 	virtual	void				AllAttached();
27 
28 	virtual	void				MessageReceived(BMessage* message);
29 
30 	virtual void				SelectionChanged();
31 
32 			void				AddPackage(const PackageInfoRef& package);
33 
34 private:
35 			PackageRow*			_FindRow(const PackageInfoRef& package,
36 									PackageRow* parent = NULL);
37 			PackageRow*			_FindRow(const BString& packageTitle,
38 									PackageRow* parent = NULL);
39 
40 private:
41 			class ItemCountView;
42 
43 			BLocker*			fModelLock;
44 			ItemCountView*		fItemCountView;
45 			PackageListener*	fPackageListener;
46 };
47 
48 #endif // PACKAGE_LIST_VIEW_H
49