repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / bootmanager / BootManagerController.h
blob876b41bf9689332f9a9aab01cbeee141fc4edc3b
1 /*
2 * Copyright 2008-2011, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Michael Pfeiffer <laplace@users.sourceforge.net>
7 */
8 #ifndef BOOT_MANAGER_CONTROLLER_H
9 #define BOOT_MANAGER_CONTROLLER_H
12 #include "WizardController.h"
14 #include <Message.h>
16 #include "BootMenu.h"
19 class BootDrive;
20 class WizardView;
21 class WizardPageView;
24 /* Remainder of Settings Message Format:
25 (See also BootDrive.h)
26 "install" bool (whether install or uninstall should be performed)
27 "file" String (the file where the backup of the MBR is saved)
28 "defaultPartition" int32 (index of default partition)
29 "timeout" int32 (timeout in seconds, -1 for no timeout)
32 class BootManagerController : public WizardController {
33 public:
34 BootManagerController();
35 virtual ~BootManagerController();
37 virtual void Previous(WizardView* wizard);
39 protected:
40 virtual int32 InitialState();
41 virtual int32 NextState(int32 state);
42 virtual WizardPageView* CreatePage(int32 state, WizardView* wizard);
44 private:
45 enum State {
46 kStateEntry,
47 kStateErrorEntry,
49 // Install states
50 kStateSaveMBR,
51 kStateMBRSaved,
52 kStatePartitions,
53 kStateDefaultPartitions,
54 kStateInstallSummary,
55 kStateInstalled,
57 // Uninstall states
58 kStateUninstall,
59 kStateUninstalled
62 bool _HasSelectedPartitions();
63 bool _WriteBootMenu();
64 bool _SaveMBR();
65 bool _RestoreMBR();
67 WizardPageView* _CreateErrorEntryPage();
68 WizardPageView* _CreateSaveMBRPage(BRect frame);
69 WizardPageView* _CreateMBRSavedPage();
70 WizardPageView* _CreateInstallSummaryPage();
71 WizardPageView* _CreateInstalledPage();
72 WizardPageView* _CreateUninstallPage(BRect frame);
73 WizardPageView* _CreateUninstalledPage();
75 BMessage fSettings;
76 BootMenuList fBootMenus;
77 BootDrive* fBootDrive;
78 BootMenu* fBootMenu;
80 status_t fCollectPartitionsStatus;
81 status_t fWriteBootMenuStatus;
82 status_t fSaveMBRStatus;
83 status_t fRestoreMBRStatus;
87 #endif // BOOT_MANAGER_CONTROLLER_H