xref: /haiku/src/apps/haikudepot/packagemanagement/AbstractPackageProcess.h (revision 17889a8c70dbb3d59c1412f6431968753c767bab)
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 
25 			int32				InstallLocation() const
26 									{ return fInstallLocation; }
27 
28 protected:
29 			PackageInfoRef		FindPackageByName(const BString& name);
30 
31 protected:
32 			PackageManager*		fPackageManager;
33 			PackageInfoRef		fPackage;
34 
35 private:
36 			Model*				fModel;
37 			int32				fInstallLocation;
38 };
39 
40 
41 typedef BReference<AbstractPackageProcess> PackageProcessRef;
42 
43 
44 #endif // ABSTRACT_PACKAGE_PROCESS_H
45