ALBA
albaWizard.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaWizard
5 Authors: Gianluigi Crimi
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaWizard_H__
18#define __albaWizard_H__
19
20//----------------------------------------------------------------------------
21// includes :
22//----------------------------------------------------------------------------
23#include "albaDefines.h"
24#include "albaObserver.h"
25#include "albaWizardBlock.h"
26#include <vector>
27
28//----------------------------------------------------------------------------
29// forward reference
30//----------------------------------------------------------------------------
31
32class albaObserver;
33class albaVME;
34
35#ifdef ALBA_EXPORT
36#include "albaDllMacros.h"
38#endif
39
40
45class ALBA_EXPORT albaWizard : albaObserver
46{
47public:
48
51
53 albaWizard(const wxString &label, const wxString &name="");
54
57
58
60 void SetMenuPath(wxString path);
61
63 wxString GetMenuPath();
64
66 wxString GetLabel();
67
69 wxString GetName();
70
72 virtual void SetParameters(void *param) {};
73
75 void ShowProgressBar(bool show=true){m_ShowProgressBar=show;};
76
78 bool GetShowProgressBar(){return m_ShowProgressBar;};
79
80protected:
82 virtual bool Accept(albaVME* vme);
83
85 void Execute();
86
88 void SetListener(albaObserver *Listener);
89
92
94 void SetId(int id);
95
97 int GetId();
98
102
104 virtual void OnEvent(albaEventBase *alba_event);
105
107 void ContinueExecution(int opSuccess);
108
111
113
114private:
115
117 void BlockExecutionBegin();
118
122 void BlockExecutionEnd();
123
125 void AbortWizard();
126
128 albaWizardBlock *GetBlockByName(const char *name);
129
130 std::vector <albaWizardBlock *> m_Blocks;
131 albaWizardBlock *m_CurrentBlock;
132 wxString m_MenuPath;
133 int m_Id;
134 wxString m_Label;
135 wxString m_Name;
136 albaVME *m_SelectedVME;
137 bool m_ShowProgressBar;
138
139 friend class albaWizardManager; // class albaWizardManager can now access data directly
140};
141#endif
#define EXPORT_STL_VECTOR(declspec_, T_)
Definition: albaDllMacros.h:84
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaVME -
Definition: albaVME.h:150
Class Name: albaWizardBlock.
Class Name: albaWizardManager.
Class Name: albaWizard.
Definition: albaWizard.h:46
void SetSelectedVME(albaVME *node)
Set the selected VME, this function must be called before execution begin.
void AddBlock(albaWizardBlock *block)
Add a new Block to the wizard Added blocks will be auto-deleted form the wizard.
void SetId(int id)
Set the wizard id.
int GetId()
Get the wizard id.
albaWizard()
Default constructor.
virtual void OnEvent(albaEventBase *alba_event)
Event management.
void ContinueExecution(int opSuccess)
Used to continue wizard execution after operation termination.
bool GetShowProgressBar()
Return true if progress bar show is enabled.
Definition: albaWizard.h:78
virtual void SetParameters(void *param)
Initialize wizard's variables according to the parameter's list.
Definition: albaWizard.h:72
albaObserver * m_Listener
Definition: albaWizard.h:112
albaWizard(const wxString &label, const wxString &name="")
Default constructor.
virtual bool Accept(albaVME *vme)
Return true for the acceptable vme type.
wxString GetMenuPath()
Sets the menu path.
void SetListener(albaObserver *Listener)
Sets The event listener.
void SetMenuPath(wxString path)
Sets the menu path.
albaString GetDescriptionTitle()
returns a description about current step in wizard
wxString GetLabel()
Return the Menu label of the wizard.
wxString GetName()
Return the name of the wizard.
void Execute()
Execute the wizard.
~albaWizard()
Default destructor.
void ShowProgressBar(bool show=true)
Enable/disable the visualization of the progress bar during the wizard.
Definition: albaWizard.h:75