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_CLASSIFICATION_INFO_H 6 #define PACKAGE_CLASSIFICATION_INFO_H 7 8 9 #include <vector> 10 11 #include <Referenceable.h> 12 13 #include "PackageCategory.h" 14 15 16 class PackageClassificationInfo : public BReferenceable 17 { 18 public: 19 PackageClassificationInfo(); 20 PackageClassificationInfo(const PackageClassificationInfo& other); 21 22 bool operator==(const PackageClassificationInfo& other) const; 23 bool operator!=(const PackageClassificationInfo& other) const; 24 25 void SetProminence(uint32 prominence); 26 uint32 Prominence() const 27 { return fProminence; } 28 bool HasProminence() const 29 { return fProminence != 0; } 30 bool IsProminent() const; 31 32 void ClearCategories(); 33 bool AddCategory(const CategoryRef& category); 34 int32 CountCategories() const; 35 CategoryRef CategoryAtIndex(int32 index) const; 36 bool HasCategoryByCode(const BString& code) const; 37 38 bool IsNativeDesktop() const; 39 void SetIsNativeDesktop(bool value); 40 41 private: 42 std::vector<CategoryRef> 43 fCategories; 44 uint32 fProminence; 45 bool fIsNativeDesktop; 46 }; 47 48 49 typedef BReference<PackageClassificationInfo> PackageClassificationInfoRef; 50 51 52 #endif // PACKAGE_CLASSIFICATION_INFO_H 53