1 /* 2 * Copyright 2014, Stephan Aßmus <superstippi@gmx.de>. 3 * Copyright 2020-2021, 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 BeginAddRemove(); 28 void EndAddRemove(); 29 void AddPackage(const PackageInfoRef& package); 30 void RemovePackage(const PackageInfoRef& package); 31 void Clear(); 32 33 void SelectPackage(const PackageInfoRef& package, 34 bool scrollToEntry = false); 35 36 static void CleanupIcons(); 37 38 private: 39 void _AdjustViews(); 40 41 private: 42 Model& fModel; 43 BScrollView* fScrollView; 44 StackedFeaturedPackagesView* 45 fPackagesView; 46 }; 47 48 49 #endif // FEATURED_PACKAGES_VIEW_H 50