Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Interaction::CommandMode Class Reference
Inheritance diagram for Interaction::CommandMode:
Interaction::PromptMode

Public Member Functions

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

Private Member Functions

void addSuggestions (QList< CommandSuggestion * > suggestions)
 
void removeSuggestions ()
 
void showAutocompleteBasedOnSuggestions ()
 
void takeSuggestion (CommandSuggestion *suggestion)
 
void updateSuggestions ()
 

Private Attributes

PromptTextInputinputItem_ {}
 
std::vector< std::unique_ptr< CommandSuggestion > > suggestions_
 

Additional Inherited Members

- Public Types inherited from Interaction::PromptMode
enum  InputSelection { None , All , AtEnd }
 
- Protected Member Functions inherited from Interaction::PromptMode
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 Function Documentation

◆ addSuggestions()

void Interaction::CommandMode::addSuggestions ( QList< CommandSuggestion * >  suggestions)
private

◆ createInputItem()

Visualization::Item * Interaction::CommandMode::createInputItem ( const QString &  initialCommandText)
overridevirtual

◆ modeIcon()

Visualization::StaticStyle * Interaction::CommandMode::modeIcon ( ) const
overridevirtual

◆ onEnterKeyPress()

void Interaction::CommandMode::onEnterKeyPress ( Qt::KeyboardModifiers  modifiers)
overridevirtual

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

The default implementation does nothing.

Reimplemented from Interaction::PromptMode.

◆ onShellUpdate()

void Interaction::CommandMode::onShellUpdate ( )
overridevirtual

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 from Interaction::PromptMode.

◆ onTabKeyPress()

void Interaction::CommandMode::onTabKeyPress ( Qt::KeyboardModifiers  modifiers)
overridevirtual

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

The default implementaiton does nothing.

Reimplemented from Interaction::PromptMode.

◆ removeSuggestions()

void Interaction::CommandMode::removeSuggestions ( )
private

◆ setSelection()

void Interaction::CommandMode::setSelection ( InputSelection  selection)
overridevirtual

◆ showAutocompleteBasedOnSuggestions()

void Interaction::CommandMode::showAutocompleteBasedOnSuggestions ( )
private

◆ takeSuggestion()

void Interaction::CommandMode::takeSuggestion ( CommandSuggestion suggestion)
private

◆ updateSuggestions()

void Interaction::CommandMode::updateSuggestions ( )
private

Member Data Documentation

◆ inputItem_

PromptTextInput* Interaction::CommandMode::inputItem_ {}
private

◆ suggestions_

std::vector<std::unique_ptr<CommandSuggestion> > Interaction::CommandMode::suggestions_
private