1b76ca311SAxel Dörfler /* 2*197f59b0SAxel Dörfler * Copyright 2008-2011, Haiku, Inc. All rights reserved. 3b76ca311SAxel Dörfler * Distributed under the terms of the MIT License. 4b76ca311SAxel Dörfler * 5b76ca311SAxel Dörfler * Authors: 6b76ca311SAxel Dörfler * Michael Pfeiffer <laplace@users.sourceforge.net> 7b76ca311SAxel Dörfler */ 8b76ca311SAxel Dörfler #ifndef BOOT_MANAGER_CONTROLLER_H 9b76ca311SAxel Dörfler #define BOOT_MANAGER_CONTROLLER_H 10b76ca311SAxel Dörfler 11b76ca311SAxel Dörfler 12b76ca311SAxel Dörfler #include "WizardController.h" 13b76ca311SAxel Dörfler 14b76ca311SAxel Dörfler #include <Message.h> 15b76ca311SAxel Dörfler 16b76ca311SAxel Dörfler 17b76ca311SAxel Dörfler class BootDrive; 18b76ca311SAxel Dörfler 19b76ca311SAxel Dörfler class WizardView; 20b76ca311SAxel Dörfler class WizardPageView; 21b76ca311SAxel Dörfler class BRect; 22b76ca311SAxel Dörfler 23b76ca311SAxel Dörfler 24b76ca311SAxel Dörfler /* Remainder of Settings Message Format: 25b76ca311SAxel Dörfler (See also BootDrive.h) 26b76ca311SAxel Dörfler "install" bool (whether install or uninstall should be performed) 27b76ca311SAxel Dörfler "file" String (the file where the backup of the MBR is saved) 28b76ca311SAxel Dörfler "defaultPartition" int32 (index of default partition) 29b76ca311SAxel Dörfler "timeout" int32 (timeout in seconds, -1 for no timeout) 30b76ca311SAxel Dörfler */ 31b76ca311SAxel Dörfler 32b76ca311SAxel Dörfler class BootManagerController : public WizardController { 33b76ca311SAxel Dörfler public: 34b76ca311SAxel Dörfler BootManagerController(); 35b76ca311SAxel Dörfler virtual ~BootManagerController(); 36b76ca311SAxel Dörfler 37b76ca311SAxel Dörfler protected: 38b76ca311SAxel Dörfler virtual int32 InitialState(); 39b76ca311SAxel Dörfler virtual int32 NextState(int32 state); 40b76ca311SAxel Dörfler virtual WizardPageView* CreatePage(int32 state, WizardView* wizard); 41b76ca311SAxel Dörfler 42b76ca311SAxel Dörfler private: 43b76ca311SAxel Dörfler enum State { 44b76ca311SAxel Dörfler kStateEntry, 45b76ca311SAxel Dörfler kStateErrorEntry, 46b76ca311SAxel Dörfler 47b76ca311SAxel Dörfler // Install states 48b76ca311SAxel Dörfler kStateSaveMBR, 49b76ca311SAxel Dörfler kStateMBRSaved, 50b76ca311SAxel Dörfler kStatePartitions, 51b76ca311SAxel Dörfler kStateDefaultPartitions, 52b76ca311SAxel Dörfler kStateInstallSummary, 53b76ca311SAxel Dörfler kStateInstalled, 54b76ca311SAxel Dörfler 55b76ca311SAxel Dörfler // Uninstall states 56b76ca311SAxel Dörfler kStateUninstall, 57b76ca311SAxel Dörfler kStateUninstalled 58b76ca311SAxel Dörfler }; 59b76ca311SAxel Dörfler 60b76ca311SAxel Dörfler bool _HasSelectedPartitions(); 61b76ca311SAxel Dörfler bool _WriteBootMenu(); 62b76ca311SAxel Dörfler bool _SaveMBR(); 63b76ca311SAxel Dörfler bool _RestoreMBR(); 64b76ca311SAxel Dörfler 65*197f59b0SAxel Dörfler WizardPageView* _CreateErrorEntryPage(); 66b76ca311SAxel Dörfler WizardPageView* _CreateSaveMBRPage(BRect frame); 67*197f59b0SAxel Dörfler WizardPageView* _CreateMBRSavedPage(); 68*197f59b0SAxel Dörfler WizardPageView* _CreateInstallSummaryPage(); 69*197f59b0SAxel Dörfler WizardPageView* _CreateInstalledPage(); 70b76ca311SAxel Dörfler WizardPageView* _CreateUninstallPage(BRect frame); 71*197f59b0SAxel Dörfler WizardPageView* _CreateUninstalledPage(); 72b76ca311SAxel Dörfler 73b76ca311SAxel Dörfler BMessage fSettings; 74b76ca311SAxel Dörfler BootDrive* fBootDrive; 75b76ca311SAxel Dörfler 76b76ca311SAxel Dörfler status_t fReadPartitionsStatus; 77b76ca311SAxel Dörfler status_t fWriteBootMenuStatus; 78b76ca311SAxel Dörfler status_t fSaveMBRStatus; 79b76ca311SAxel Dörfler status_t fRestoreMBRStatus; 80b76ca311SAxel Dörfler }; 81b76ca311SAxel Dörfler 82b76ca311SAxel Dörfler 83b76ca311SAxel Dörfler #endif // BOOT_MANAGER_CONTROLLER_H 84