Tome
A generic data editor for games supporting arbitrary input and output formats.
findusagescontroller.h
1 #ifndef FINDUSAGESCONTROLLER_H
2 #define FINDUSAGESCONTROLLER_H
3 
4 #include <QObject>
5 
6 #include "../Model/searchresultlist.h"
7 
8 namespace Tome
9 {
10  class FieldDefinitionsController;
11  class RecordsController;
12  class TypesController;
13 
17  class FindUsagesController : public QObject
18  {
19  Q_OBJECT
20 
21  public:
28  FindUsagesController(const FieldDefinitionsController& fieldDefinitionsController,
29  const RecordsController& recordsController,
30  const TypesController& typesController);
31 
37  const SearchResultList findUsagesOfField(const QString& fieldId) const;
38 
44  const SearchResultList findUsagesOfRecord(const QVariant& recordId) const;
45 
51  const SearchResultList findUsagesOfType(const QString& typeName) const;
52 
53  signals:
61  void progressChanged(const QString title, const QString text, const int currentValue, const int maximumValue) const;
62 
68  void searchResultChanged(const QString& title, const Tome::SearchResultList results) const;
69 
70  private:
71  const FieldDefinitionsController& fieldDefinitionsController;
72  const RecordsController& recordsController;
73  const TypesController& typesController;
74  };
75 }
76 
77 #endif // FINDUSAGESCONTROLLER_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 finding usages of fields, records and custom types.
Definition: findusagescontroller.h:17
void progressChanged(const QString title, const QString text, const int currentValue, const int maximumValue) const
Progress of the current search operation has changed.
void searchResultChanged(const QString &title, const Tome::SearchResultList results) const
A search has been completed.
const SearchResultList findUsagesOfType(const QString &typeName) const
Searches for records whose fields are of the type with the specified name.
Definition: findusagescontroller.cpp:108
Controller for adding, updating and removing custom types.
Definition: typescontroller.h:14
FindUsagesController(const FieldDefinitionsController &fieldDefinitionsController, const RecordsController &recordsController, const TypesController &typesController)
Constructs a new controller for finding usages of fields, records and custom types.
Definition: findusagescontroller.cpp:11
const SearchResultList findUsagesOfField(const QString &fieldId) const
Searches for records who are using the field with the specified id.
Definition: findusagescontroller.cpp:18
const SearchResultList findUsagesOfRecord(const QVariant &recordId) const
Searches for records whose field values are referencing the record with the specified id...
Definition: findusagescontroller.cpp:62