KoMo2  1.0.0
A modern ARM emulator GUI.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TerminalModel Class Reference

Represents any data or functions related to the information, or manipulation of the information, within the terminal view. More...

#include <TerminalModel.h>

Inheritance diagram for TerminalModel:
Model

Public Member Functions

 TerminalModel (TerminalView *const view, KoMo2Model *const parent)
 Construct a new TerminalModel::TerminalModel object. More...
 
void appendTextToTextView (std::string text)
 Appends a string to the current text view of the terminal, and scroll to the bottom of the terminal. More...
 
const std::string readJimulator () const
 Reads for any data from Jimulator. More...
 
virtual void changeJimulatorState (const JimulatorState newState) override
 Handles the internal state of Jimulator being changed. More...
 
virtual const bool handleKeyPress (const GdkEventKey *const e) override
 Handles any key press events. More...
 
TerminalView *const getView () const
 Gets a pointer to the view object. More...
 

Private Member Functions

const bool isFocused ()
 Returns whether or not the input box has focus or not. More...
 
void onClearClick ()
 Handles the clear button being clicked.
 
 TerminalModel (const TerminalModel &)=delete
 
 TerminalModel (const TerminalModel &&)=delete
 
TerminalModeloperator= (const TerminalModel &)=delete
 
TerminalModeloperator= (const TerminalModel &&)=delete
 
- Private Member Functions inherited from Model
 Model (KoMo2Model *const parent)
 Constructs a new Model object - just assigns the parent variable. More...
 
KoMo2Model *const getParent () const
 Returns the parent pointer. More...
 
template<class T1 , class T2 >
void setButtonListener (Gtk::Button *const button, const T1 b, const T2 c)
 Connect any button to any member function of. More...
 
void setButtonState (Gtk::Button *const button, const bool state, Gtk::Image *const img=nullptr, const std::string newTooltip="", const std::string newLabelText="") const
 Sets the state of a button to some boolean - the assumption is that if a button is not meant to be sensitive (get_sensitive() == false) then it should also not have a tooltip or many other attributes. You can also optionally update the buttons image, tooltip text, and label text. More...
 
JimulatorState getJimulatorState () const
 Return the jimulatorState member object. More...
 

Private Attributes

TerminalView *const view
 The view this model represents.
 

Detailed Description

Represents any data or functions related to the information, or manipulation of the information, within the terminal view.

Definition at line 19 of file TerminalModel.h.

Constructor & Destructor Documentation

TerminalModel::TerminalModel ( TerminalView *const  view,
KoMo2Model *const  parent 
)

Construct a new TerminalModel::TerminalModel object.

Parameters
viewA constant pointer to the related view.
parentA constant pointer to the parent model.

Definition at line 21 of file TerminalModel.cpp.

Member Function Documentation

void TerminalModel::appendTextToTextView ( std::string  text)

Appends a string to the current text view of the terminal, and scroll to the bottom of the terminal.

Parameters
textThe text to append to the text view.

Definition at line 78 of file TerminalModel.cpp.

void TerminalModel::changeJimulatorState ( const JimulatorState  newState)
overridevirtual

Handles the internal state of Jimulator being changed.

Parameters
newState

Implements Model.

Definition at line 31 of file TerminalModel.cpp.

TerminalView *const TerminalModel::getView ( ) const

Gets a pointer to the view object.

Returns
TerminalView* const

Definition at line 118 of file TerminalModel.cpp.

const bool TerminalModel::handleKeyPress ( const GdkEventKey *const  e)
overridevirtual

Handles any key press events.

Parameters
eThe key press event.
Returns
bool true if the key press was handled.

Implements Model.

Definition at line 50 of file TerminalModel.cpp.

const bool TerminalModel::isFocused ( )
private

Returns whether or not the input box has focus or not.

Returns
true If the input box has focus.
false If the input box does not have focus.

Definition at line 108 of file TerminalModel.cpp.

const std::string TerminalModel::readJimulator ( ) const

Reads for any data from Jimulator.

Returns
const std::string the data read from Jimulator.

Definition at line 99 of file TerminalModel.cpp.


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