/* * Copyright 2013, Stephan Aßmus . * Copyright 2013, Rene Gollent . * Copyright 2020, Andrew Lindesay * All rights reserved. Distributed under the terms of the MIT License. */ #ifndef PACKAGE_LIST_VIEW_H #define PACKAGE_LIST_VIEW_H #include #include #include #include #include "Model.h" #include "PackageInfo.h" class PackageRow; class PackageListener; class WorkStatusView; class PackageListView : public BColumnListView { public: PackageListView(Model* model); virtual ~PackageListView(); virtual void AttachedToWindow(); virtual void AllAttached(); virtual void MessageReceived(BMessage* message); virtual void SelectionChanged(); virtual void Clear(); void AddPackage(const PackageInfoRef& package); void RemovePackage(const PackageInfoRef& package); void SelectPackage(const PackageInfoRef& package); void AttachWorkStatusView(WorkStatusView* view); private: PackageRow* _FindRow(const PackageInfoRef& package); PackageRow* _FindRow(const BString& packageName); private: class ItemCountView; struct RowByNameHashDefinition; typedef BOpenHashTable RowByNameTable; Model* fModel; ItemCountView* fItemCountView; PackageListener* fPackageListener; RowByNameTable* fRowByNameTable; WorkStatusView* fWorkStatusView; bool fIgnoreSelectionChanged; }; #endif // PACKAGE_LIST_VIEW_H