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
14namespace BPrivate {
15	class PaneSwitch;
16};
17using namespace BPrivate;
18
19class BButton;
20class BLayoutItem;
21class BGroupView;
22class BMenu;
23class BMenuField;
24class BMenuItem;
25class BStatusBar;
26class BStringView;
27class BTextView;
28class PackagesView;
29class WorkerThread;
30
31enum InstallStatus {
32	kReadyForInstall,
33	kInstalling,
34	kFinished,
35	kCancelled
36};
37
38
39class InstallerWindow : public BWindow {
40public:
41								InstallerWindow();
42	virtual						~InstallerWindow();
43
44	virtual	void				MessageReceived(BMessage* message);
45	virtual	bool				QuitRequested();
46private:
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