Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
propertiesdialog.h
Go to the documentation of this file.
1 
8 #ifndef PROPERTIESDIALOG_H_
9 #define PROPERTIESDIALOG_H_
10 
11 #include "ui_propertiesdialog.h"
12 #include "ui_documentproperties.h"
13 #include "ui_sheetproperties.h"
14 #include "ui_staffproperties.h"
15 #include "ui_voiceproperties.h"
18 
19 class QTreeWidgetItem;
20 
21 class CADocument;
22 class CASheet;
23 class CAStaff;
24 class CAContext;
25 class CAVoice;
26 class CALyricsContext;
28 
30  Q_OBJECT
31 public:
32  CADocumentProperties( CADocument *doc, QWidget *parent=0 ) : QWidget( parent ) { _document = doc; setupUi(this); }
33 public slots:
35 private:
37 };
38 
40 public:
41  CASheetProperties( QWidget *parent=0 ) : QWidget( parent ) { setupUi(this); }
42 };
43 
45 public:
46  CAStaffProperties( QWidget *parent=0 ) : QWidget( parent ) { setupUi(this); }
47 };
48 
50 public:
51  CAVoiceProperties( QWidget *parent=0 ) : QWidget( parent ) { setupUi(this); }
52 };
53 
55 public:
56  CALyricsContextProperties( QWidget *parent=0 ) : QWidget( parent ) { setupUi(this); }
57 };
58 
60 public:
61  CAFunctionMarkContextProperties( QWidget *parent=0 ) : QWidget( parent ) { setupUi(this); }
62 };
63 
65 {
66  Q_OBJECT
67 public:
68  CAPropertiesDialog( CADocument *doc, QWidget *parent=0 );
69  virtual ~CAPropertiesDialog();
70  static void documentProperties( CADocument *doc, QWidget *parent );
71  static void sheetProperties( CASheet *sheet, QWidget *parent );
72  static void contextProperties( CAContext *context, QWidget *parent );
73  static void voiceProperties( CAVoice *voice, QWidget *parent );
74 
75  inline CADocument *document() { return _document; }
76  inline QTreeWidgetItem *documentItem() { return _documentItem; }
77  inline QHash< QTreeWidgetItem*, CASheet* >& sheetItem() { return _sheetItem; }
78  inline QHash< QTreeWidgetItem*, CAContext* >& contextItem() { return _contextItem; }
79  inline QHash< QTreeWidgetItem*, CAVoice* >& voiceItem() { return _voiceItem; }
80 
81 public slots:
82  void on_uiDocumentTree_currentItemChanged( QTreeWidgetItem *cur, QTreeWidgetItem *prev );
83  void on_uiButtonBox_clicked( QAbstractButton* );
84  void on_uiUp_clicked( bool );
85  void on_uiDown_clicked( bool );
86 
87 private:
88  void buildTree();
89 
90  void applyProperties();
98 
100  QTreeWidgetItem *_documentItem; // Document => Document properties widget
101  QWidget *_documentPropertiesWidget; // Document item in tree widget => Document
102  QHash< CASheet*, QWidget* > _sheetPropertiesWidget; // Sheet => Sheet properties widget
103  QHash< QTreeWidgetItem*, CASheet* > _sheetItem; // Sheet item in tree widget => Sheet
104  QHash< CAContext*, QWidget* > _contextPropertiesWidget; // Context => Context properties widget
105  QHash< QTreeWidgetItem*, CAContext* > _contextItem; // Context item in tree widget => Context
106  QHash< CAVoice*, QWidget* > _voicePropertiesWidget; // Voice => Voice properties widget
107  QHash< QTreeWidgetItem*, CAVoice* > _voiceItem; // Voice item in tree widget => Voice
108 };
109 
110 #endif /* PROPERTIESDIALOG_H_ */