repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / haikudepot / ui / PackageListView.h
blob17f4e3f645515df2a458dd54a33005c37f4b23e2
1 /*
2 * Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
3 * Copyright 2013, Rene Gollent <rene@gollent.com>.
4 * All rights reserved. Distributed under the terms of the MIT License.
5 */
6 #ifndef PACKAGE_LIST_VIEW_H
7 #define PACKAGE_LIST_VIEW_H
10 #include <ColumnListView.h>
11 #include <ColumnTypes.h>
12 #include <Locker.h>
13 #include <util/OpenHashTable.h>
15 #include "PackageInfo.h"
18 class PackageRow;
19 class PackageListener;
20 class WorkStatusView;
23 class PackageListView : public BColumnListView {
24 public:
25 PackageListView(BLocker* modelLock);
26 virtual ~PackageListView();
28 virtual void AttachedToWindow();
29 virtual void AllAttached();
31 virtual void MessageReceived(BMessage* message);
33 virtual void SelectionChanged();
35 virtual void Clear();
36 void AddPackage(const PackageInfoRef& package);
37 void RemovePackage(const PackageInfoRef& package);
39 void SelectPackage(const PackageInfoRef& package);
41 void AttachWorkStatusView(WorkStatusView* view);
43 private:
44 PackageRow* _FindRow(const PackageInfoRef& package);
45 PackageRow* _FindRow(const BString& packageName);
47 private:
48 class ItemCountView;
49 struct RowByNameHashDefinition;
50 typedef BOpenHashTable<RowByNameHashDefinition> RowByNameTable;
52 BLocker* fModelLock;
53 ItemCountView* fItemCountView;
54 PackageListener* fPackageListener;
55 RowByNameTable* fRowByNameTable;
57 WorkStatusView* fWorkStatusView;
60 #endif // PACKAGE_LIST_VIEW_H