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