repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / bootmanager / WizardController.h
bloba83ef946584f01e13c30ecb9f31f8a2686584997
1 /*
2 * Copyright 2008-2010, 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 WIZARD_CONTROLLER_H
9 #define WIZARD_CONTROLLER_H
12 #include <SupportDefs.h>
15 class WizardView;
16 class WizardPageView;
19 class WizardController {
20 public:
21 WizardController();
22 virtual ~WizardController();
24 virtual void Initialize(WizardView* wizard);
25 virtual void Next(WizardView* wizard);
26 virtual void Previous(WizardView* wizard);
28 protected:
29 virtual int32 InitialState() = 0;
30 virtual int32 NextState(int32 state) = 0;
31 virtual WizardPageView* CreatePage(int32 state, WizardView* wizard) = 0;
33 int32 CurrentState() const;
35 private:
36 class StateStack {
37 public:
38 StateStack(int32 state, StateStack* next)
40 fState(state),
41 fNext(next)
45 int32 State()
47 return fState;
50 StateStack* Next()
52 return fNext;
55 void MakeEmpty();
57 private:
58 int32 fState;
59 StateStack* fNext;
62 void _PushState(int32 state);
63 void _ShowPage(WizardView* wizard);
65 private:
66 StateStack* fStack;
70 #endif // WIZARD_CONTROLLER_H