Tome
A generic data editor for games supporting arbitrary input and output formats.
derivedtypewindow.h
1 #ifndef DERIVEDTYPEWINDOW_H
2 #define DERIVEDTYPEWINDOW_H
3 
4 #include <QDialog>
5 
6 namespace Ui {
7  class DerivedTypeWindow;
8 }
9 
10 namespace Tome
11 {
12  class TypesController;
13  class FacetsController;
14  class RecordsController;
15 }
16 
20 class DerivedTypeWindow : public QDialog
21 {
22  Q_OBJECT
23 
24  public:
32  explicit DerivedTypeWindow(
33  Tome::TypesController& typesController,
34  Tome::FacetsController& facetsController,
35  Tome::RecordsController& recordsController,
36  QWidget *parent = 0);
38 
43  QString getBaseType() const;
44 
49  QVariantMap getFacets() const;
50 
55  QString getTypeName() const;
56 
61  QString getTypeSetName() const;
62 
66  void init();
67 
72  void setBaseType(const QString& baseType) const;
73 
78  void setFacets(const QVariantMap& facets);
79 
84  void setTypeName(const QString& typeName);
85 
90  void setTypeSetName(const QString& typeSetName);
91 
96  void setTypeSetNames(const QStringList& typeSetNames);
97 
98  public slots:
102  void accept() Q_DECL_OVERRIDE;
103 
104  protected:
109  virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
110 
111  private slots:
112  void on_comboBoxBaseType_currentIndexChanged(const QString &arg1);
113 
114  private:
115  static const int FacetFormRow;
116 
117  Ui::DerivedTypeWindow *ui;
118 
119  Tome::TypesController& typesController;
120  Tome::FacetsController& facetsController;
121  Tome::RecordsController& recordsController;
122 
123  QList<QWidget*> facetWidgets;
124 
125  bool validate();
126 };
127 
128 #endif // DERIVEDTYPEWINDOW_H
Definition: commandlineoptions.h:6
Controller for adding, updating and removing records.
Definition: recordscontroller.h:21
Definition: mainwindow.h:25
Controller for adding, updating and removing custom types.
Definition: typescontroller.h:14
Controller for validating type facets.
Definition: facetscontroller.h:16
Window for adding a new derived type or editing an existing one.
Definition: derivedtypewindow.h:20