CLI
2.9
|
Simple line user interface object. More...
#include <ui_line.h>
Public Member Functions | |
Line (const tk::String &TK_DefaultLine, const int I_MinLineLength, const int I_MaxLineLength) | |
Top execution context constructor. More... | |
Line (ExecutionContext &CLI_ParentContext, const tk::String &TK_DefaultLine, const int I_MinLineLength, const int I_MaxLineLength) | |
Child execution context constructor. More... | |
virtual | ~Line (void) |
Destructor. More... | |
const tk::String | GetLine (void) const |
Line retrieval. More... | |
virtual void | OnKey (const KEY E_KeyCode) |
Handler called on character input. More... | |
![]() | |
virtual | ~UI (void) |
Destructor. More... | |
const bool | GetbExecResult (void) const |
Execution result accessor. More... | |
![]() | |
virtual | ~ExecutionContext (void) |
Destructor. More... | |
ExecutionContextManager & | GetContextManager (void) |
Execution context manager accessor. More... | |
const IODevice & | GetInput (void) const |
Input stream accessor. More... | |
const OutputDevice & | GetStream (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... | |
![]() | |
virtual | ~Object (void)=0 |
Pure virtual destructor. More... | |
Protected Member Functions | |
void | SetLine (const tk::String &TK_Line, const bool B_NewLine, const bool B_CleanOnTyping) |
Protected line setter for child classes. More... | |
virtual void | Reset (void) |
Handler called when data reset is required. More... | |
virtual void | ResetToDefault (void) |
Handler called when default value is required to be restored. More... | |
![]() | |
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... | |
![]() | |
ExecutionContext (void) | |
Top context constructor. More... | |
ExecutionContext (ExecutionContext &CLI_ParentContext) | |
Child context constructor. More... | |
![]() | |
Object (void) | |
Default constructor only available to sub-classes. More... | |
|
explicit |
Top execution context constructor.
TK_DefaultLine | Default value. |
I_MinLineLength | Minimum line length required. -1 if not set. |
I_MaxLineLength | Maximum line length required. -1 if not set. |
Definition at line 39 of file ui_line.cpp.
Referenced by Line().
|
explicit |
Child execution context constructor.
CLI_ParentContext | Parent execution context. |
TK_DefaultLine | Default value. |
I_MinLineLength | Minimum line length required. -1 if not set. |
I_MaxLineLength | Maximum line length required. -1 if not set. |
Definition at line 46 of file ui_line.cpp.
References Line().
|
virtual |
Destructor.
Definition at line 53 of file ui_line.cpp.
const tk::String Line::GetLine | ( | void | ) | const |
Line retrieval.
Definition at line 58 of file ui_line.cpp.
References CmdLineEdition::GetLine().
Referenced by Choice::GetChoice(), Float::GetFloat(), and Int::GetInt().
|
virtual |
Handler called on character input.
E_KeyCode | Input key. |
Implements ExecutionContext.
Reimplemented in Choice, Float, Int, and YesNo.
Definition at line 86 of file ui_line.cpp.
References BACKSPACE, ExecutionContext::Beep(), BREAK, CmdLineEdition::CleanAll(), CLS, DELETE, CmdLineEdition::Delete(), ECHO_STREAM, CmdLineEdition::End(), UI::EndControl(), ENTER, ESCAPE, CmdLineEdition::GetLeft(), CmdLineEdition::GetLine(), CmdLineEdition::GetRight(), ExecutionContext::GetStream(), CmdLineEdition::Home(), KEY_BEGIN, KEY_END, KEY_LEFT, KEY_RIGHT, LOGOUT, CmdLineEdition::MoveCursor(), CmdLineEdition::NextLine(), NULL_KEY, and TAB.
Referenced by Float::OnKey(), Int::OnKey(), and Choice::OnKey().
|
protectedvirtual |
Handler called when data reset is required.
Implements UI.
Definition at line 76 of file ui_line.cpp.
References CmdLineEdition::Reset().
|
protectedvirtual |
Handler called when default value is required to be restored.
Implements UI.
Reimplemented in Choice, Float, and Int.
Definition at line 81 of file ui_line.cpp.
References SetLine().
Referenced by Float::ResetToDefault(), and Int::ResetToDefault().
|
protected |
Protected line setter for child classes.
TK_Line | Line to print out in place of the current line. |
B_NewLine | Move to a new line. |
B_CleanOnTyping | true when the line should be fully cleaned, false if the line can be modified. |
Definition at line 63 of file ui_line.cpp.
References CmdLineEdition::CleanAll(), ECHO_STREAM, ExecutionContext::GetStream(), CmdLineEdition::NextLine(), and CmdLineEdition::Put().
Referenced by Float::OnKey(), Int::OnKey(), Choice::OnKey(), Choice::ResetToDefault(), and ResetToDefault().