1b76ca311SAxel Dörfler /* 2197f59b0SAxel 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 16*49c044abSAxel Dörfler #include "BootMenu.h" 17*49c044abSAxel Dörfler 18b76ca311SAxel Dörfler 19b76ca311SAxel Dörfler class BootDrive; 20b76ca311SAxel Dörfler class WizardView; 21b76ca311SAxel Dörfler class WizardPageView; 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 375675f44eSAxel Dörfler virtual void Previous(WizardView* wizard); 385675f44eSAxel Dörfler 39b76ca311SAxel Dörfler protected: 40b76ca311SAxel Dörfler virtual int32 InitialState(); 41b76ca311SAxel Dörfler virtual int32 NextState(int32 state); 42b76ca311SAxel Dörfler virtual WizardPageView* CreatePage(int32 state, WizardView* wizard); 43b76ca311SAxel Dörfler 44b76ca311SAxel Dörfler private: 45b76ca311SAxel Dörfler enum State { 46b76ca311SAxel Dörfler kStateEntry, 47b76ca311SAxel Dörfler kStateErrorEntry, 48b76ca311SAxel Dörfler 49b76ca311SAxel Dörfler // Install states 50b76ca311SAxel Dörfler kStateSaveMBR, 51b76ca311SAxel Dörfler kStateMBRSaved, 52b76ca311SAxel Dörfler kStatePartitions, 53b76ca311SAxel Dörfler kStateDefaultPartitions, 54b76ca311SAxel Dörfler kStateInstallSummary, 55b76ca311SAxel Dörfler kStateInstalled, 56b76ca311SAxel Dörfler 57b76ca311SAxel Dörfler // Uninstall states 58b76ca311SAxel Dörfler kStateUninstall, 59b76ca311SAxel Dörfler kStateUninstalled 60b76ca311SAxel Dörfler }; 61b76ca311SAxel Dörfler 62b76ca311SAxel Dörfler bool _HasSelectedPartitions(); 63b76ca311SAxel Dörfler bool _WriteBootMenu(); 64b76ca311SAxel Dörfler bool _SaveMBR(); 65b76ca311SAxel Dörfler bool _RestoreMBR(); 66b76ca311SAxel Dörfler 67197f59b0SAxel Dörfler WizardPageView* _CreateErrorEntryPage(); 68b76ca311SAxel Dörfler WizardPageView* _CreateSaveMBRPage(BRect frame); 69197f59b0SAxel Dörfler WizardPageView* _CreateMBRSavedPage(); 70197f59b0SAxel Dörfler WizardPageView* _CreateInstallSummaryPage(); 71197f59b0SAxel Dörfler WizardPageView* _CreateInstalledPage(); 72b76ca311SAxel Dörfler WizardPageView* _CreateUninstallPage(BRect frame); 73197f59b0SAxel Dörfler WizardPageView* _CreateUninstalledPage(); 74b76ca311SAxel Dörfler 75b76ca311SAxel Dörfler BMessage fSettings; 76*49c044abSAxel Dörfler BootMenuList fBootMenus; 77*49c044abSAxel Dörfler BootDrive* fBootDrive; 785675f44eSAxel Dörfler BootMenu* fBootMenu; 79b76ca311SAxel Dörfler 80*49c044abSAxel Dörfler status_t fCollectPartitionsStatus; 81b76ca311SAxel Dörfler status_t fWriteBootMenuStatus; 82b76ca311SAxel Dörfler status_t fSaveMBRStatus; 83b76ca311SAxel Dörfler status_t fRestoreMBRStatus; 84b76ca311SAxel Dörfler }; 85b76ca311SAxel Dörfler 86b76ca311SAxel Dörfler 87b76ca311SAxel Dörfler #endif // BOOT_MANAGER_CONTROLLER_H 88