xref: /haiku/src/apps/installer/CopyEngine.h (revision 56eb8e78cc702792e3b032e3f5f45da9e5dbea9e)
1 /*
2  * Copyright 2005, Jérôme DUVAL. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #ifndef _CopyEngine_h
7 #define _CopyEngine_h
8 
9 #include "InstallerCopyLoopControl.h"
10 
11 #include <DiskDevice.h>
12 #include <DiskDeviceRoster.h>
13 #include <Looper.h>
14 #include <Messenger.h>
15 #include <Partition.h>
16 #include <Volume.h>
17 
18 class InstallerWindow;
19 
20 const uint32 ENGINE_START = 'eSRT';
21 
22 class CopyEngine : public BLooper {
23 	public:
24 		CopyEngine(InstallerWindow *window);
25 		void MessageReceived(BMessage *msg);
26 		void SetStatusMessage(char *status);
27 		status_t Start(BMenu *srcMenu, BMenu *targetMenu);
28 		void ScanDisksPartitions(BMenu *srcMenu, BMenu *targetMenu);
29 		void SetPackagesList(BList *list);
30 		void SetSpaceRequired(off_t bytes) { fSpaceRequired = bytes; };
31 	private:
32 		void LaunchInitScript(BPath &path);
33 		void LaunchFinishScript(BPath &path);
34 		void CopyFolder(BDirectory &srcDir, BDirectory &targetDir);
35 
36 		InstallerWindow *fWindow;
37 		BDiskDeviceRoster fDDRoster;
38 		InstallerCopyLoopControl *fControl;
39 		BList *fPackages;
40 		off_t fSpaceRequired;
41 };
42 
43 #endif /* _CopyEngine_h */
44