1 /* 2 * Copyright 2015, TigerKid001. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef PACKAGE_CONTENTS_VIEW_H 6 #define PACKAGE_CONTENTS_VIEW_H 7 8 #include <Locker.h> 9 #include <View.h> 10 11 #include "PackageInfo.h" 12 13 class BOutlineListView; 14 15 16 class PackageContentsView : public BView { 17 public: 18 PackageContentsView(const char* name); 19 virtual ~PackageContentsView(); 20 21 virtual void AttachedToWindow(); 22 virtual void AllAttached(); 23 24 void SetPackage(const PackageInfoRef& package); 25 void Clear(); 26 27 private: 28 void _InitContentPopulator(); 29 static int32 _ContentPopulatorThread(void* arg); 30 bool _PopuplatePackageContens( 31 const PackageInfo& package); 32 int32 _InstallLocation( 33 const PackageInfo& package) const; 34 35 private: 36 BOutlineListView* fContentListView; 37 38 thread_id fContentPopulator; 39 sem_id fContentPopulatorSem; 40 BLocker fPackageLock; 41 PackageInfoRef fPackage; 42 }; 43 44 #endif // PACKAGE_CONTENTS_VIEW_H 45