Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Protected Member Functions
Interaction::PromptMode Class Referenceabstract
Inheritance diagram for Interaction::PromptMode:
InformationScripting::QueryPromptMode Interaction::CommandMode

Public Types

enum  InputSelection { None , All , AtEnd }
 

Public Member Functions

virtual ~PromptMode ()
 
virtual Visualization::ItemcreateInputItem (const QString &initialCommandText)=0
 
virtual Visualization::StaticStylemodeIcon () const =0
 
virtual void onEnterKeyPress (Qt::KeyboardModifiers modifiers)
 Called when the handler of the prompt's shell detects and enter key press. More...
 
virtual void onShellUpdate ()
 Called whenever the Prompt shell is about to be updated and repainted. More...
 
virtual void onTabKeyPress (Qt::KeyboardModifiers modifiers)
 Called when the handler of the prompt's shell detects a TAB key press. More...
 
virtual void setSelection (InputSelection selection)=0
 

Protected Member Functions

void showErrors (QList< QString > errorMessages, Qt::TextFormat format=Qt::PlainText) const
 Call this method from derived classes in order to display a list of errors messages under the prompt. More...
 
void showErrors (QList< Visualization::Item * > errorItems) const
 Call this method from derived classes in order to display a list of error item under the prompt. More...
 

Member Enumeration Documentation

◆ InputSelection

Enumerator
None 

The input will not be selected.

All 

The entire input will be selected, so that it can be quickly deleted/replaced.

AtEnd 

The input should have a cursor at the end, ready for additional input.

Constructor & Destructor Documentation

◆ ~PromptMode()

Interaction::PromptMode::~PromptMode ( )
virtual

Member Function Documentation

◆ createInputItem()

virtual Visualization::Item* Interaction::PromptMode::createInputItem ( const QString &  initialCommandText)
pure virtual

◆ modeIcon()

virtual Visualization::StaticStyle* Interaction::PromptMode::modeIcon ( ) const
pure virtual

◆ onEnterKeyPress()

void Interaction::PromptMode::onEnterKeyPress ( Qt::KeyboardModifiers  modifiers)
virtual

Called when the handler of the prompt's shell detects and enter key press.

The default implementation does nothing.

Reimplemented in Interaction::CommandMode, and InformationScripting::QueryPromptMode.

◆ onShellUpdate()

void Interaction::PromptMode::onShellUpdate ( )
virtual

Called whenever the Prompt shell is about to be updated and repainted.

The default implementation does nothing. Reimplement this in modes which need to update their state when the shell is updated. For example to provide auto-completion based on the latest input.

Reimplemented in Interaction::CommandMode.

◆ onTabKeyPress()

void Interaction::PromptMode::onTabKeyPress ( Qt::KeyboardModifiers  modifiers)
virtual

Called when the handler of the prompt's shell detects a TAB key press.

The default implementaiton does nothing.

Reimplemented in Interaction::CommandMode.

◆ setSelection()

virtual void Interaction::PromptMode::setSelection ( InputSelection  selection)
pure virtual

◆ showErrors() [1/2]

void Interaction::PromptMode::showErrors ( QList< QString >  errorMessages,
Qt::TextFormat  format = Qt::PlainText 
) const
protected

Call this method from derived classes in order to display a list of errors messages under the prompt.

◆ showErrors() [2/2]

void Interaction::PromptMode::showErrors ( QList< Visualization::Item * >  errorItems) const
protected

Call this method from derived classes in order to display a list of error item under the prompt.

Ownership of the passed items will be transfered to the Prompt shell.