xref: /haiku/src/apps/installer/InstallerWindow.h (revision b05b0c1c29376ad87549f5692cb81a678cb01e54)
1 /*
2  * Copyright 2009-2010, 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 INSTALLER_WINDOW_H
7 #define INSTALLER_WINDOW_H
8 
9 
10 #include <String.h>
11 #include <Window.h>
12 
13 
14 namespace BPrivate {
15 	class PaneSwitch;
16 };
17 using namespace BPrivate;
18 
19 class BButton;
20 class BLayoutItem;
21 class BGroupView;
22 class BMenu;
23 class BMenuField;
24 class BMenuItem;
25 class BStatusBar;
26 class BStringView;
27 class BTextView;
28 class PackagesView;
29 class WorkerThread;
30 
31 enum InstallStatus {
32 	kReadyForInstall,
33 	kInstalling,
34 	kFinished,
35 	kCancelled
36 };
37 
38 
39 class InstallerWindow : public BWindow {
40 public:
41 								InstallerWindow();
42 	virtual						~InstallerWindow();
43 
44 	virtual	void				MessageReceived(BMessage* message);
45 	virtual	bool				QuitRequested();
46 private:
47 			void				_ShowOptionalPackages();
48 			void				_LaunchDriveSetup();
49 			void				_LaunchBootManager();
50 			void				_DisableInterface(bool disable);
51 			void				_ScanPartitions();
52 			void				_UpdateControls();
53 			void				_PublishPackages();
54 			void				_SetStatusMessage(const char* text);
55 
56 			void				_SetCopyEngineCancelSemaphore(sem_id id,
57 									bool alreadyLocked = false);
58 			void				_QuitCopyEngine(bool askUser);
59 
60 	static	int					_ComparePackages(const void* firstArg,
61 									const void* secondArg);
62 
63 			BGroupView*			fLogoGroup;
64 			BTextView*			fStatusView;
65 			BMenu*				fSrcMenu;
66 			BMenu*				fDestMenu;
67 			BMenuField*			fSrcMenuField;
68 			BMenuField*			fDestMenuField;
69 
70 			PaneSwitch*			fPackagesSwitch;
71 			PackagesView*		fPackagesView;
72 			BStringView*		fSizeView;
73 
74 			BStatusBar*			fProgressBar;
75 
76 			BLayoutItem*		fPkgSwitchLayoutItem;
77 			BLayoutItem*		fPackagesLayoutItem;
78 			BLayoutItem*		fSizeViewLayoutItem;
79 			BLayoutItem*		fProgressLayoutItem;
80 
81 			BButton*			fBeginButton;
82 			BButton*			fLaunchDriveSetupButton;
83 			BMenuItem*			fLaunchBootManagerItem;
84 			BMenuItem*			fMakeBootableItem;
85 
86 			bool				fEncouragedToSetupPartitions;
87 
88 			bool				fDriveSetupLaunched;
89 			bool				fBootManagerLaunched;
90 			InstallStatus		fInstallStatus;
91 
92 			WorkerThread*		fWorkerThread;
93 			BString				fLastStatus;
94 			sem_id				fCopyEngineCancelSemaphore;
95 };
96 
97 
98 #endif // INSTALLER_WINDOW_H
99