CComposedStateControllerComp.h
Go to the documentation of this file.
1 #ifndef iwiz_CComposedStateControllerComp_included
2 #define iwiz_CComposedStateControllerComp_included
3 
4 
6 
8 
10 #include "iproc/IProcessor.h"
11 
12 
13 namespace iwiz
14 {
15 
16 
23  virtual public iproc::IStateController
24 {
25 public:
28 
29  I_BEGIN_COMPONENT(CComposedStateControllerComp);
30  I_REGISTER_INTERFACE(iproc::IStateController);
31  I_ASSIGN_MULTI_0(m_slaveControllersCompPtr, "SlaveControllers", "State controllers used to calculation general page state", false);
32  I_ASSIGN_TO(m_slaveControllerModelsCompPtr, m_slaveControllersCompPtr, false);
33  I_ASSIGN(m_processOnEnterCompPtr, "EnterProcessor", "Processor called on enter", false, "EnterProcessor");
34  I_ASSIGN(m_processOnLeaveCompPtr, "LeaveProcessor", "Processor called on exit", false, "LeaveProcessor");
35  I_END_COMPONENT;
36 
38 
39  // reimplemented (iproc::IStateController)
40  virtual bool IsStateEnabled() const;
41  virtual bool IsStateActive() const;
42  virtual bool IsEnterAllowed(bool isActionAllowed = true, const IStateController* prevStatePtr = NULL) const;
43  virtual bool IsLeaveAllowed(bool isActionAllowed = true, const IStateController* nextStatePtr = NULL) const;
44  virtual bool TryEnterState(bool isActionAllowed = true, const IStateController* prevStatePtr = NULL);
45  virtual bool TryLeaveState(bool isActionAllowed = true, const IStateController* nextStatePtr = NULL);
46  virtual bool IsResetAllowed() const;
47 
48 protected:
49  void UpdateAllMembers();
50 
51  // reimplemented (imod::CMultiModelDispatcherBase)
52  virtual void OnModelChanged(int modelId, int changeFlags, istd::IPolymorphic* updateParamsPtr);
53 
54  // reimplemented (icomp::CComponentBase)
55  virtual void OnComponentCreated();
56  virtual void OnComponentDestroyed();
57 
58 private:
59  bool m_isStateEnabled;
60  bool m_isStateActive;
61 
62  I_MULTIREF(iproc::IStateController, m_slaveControllersCompPtr);
63  I_MULTIREF(imod::IModel, m_slaveControllerModelsCompPtr);
64  I_REF(iproc::IProcessor, m_processOnEnterCompPtr);
65  I_REF(iproc::IProcessor, m_processOnLeaveCompPtr);
66 };
67 
68 
69 } // namespace iwiz
70 
71 
72 #endif // !iwiz_CComposedStateControllerComp_included
73 
74 
virtual bool TryEnterState(bool isActionAllowed=true, const IStateController *prevStatePtr=NULL)
Interface for a wizard page status info.
virtual bool IsStateEnabled() const
Check if state is enabled.
virtual bool TryLeaveState(bool isActionAllowed=true, const IStateController *nextStatePtr=NULL)
virtual bool IsResetAllowed() const
Check if reseting is allowed.
virtual bool IsLeaveAllowed(bool isActionAllowed=true, const IStateController *nextStatePtr=NULL) const
Component implementation of a wizard page.
virtual bool IsEnterAllowed(bool isActionAllowed=true, const IStateController *prevStatePtr=NULL) const
I_ASSIGN_TO(m_slaveControllerModelsCompPtr, m_slaveControllersCompPtr, false)
Interface for all synchrone and assynchrone processors with "push data" model.
Definition: IProcessor.h:24
virtual bool IsStateActive() const
Check if this state is active.
imod::CMultiModelDispatcherBase BaseClass2
virtual void OnModelChanged(int modelId, int changeFlags, istd::IPolymorphic *updateParamsPtr)

© 2007-2011 Witold Gantzke and Kirill Lepskiy