xref: /haiku/src/apps/haikudepot/ui/FeaturedPackagesView.h (revision 60a6f1d5d7a8715cd3897dd0b626f2e4a64984a8)
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 "PackageInfo.h"
13 #include "PackageInfoListener.h"
14 
15 
16 class StackedFeaturedPackagesView;
17 
18 
19 class FeaturedPackagesView : public BView {
20 public:
21 								FeaturedPackagesView();
22 	virtual						~FeaturedPackagesView();
23 
24 	virtual	void				FrameResized(float width, float height);
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 
41 			BScrollView*		fScrollView;
42 			StackedFeaturedPackagesView*
43 								fPackagesView;
44 };
45 
46 
47 #endif // FEATURED_PACKAGES_VIEW_H
48