KoMo2  1.0.0
A modern ARM emulator GUI.
CompileLoadModel.h
Go to the documentation of this file.
1 
9 #include <gtkmm/button.h>
10 #include <gtkmm/filechooserdialog.h>
11 #include <string>
12 #include "Model.h"
13 
14 class CompileLoadView;
15 
20 enum class CompileLoadInnerState : int {
21  FILE_SELECTED = 0, // A file has been selected.
22  NO_FILE // No file has been selected.
23 };
24 
32 class CompileLoadModel : private Model {
33  public:
34  CompileLoadModel(CompileLoadView* const view, KoMo2Model* const parent);
35  virtual void changeJimulatorState(const JimulatorState newState) override;
36  virtual const bool handleKeyPress(const GdkEventKey* const e) override;
37 
38  private:
43 
48 
54 
55  // ! Getters and setters
56  // Inner state
57  const CompileLoadInnerState getInnerState() const;
58  void setInnerState(const CompileLoadInnerState newState);
59 
60  // absolute path to selected file
61  const std::string getAbsolutePathToSelectedFile() const;
62  void setAbsolutePathToSelectedFile(const std::string val);
63 
64  // ! General functions
65  void onBrowseClick();
66  void onCompileLoadClick() const;
67  const std::string makeKmdPath(const std::string absolutePath) const;
68  void handleResultFromFileBrowser(const int result,
69  const Gtk::FileChooserDialog* const dialog);
70 
71  // ! Deleted special member functions
72  // stops these functions from being misused, creates a sensible error
73  CompileLoadModel(const CompileLoadModel&) = delete;
74  CompileLoadModel(const CompileLoadModel&&) = delete;
75  CompileLoadModel& operator=(const CompileLoadModel&) = delete;
76  CompileLoadModel& operator=(const CompileLoadModel&&) = delete;
77 };
CompileLoadInnerState
An enum indicating the state of the specific compile and load section of the GUI - specifically...
A file containing the declaration of the class Model and the enumerable type JimulatorState.
JimulatorState
Describe the 5 states of Jimulator.
Definition: Model.h:19
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
CompileLoadInnerState innerState
Stores the state of the compile and load section of the GUI.
The logical model of the entire application. All other models should be member variables of this mode...
Definition: KoMo2Model.h:34
the class definition of the compileLoadModel class, a data model which encapsulates any statefullness...
std::string absolutePathToSelectedFile
State - stores the value of the absolute file path to a .s file, as chosen by the file browser compon...
CompileLoadView *const view
A pointer to the view that this model represents.
This class represents the visual aspects that make up the compile & load section of the KoMo2 GUI...