Tome
A generic data editor for games supporting arbitrary input and output formats.
controller.h
1 #ifndef CONTROLLER_H
2 #define CONTROLLER_H
3 
4 #include <QSharedPointer>
5 
6 class MainWindow;
7 
8 namespace Tome
9 {
10  class CommandLineOptions;
11  class ComponentsController;
12  class ExportController;
13  class FacetsController;
14  class FieldDefinitionsController;
15  class FindRecordController;
16  class FindUsagesController;
17  class ImportController;
18  class Project;
19  class ProjectController;
20  class RecordsController;
21  class SettingsController;
22  class TasksController;
23  class TypesController;
24  class UndoController;
25 
29  class Controller : QObject
30  {
31  Q_OBJECT
32 
33  public:
39  ~Controller();
40 
46 
52 
58 
64 
70 
76 
82 
88 
94 
100 
106 
112 
118 
123  int start();
124 
125  private slots:
126  void onProjectChanged(QSharedPointer<Tome::Project> project);
127 
128  private:
129  CommandLineOptions* options;
130 
131  ProjectController* projectController;
132  UndoController* undoController;
133  ComponentsController* componentsController;
134  TypesController* typesController;
135  FieldDefinitionsController* fieldDefinitionsController;
136  RecordsController* recordsController;
137  FacetsController* facetsController;
138  ExportController* exportController;
139  SettingsController* settingsController;
140  TasksController* tasksController;
141  FindUsagesController* findUsagesController;
142  FindRecordController* findRecordController;
143  ImportController* importController;
144 
145  MainWindow* mainWindow;
146  };
147 }
148 
149 #endif // CONTROLLER_H
Definition: commandlineoptions.h:6
Controller for adding, updating and removing field definitions.
Definition: fielddefinitionscontroller.h:15
Controller for exporting records using templates.
Definition: exportcontroller.h:20
TypesController & getTypesController() const
Gets the controller for adding, updating and removing custom types.
Definition: controller.cpp:171
Controller for adding, updating and removing records.
Definition: recordscontroller.h:21
Controller for finding usages of fields, records and custom types.
Definition: findusagescontroller.h:17
Controller for runnings tasks on all records.
Definition: taskscontroller.h:24
SettingsController & getSettingsController() const
Gets the controller for accessing user settings.
Definition: controller.cpp:161
RecordsController & getRecordsController() const
Gets the controller for adding, updating and removing records.
Definition: controller.cpp:151
Controller for accessing user settings.
Definition: settingscontroller.h:12
Controller for adding and removing components.
Definition: componentscontroller.h:15
Controller for adding, updating and removing custom types.
Definition: typescontroller.h:14
TasksController & getTasksController() const
Gets the controller for runnings tasks on all records.
Definition: controller.cpp:166
ComponentsController & getComponentsController() const
Gets the controller for adding and removing components.
Definition: controller.cpp:141
Utility class for parsing command-line options.
Definition: commandlineoptions.h:11
FacetsController & getFacetsController() const
Gets the controller for validating type facets.
Definition: controller.cpp:186
Controller for importing record data.
Definition: importcontroller.h:19
ProjectController & getProjectController() const
Gets the controller for creating, loading and saving projects.
Definition: controller.cpp:131
Controller for validating type facets.
Definition: facetscontroller.h:16
ExportController & getExportController() const
Gets the controller for exporting records using templates.
Definition: controller.cpp:156
Controller for performing undo-able commands.
Definition: undocontroller.h:13
Controller for creating, loading and saving projects.
Definition: projectcontroller.h:22
Controller(Tome::CommandLineOptions *options)
Constructs and sets up all controllers.
Definition: controller.cpp:55
Main controller of Tome. Sets up and owns all other controllers and views.
Definition: controller.h:29
FindRecordController & getFindRecordController() const
Gets the controller for finding specific records.
Definition: controller.cpp:181
ImportController & getImportController() const
Gets the controller for importing record data.
Definition: controller.cpp:191
int start()
Applies all command-line options and sets up the main window.
Definition: controller.cpp:196
Main view of Tome. Sets up and owns all other views.
Definition: mainwindow.h:44
UndoController & getUndoController() const
Gets the controller for performing undo-able commands.
Definition: controller.cpp:136
Controller for finding specific records.
Definition: findrecordcontroller.h:15
FieldDefinitionsController & getFieldDefinitionsController() const
Gets the controller for adding, updating and removing field definitions.
Definition: controller.cpp:146
FindUsagesController & getFindUsagesController() const
Gets the controller for finding usages of fields, records and custom types.
Definition: controller.cpp:176