xref: /haiku/src/apps/haikudepot/server/LocalPkgDataLoadProcess.h (revision 12dba4e70f831d6d27a7f769cc9dab19c19a155d)
1 /*
2  * Copyright 2018, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 
6 
7 #ifndef LOCAL_PKG_DATA_LOAD_PROCESS__H
8 #define LOCAL_PKG_DATA_LOAD_PROCESS__H
9 
10 
11 #include "AbstractProcess.h"
12 
13 #include "Model.h"
14 #include "PackageInfo.h"
15 
16 #include <File.h>
17 #include <Path.h>
18 #include <String.h>
19 #include <Url.h>
20 
21 #include <package/RepositoryCache.h>
22 
23 
24 class PkgDataLoadState;
25 
26 
27 /*! This process will take the data from the locally stored repositories (HPKR)
28     and will extract the packages.  The packages are then loaded into the
29     HaikuDepot 'Model'.
30 */
31 
32 class LocalPkgDataLoadProcess : public AbstractProcess {
33 public:
34 								LocalPkgDataLoadProcess(
35 									PackageInfoListener* packageInfoListener,
36 									Model *model, bool force = false);
37 	virtual						~LocalPkgDataLoadProcess();
38 
39 			const char*			Name() const;
40 			const char*			Description() const;
41 
42 protected:
43 	virtual status_t			RunInternal();
44 
45 private:
46 			void				_NotifyError(const BString& messageText) const;
47 
48 private:
49 			Model*				fModel;
50 			bool				fForce;
51 			PackageInfoListener*
52 								fPackageInfoListener;
53 };
54 
55 #endif // LOCAL_PKG_DATA_LOAD_PROCESS__H
56