Tome
A generic data editor for games supporting arbitrary input and output formats.
fieldvaluewindow.h
1 #ifndef FIELDVALUEWINDOW_H
2 #define FIELDVALUEWINDOW_H
3 
4 #include <QDialog>
5 #include <QVariantMap>
6 
7 namespace Ui {
8  class FieldValueWindow;
9 }
10 
11 namespace Tome
12 {
13  class CustomType;
14  class Facet;
15  class FieldValueWidget;
16  class FacetsController;
17  class ProjectController;
18  class RecordsController;
19  class TypesController;
20 }
21 
25 class FieldValueWindow : public QDialog
26 {
27  Q_OBJECT
28 
29  public:
38  explicit FieldValueWindow(Tome::FacetsController& facetsController,
39  Tome::ProjectController& projectController,
40  Tome::RecordsController& recordsController,
41  Tome::TypesController& typesController,
42  QWidget* parent = 0);
44 
49  QVariant getFieldValue() const;
50 
55  void setFieldCount(const int fieldCount);
56 
61  void setFieldDescription(const QString& description);
62 
67  void setFieldDisplayName(const QString& displayName);
68 
73  void setFieldValue(const QVariant& fieldValue);
74 
79  void setFieldType(const QString& fieldType) const;
80 
81  public slots:
85  void accept() Q_DECL_OVERRIDE;
86 
87  signals:
91  void revert();
92 
93  protected:
98  virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
99 
100  private slots:
101  void on_toolButtonRevert_clicked();
102 
103  private:
104  Ui::FieldValueWindow *ui;
105  Tome::FieldValueWidget* fieldValueWidget;
106 
107  Tome::FacetsController& facetsController;
108  Tome::ProjectController& projectController;
109  Tome::RecordsController& recordsController;
110  Tome::TypesController& typesController;
111 };
112 
113 #endif // FIELDVALUEWINDOW_H
Definition: commandlineoptions.h:6
Controller for adding, updating and removing records.
Definition: recordscontroller.h:21
Definition: mainwindow.h:25
Changes its appearance depending on the specified type.
Definition: fieldvaluewidget.h:35
Controller for adding, updating and removing custom types.
Definition: typescontroller.h:14
Window for editing the value of a record field.
Definition: fieldvaluewindow.h:25
Controller for validating type facets.
Definition: facetscontroller.h:16
Controller for creating, loading and saving projects.
Definition: projectcontroller.h:22