1 /* 2 * Copyright 2024, Andrew Lindesay <apl@lindesay.co.nz>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef PACKAGE_FILTER_MODEL_H 6 #define PACKAGE_FILTER_MODEL_H 7 8 #include <String.h> 9 10 #include "PackageFilter.h" 11 12 13 class PackageFilterModel 14 { 15 public: 16 PackageFilterModel(); 17 virtual ~PackageFilterModel(); 18 19 BString SearchTerms() const; 20 BString DepotName() const; 21 BString Category() const; 22 bool ShowAvailablePackages() const; 23 bool ShowInstalledPackages() const; 24 bool ShowSourcePackages() const; 25 bool ShowDevelopPackages() const; 26 27 void SetSearchTerms(BString value); 28 void SetDepotName(BString value); 29 void SetCategory(BString value); 30 void SetShowAvailablePackages(bool value); 31 void SetShowInstalledPackages(bool value); 32 void SetShowSourcePackages(bool value); 33 void SetShowDevelopPackages(bool value); 34 35 PackageFilterRef Filter(); 36 37 private: 38 PackageFilterRef _CreateFilter() const; 39 40 private: 41 BString fSearchTerms; 42 BString fDepotName; 43 BString fCategory; 44 bool fShowAvailablePackages; 45 bool fShowInstalledPackages; 46 bool fShowSourcePackages; 47 bool fShowDevelopPackages; 48 49 PackageFilterRef fFilter; 50 }; 51 52 53 #endif // PACKAGE_FILTER_MODEL_H 54