Tome
A generic data editor for games supporting arbitrary input and output formats.
mapitemwindow.h
1 #ifndef MAPITEMWINDOW_H
2 #define MAPITEMWINDOW_H
3 
4 #include <QDialog>
5 
6 namespace Ui {
7  class MapItemWindow;
8 }
9 
10 namespace Tome
11 {
12  class FieldValueWidget;
13  class FacetsController;
14  class ProjectController;
15  class RecordsController;
16  class TypesController;
17 }
18 
22 class MapItemWindow : public QDialog
23 {
24  Q_OBJECT
25 
26  public:
35  explicit MapItemWindow(Tome::FacetsController& facetsController,
36  Tome::ProjectController& projectController,
37  Tome::RecordsController& recordsController,
38  Tome::TypesController& typesController,
39  QWidget *parent = 0);
40  ~MapItemWindow();
41 
46  QVariant getKey() const;
47 
52  QVariant getValue() const;
53 
58  void setKey(const QVariant& key);
59 
64  void setKeyType(const QString& keyType) const;
65 
70  void setValue(const QVariant& value);
71 
76  void setValueType(const QString& valueType) const;
77 
78  public slots:
82  void accept() Q_DECL_OVERRIDE;
83 
84  protected:
89  virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
90 
91  private:
92  Ui::MapItemWindow *ui;
93  Tome::FieldValueWidget* keyWidget;
94  Tome::FieldValueWidget* valueWidget;
95 
96  Tome::FacetsController& facetsController;
97  Tome::ProjectController& projectController;
98  Tome::RecordsController& recordsController;
99  Tome::TypesController& typesController;
100 
101  bool validate();
102 };
103 
104 #endif // MAPITEMWINDOW_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 a single key-value pair of the map.
Definition: mapitemwindow.h:22
Controller for validating type facets.
Definition: facetscontroller.h:16
Controller for creating, loading and saving projects.
Definition: projectcontroller.h:22