Tome
A generic data editor for games supporting arbitrary input and output formats.
taskscontroller.h
1 #ifndef TASKSCONTROLLER_H
2 #define TASKSCONTROLLER_H
3 
4 #include <QList>
5 #include <QObject>
6 
7 #include "../Model/messagelist.h"
8 
9 
10 namespace Tome
11 {
12  class Task;
13 
14  class ComponentsController;
15  class FacetsController;
16  class FieldDefinitionsController;
17  class ProjectController;
18  class RecordsController;
19  class TypesController;
20 
24  class TasksController : public QObject
25  {
26  Q_OBJECT
27 
28  public:
38  TasksController(const ComponentsController& componentsController,
39  const FacetsController& facetsController,
40  const FieldDefinitionsController& fieldDefinitionsController,
41  const ProjectController& projectController,
42  const RecordsController& recordsController,
43  const TypesController& typesController);
44  ~TasksController();
45 
50  void addTask(Task* task);
51 
56  const MessageList runAllTasks() const;
57 
58  signals:
66  void progressChanged(const QString title, const QString text, const int currentValue, const int maximumValue) const;
67 
68  private:
69  QList<Task*> tasks;
70 
71  const ComponentsController& componentsController;
72  const FacetsController& facetsController;
73  const FieldDefinitionsController& fieldDefinitionsController;
74  const ProjectController& projectController;
75  const RecordsController& recordsController;
76  const TypesController& typesController;
77  };
78 }
79 
80 #endif // TASKSCONTROLLER_H
Definition: commandlineoptions.h:6
Controller for adding, updating and removing field definitions.
Definition: fielddefinitionscontroller.h:15
Controller for adding, updating and removing records.
Definition: recordscontroller.h:21
Controller for runnings tasks on all records.
Definition: taskscontroller.h:24
void progressChanged(const QString title, const QString text, const int currentValue, const int maximumValue) const
Progress of the current tasks operation has changed.
void addTask(Task *task)
Adds the specified task to the list of automated tasks that can be performed by this controller...
Definition: taskscontroller.cpp:37
Controller for adding and removing components.
Definition: componentscontroller.h:15
const MessageList runAllTasks() const
Runs all registered automated tasks.
Definition: taskscontroller.cpp:42
Controller for adding, updating and removing custom types.
Definition: typescontroller.h:14
Controller for validating type facets.
Definition: facetscontroller.h:16
Automated task that may result in a list of messages, warnings and errors.
Definition: task.h:14
Controller for creating, loading and saving projects.
Definition: projectcontroller.h:22
TasksController(const ComponentsController &componentsController, const FacetsController &facetsController, const FieldDefinitionsController &fieldDefinitionsController, const ProjectController &projectController, const RecordsController &recordsController, const TypesController &typesController)
Constructs a new controller for runnings tasks on all records.
Definition: taskscontroller.cpp:14