Tome
A generic data editor for games supporting arbitrary input and output formats.
recordfieldstablewidget.h
1 #ifndef RECORDFIELDSTABLEWIDGET_H
2 #define RECORDFIELDSTABLEWIDGET_H
3 
4 #include <QTableWidget>
5 
6 namespace Tome
7 {
8  class FacetsController;
9  class FieldDefinition;
10  class FieldDefinitionsController;
11  class ProjectController;
12  class RecordsController;
13  class TypesController;
14 
18  class RecordFieldsTableWidget : public QTableWidget
19  {
20  Q_OBJECT
21 
22  public:
31  RecordFieldsTableWidget(FieldDefinitionsController& fieldDefinitionsController,
32  FacetsController& facetsController,
33  ProjectController& projectController,
34  RecordsController& recordsController,
35  TypesController& typesController);
36 
41  void setDescriptionColumnEnabled(bool enabled);
42 
47  void setRecord(const QVariant recordId);
48 
53  void setShowComponentNames(bool showComponentNames);
54 
59  void updateFieldValue(int i);
60 
61  signals:
66  void fileLinkActivated(const QString& filePath);
67 
72  void recordLinkActivated(const QString& recordId);
73 
74  private:
75  FacetsController& facetsController;
76  FieldDefinitionsController& fieldDefinitionsController;
77  ProjectController& projectController;
78  RecordsController& recordsController;
79  TypesController& typesController;
80 
81  QVariant recordId;
82  bool showComponentNames;
83 
84  const QString getFieldKeyString(const FieldDefinition& field);
85 
86  private slots:
87  void onFileLinkActivated(const QString& filePath);
88  void onRecordLinkActivated(const QString& recordId);
89  };
90 }
91 
92 #endif // RECORDFIELDSTABLEWIDGET_H
Definition: commandlineoptions.h:6
Controller for adding, updating and removing field definitions.
Definition: fielddefinitionscontroller.h:15
Allows editing the values of all fields of a record.
Definition: recordfieldstablewidget.h:18
Controller for adding, updating and removing records.
Definition: recordscontroller.h:21
void fileLinkActivated(const QString &filePath)
A link to a file on disk has been activated.
void updateFieldValue(int i)
Updates the specified row of this record field table.
Definition: recordfieldstablewidget.cpp:119
Field that can be added to a record to hold data.
Definition: fielddefinition.h:15
Controller for adding, updating and removing custom types.
Definition: typescontroller.h:14
void setDescriptionColumnEnabled(bool enabled)
Sets whether to show an additional column with the description of all record fields, or not.
Definition: recordfieldstablewidget.cpp:48
RecordFieldsTableWidget(FieldDefinitionsController &fieldDefinitionsController, FacetsController &facetsController, ProjectController &projectController, RecordsController &recordsController, TypesController &typesController)
Constructs a new widget for editing the values of all fields of a record.
Definition: recordfieldstablewidget.cpp:28
Controller for validating type facets.
Definition: facetscontroller.h:16
Controller for creating, loading and saving projects.
Definition: projectcontroller.h:22
void setShowComponentNames(bool showComponentNames)
Sets whether to show the names of the respective component in front of the field name, or not.
Definition: recordfieldstablewidget.cpp:114
void recordLinkActivated(const QString &recordId)
A link to another Tome record has been activated.
void setRecord(const QVariant recordId)
Sets the record to edit the field values of.
Definition: recordfieldstablewidget.cpp:64