1 /* 2 * Copyright 2021, 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 25 int32 InstallLocation() const 26 { return fInstallLocation; } 27 28 static int32 InstallLocation(const PackageInfoRef& package); 29 30 protected: 31 PackageInfoRef FindPackageByName(const BString& name); 32 33 protected: 34 PackageManager* fPackageManager; 35 PackageInfoRef fPackage; 36 37 private: 38 Model* fModel; 39 int32 fInstallLocation; 40 }; 41 42 43 typedef BReference<AbstractPackageProcess> PackageProcessRef; 44 45 46 #endif // ABSTRACT_PACKAGE_PROCESS_H 47