xref: /haiku/src/apps/installer/CopyEngine.h (revision 746cac055adc6ac3308c7bc2d29040fb95689cc9)
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 ScanDisksPartitions(BMenu *srcMenu, BMenu *targetMenu);
27 		void SetPackagesList(BList *list);
28 		void SetSpaceRequired(off_t bytes) { fSpaceRequired = bytes; };
29 		bool Cancel();
30 	private:
31 		void LaunchInitScript(BPath &path);
32 		void LaunchFinishScript(BPath &path);
33 		void SetStatusMessage(char *status);
34 		void Start(BMenu *srcMenu, BMenu *targetMenu);
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