1 /* 2 * Copyright 2014, Stephan Aßmus <superstippi@gmx.de>. 3 * Copyright 2020-2024, 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 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