1 /* 2 * Copyright 2022, Andrew Lindesay <apl@lindesay.co.nz> 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef ABSTRACT_PACKAGE_PROCESS_H 6 #define ABSTRACT_PACKAGE_PROCESS_H 7 8 9 #include <Referenceable.h> 10 11 #include "AbstractProcess.h" 12 #include "PackageInfo.h" 13 14 15 class PackageManager; 16 class Model; 17 18 19 class AbstractPackageProcess : public BReferenceable, public AbstractProcess { 20 public: 21 AbstractPackageProcess(PackageInfoRef package, 22 Model* model); 23 virtual ~AbstractPackageProcess(); 24 InstallLocation()25 int32 InstallLocation() const 26 { return fInstallLocation; } 27 28 protected: 29 PackageInfoRef FindPackageByName(const BString& name); 30 31 void SetPackageState(PackageInfoRef& package, PackageState state); 32 void SetPackageDownloadProgress(PackageInfoRef& package, float value); 33 void ClearPackageInstallationLocations(PackageInfoRef& package); 34 35 protected: 36 PackageManager* fPackageManager; 37 PackageInfoRef fPackage; 38 39 private: 40 Model* fModel; 41 int32 fInstallLocation; 42 }; 43 44 45 typedef BReference<AbstractPackageProcess> PackageProcessRef; 46 47 48 #endif // ABSTRACT_PACKAGE_PROCESS_H 49