xref: /haiku/src/apps/haikudepot/ui/FeaturedPackagesView.h (revision 64b46b706b02d969629415c9a44c394a2a5e4993)
1 /*
2  * Copyright 2014, Stephan Aßmus <superstippi@gmx.de>.
3  * Copyright 2020, Andrew Lindesay <apl@lindesay.co.nz>.
4  * All rights reserved. Distributed under the terms of the MIT License.
5  */
6 #ifndef FEATURED_PACKAGES_VIEW_H
7 #define FEATURED_PACKAGES_VIEW_H
8 
9 
10 #include <View.h>
11 
12 #include "Model.h"
13 #include "PackageInfo.h"
14 #include "PackageInfoListener.h"
15 
16 
17 class StackedFeaturedPackagesView;
18 
19 
20 class FeaturedPackagesView : public BView {
21 public:
22 								FeaturedPackagesView(Model& model);
23 	virtual						~FeaturedPackagesView();
24 
25 	virtual	void				DoLayout();
26 
27 			void				AddPackage(const PackageInfoRef& package);
28 			void				RemovePackage(const PackageInfoRef& package);
29 			void				Clear();
30 
31 			void				SelectPackage(const PackageInfoRef& package,
32 									bool scrollToEntry = false);
33 
34 	static	void				CleanupIcons();
35 
36 private:
37 			void				_AdjustViews();
38 
39 private:
40 			Model&				fModel;
41 			BScrollView*		fScrollView;
42 			StackedFeaturedPackagesView*
43 								fPackagesView;
44 };
45 
46 
47 #endif // FEATURED_PACKAGES_VIEW_H
48