xref: /haiku/src/apps/installer/CopyEngine.h (revision 079eccf655ba39812b421ae1b87a727d41b50354)
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 		bool Cancel();
32 	private:
33 		void LaunchInitScript(BPath &path);
34 		void LaunchFinishScript(BPath &path);
35 		status_t CopyFolder(BDirectory &srcDir, BDirectory &targetDir);
36 
37 		InstallerWindow *fWindow;
38 		BDiskDeviceRoster fDDRoster;
39 		InstallerCopyLoopControl *fControl;
40 		BList *fPackages;
41 		off_t fSpaceRequired;
42 };
43 
44 #endif /* _CopyEngine_h */
45