CLI  2.9
UI Class Referenceabstract

Generic user interface class. More...

#include <ui.h>

Inheritance diagram for UI:

Public Member Functions

virtual ~UI (void)
 Destructor. More...
 
const bool GetbExecResult (void) const
 Execution result accessor. More...
 
- Public Member Functions inherited from ExecutionContext
virtual ~ExecutionContext (void)
 Destructor. More...
 
ExecutionContextManagerGetContextManager (void)
 Execution context manager accessor. More...
 
const IODeviceGetInput (void) const
 Input stream accessor. More...
 
const OutputDeviceGetStream (const STREAM_TYPE E_StreamType) const
 Output stream accessor. More...
 
const bool SetStream (const STREAM_TYPE E_StreamType, OutputDevice &CLI_Stream)
 Output stream positionning. More...
 
const bool StreamEnabled (const STREAM_TYPE E_StreamType) const
 Enabled/disabled stream accessor. More...
 
const bool EnableStream (const STREAM_TYPE E_StreamType, const bool B_Enable)
 Enable/disable stream. More...
 
void SetLang (const ResourceString::LANG E_Lang)
 Language setting. More...
 
const ResourceString::LANG GetLang (void) const
 Language access. More...
 
void SetBeep (const bool B_Enable)
 Beep configuration setting. More...
 
const bool GetBeep (void) const
 Beep configuration access. More...
 
void Beep (void)
 Sends a beep signal. More...
 
void Run (IODevice &CLI_IODevice)
 Runs the execution context onto the corresponding input/output device. More...
 
void Run (void)
 Runs the execution context as a child context of the parent given by the construction. More...
 
const bool IsRunning (void) const
 Tells whether this execution context is running or not. More...
 
void StopExecution (void)
 Terminates this execution context's execution. More...
 
void StopAllExecutions (void)
 Terminates execution for all execution contexts attached to the same top execution context. More...
 
- Public Member Functions inherited from Object
virtual ~Object (void)=0
 Pure virtual destructor. More...
 

Protected Member Functions

 UI (void)
 Top execution context constructor. More...
 
 UI (ExecutionContext &CLI_ExecutionContext)
 Child execution context constructor. More...
 
virtual const bool OnStartExecution (void)
 Beginning of execution handler. More...
 
virtual const bool OnStopExecution (void)
 Execution termination handler. More...
 
void EndControl (const bool B_ExecResult)
 Method to call by child classes in order to end the control execution. More...
 
virtual void Reset (void)=0
 Handler called when data reset is required. More...
 
virtual void ResetToDefault (void)=0
 Handler called when default value is required to be restored. More...
 
- Protected Member Functions inherited from ExecutionContext
 ExecutionContext (void)
 Top context constructor. More...
 
 ExecutionContext (ExecutionContext &CLI_ParentContext)
 Child context constructor. More...
 
virtual void OnKey (const KEY E_KeyCode)=0
 Handler called on character input. More...
 
- Protected Member Functions inherited from Object
 Object (void)
 Default constructor only available to sub-classes. More...
 

Detailed Description

Generic user interface class.

Definition at line 60 of file ui.h.

Constructor & Destructor Documentation

◆ UI() [1/2]

UI::UI ( void  )
explicitprotected

Top execution context constructor.

Definition at line 39 of file ui.cpp.

◆ UI() [2/2]

UI::UI ( ExecutionContext CLI_ExecutionContext)
explicitprotected

Child execution context constructor.

Parameters
CLI_ExecutionContextParent execution context.

Definition at line 44 of file ui.cpp.

◆ ~UI()

UI::~UI ( void  )
virtual

Destructor.

Definition at line 49 of file ui.cpp.

Member Function Documentation

◆ EndControl()

void UI::EndControl ( const bool  B_ExecResult)
protected

Method to call by child classes in order to end the control execution.

Parameters
B_ExecResultExecution result, true for success, false otherwise.

Definition at line 79 of file ui.cpp.

References ExecutionContext::StopExecution().

Referenced by Float::OnKey(), Int::OnKey(), Choice::OnKey(), Password::OnKey(), and Line::OnKey().

◆ GetbExecResult()

const bool UI::GetbExecResult ( void  ) const

Execution result accessor.

Returns
Execution result: true for a regular output, false for an error or a cancellation.

Definition at line 53 of file ui.cpp.

◆ OnStartExecution()

const bool UI::OnStartExecution ( void  )
protectedvirtual

Beginning of execution handler.

Returns
true for success, false otherwise.

Implements ExecutionContext.

Definition at line 58 of file ui.cpp.

References Reset(), and ResetToDefault().

◆ OnStopExecution()

const bool UI::OnStopExecution ( void  )
protectedvirtual

Execution termination handler.

Returns
true for success, false otherwise.

Implements ExecutionContext.

Definition at line 67 of file ui.cpp.

References ECHO_STREAM, endl, ExecutionContext::GetStream(), and ResetToDefault().

◆ Reset()

virtual void UI::Reset ( void  )
protectedpure virtual

Handler called when data reset is required.

Implemented in Line, Less, More, and Password.

Referenced by OnStartExecution().

◆ ResetToDefault()

virtual void UI::ResetToDefault ( void  )
protectedpure virtual

Handler called when default value is required to be restored.

Implemented in Line, Less, More, Password, Choice, Float, and Int.

Referenced by OnStartExecution(), and OnStopExecution().


The documentation for this class was generated from the following files: