repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / installer / WorkerThread.h
blob80233efe0a3f9afe57866b9ccce73cf3391bfb6b
1 /*
2 * Copyright 2009, Stephan Aßmus <superstippi@gmx.de>.
3 * Copyright 2005, Jérôme DUVAL.
4 * All rights reserved. Distributed under the terms of the MIT License.
5 */
6 #ifndef WORKER_THREAD_H
7 #define WORKER_THREAD_H
9 #include <DiskDevice.h>
10 #include <DiskDeviceRoster.h>
11 #include <Looper.h>
12 #include <Messenger.h>
13 #include <Partition.h>
14 #include <Volume.h>
16 class BList;
17 class BMenu;
18 class ProgressReporter;
20 class WorkerThread : public BLooper {
21 public:
22 WorkerThread(const BMessenger& owner);
24 virtual void MessageReceived(BMessage* message);
26 void ScanDisksPartitions(BMenu* srcMenu,
27 BMenu* dstMenu);
29 void SetPackagesList(BList* list);
30 void SetSpaceRequired(off_t bytes)
31 { fSpaceRequired = bytes; };
33 bool Cancel();
34 void SetLock(sem_id cancelSemaphore)
35 { fCancelSemaphore = cancelSemaphore; }
37 void StartInstall(partition_id sourcePartitionID,
38 partition_id targetPartitionID);
39 void WriteBootSector(BMenu* dstMenu);
41 private:
42 void _LaunchInitScript(BPath& path);
43 void _LaunchFinishScript(BPath& path);
45 status_t _PerformInstall(partition_id sourcePartitionID,
46 partition_id targetPartitionID);
47 status_t _InstallationError(status_t error);
48 status_t _MirrorIndices(const BPath& srcDirectory,
49 const BPath& targetDirectory) const;
50 status_t _CreateDefaultIndices(
51 const BPath& targetDirectory) const;
52 status_t _ProcessZipPackages(const char* sourcePath,
53 const char* targetPath,
54 ProgressReporter* reporter,
55 BList& unzipEngines);
57 void _SetStatusMessage(const char* status);
59 private:
60 class EntryFilter;
62 private:
63 BMessenger fOwner;
64 BDiskDeviceRoster fDDRoster;
65 BList* fPackages;
66 off_t fSpaceRequired;
67 sem_id fCancelSemaphore;
70 #endif // WORKER_THREAD_H