]> git.sven.stormbind.net Git - sven/vym.git/blob - attributedialog.h
b56cf8012b05a6ee03eea1f7dd215a0e6fcc45aa
[sven/vym.git] / attributedialog.h
1 #ifndef ATTRIBUTEDIALOG_H
2 #define ATTRIBUTEDIALOG_H
3
4 #include "attribute.h"
5 #include "branchobj.h"
6
7 #include <QDialog>
8 #include <QCloseEvent>
9 #include <QtGui/QHBoxLayout>
10 #include <QtGui/QPushButton>
11 #include <QtGui/QSpacerItem>
12 #include <QtGui/QVBoxLayout>
13
14
15 /*! \brief Set the dialog mode  */
16 enum AttributeDialogMode {
17     Definition, //!< Edit attribute definitions (AttributeDef)
18     Object      //!< Edit attributes of OrnamentedObj
19 };
20
21 class AttributeDialog:public QDialog
22 {
23     Q_OBJECT 
24 public:
25     AttributeDialog (QWidget *parent=0 );
26     void setTable (AttributeTable *table=0);
27     void setBranch (BranchObj *bo);
28     void setMode (const AttributeDialogMode &m);
29     void updateTable();
30 signals:
31     void windowClosed();
32 private slots:
33     void addKey();
34 protected:
35     void closeEvent(QCloseEvent*);
36 private:
37     QVBoxLayout *vboxLayout;
38     QVBoxLayout *tableLayout;
39     QHBoxLayout *hboxLayout;
40     QPushButton *addButton;
41     QSpacerItem *spacerItem;
42     QPushButton *closeButton;
43
44     AttributeDialogMode mode;
45     AttributeTable *table;
46     BranchObj *branch;
47 };
48
49 #endif