KoMo2  1.0.0
A modern ARM emulator GUI.
TerminalModel.h
Go to the documentation of this file.
1 
11 #include "RegistersModel.h"
12 
13 class TerminalView;
14 
19 class TerminalModel : private Model {
20  public:
22  void appendTextToTextView(std::string text);
23  const std::string readJimulator() const;
24 
25  // ! Overriden virtual member functions
26 
27  virtual void changeJimulatorState(const JimulatorState newState) override;
28  virtual const bool handleKeyPress(const GdkEventKey* const e) override;
29 
30  // ! Getters and setters
31 
32  TerminalView* const getView() const;
33 
34  private:
39 
40  const bool isFocused();
41  void onClearClick();
42 
43  // ! Deleted special member functions
44  // stops these functions from being misused, creates a sensible error
45  TerminalModel(const TerminalModel&) = delete;
46  TerminalModel(const TerminalModel&&) = delete;
47  TerminalModel& operator=(const TerminalModel&) = delete;
48  TerminalModel& operator=(const TerminalModel&&) = delete;
49 };
This file declares the class RegistersModel, which represents the logical data in memory that relates...
Represents any data or functions related to the information, or manipulation of the information...
Definition: TerminalModel.h:19
TerminalView *const getView() const
Gets a pointer to the view object.
void onClearClick()
Handles the clear button being clicked.
KoMo2Model *const parent
All models have a parent model - KoMo2Model, the most senior model in the hierarchy, sets its parent to self.
Definition: Model.h:87
const std::string readJimulator() const
Reads for any data from Jimulator.
JimulatorState
Describe the 5 states of Jimulator.
Definition: Model.h:19
void appendTextToTextView(std::string text)
Appends a string to the current text view of the terminal, and scroll to the bottom of the terminal...
virtual void changeJimulatorState(const JimulatorState newState) override
Handles the internal state of Jimulator being changed.
The superclass for all other Model classes. Uses a pure virtual function, so is abastract. Keeps KoMo2Model as a friend so it alone can call setJimulatorState. This class provides basic data that are needed by all other.
Definition: Model.h:35
virtual const bool handleKeyPress(const GdkEventKey *const e) override
Handles any key press events.
TerminalView *const view
The view this model represents.
Definition: TerminalModel.h:38
const bool isFocused()
Returns whether or not the input box has focus or not.
The logical model of the entire application. All other models should be member variables of this mode...
Definition: KoMo2Model.h:34
The GUI element which encapsulates the "clear" button, the output text box, and the input text box at...
Definition: TerminalView.h:25
TerminalModel(TerminalView *const view, KoMo2Model *const parent)
Construct a new TerminalModel::TerminalModel object.