test motif editor
[mussa.git] / qui / motif_editor / MotifEditor.hpp
1 #ifndef MOTIF_EDITOR_H
2 #define MOTIF_EDITOR_H
3
4 #include <vector>
5
6 #include <QPushButton>
7 #include <QScrollArea>
8 #include <QTableView>
9 #include <QVBoxLayout>
10 #include <QWidget>
11
12 #include "alg/mussa.hpp"
13 #include "qui/motif_editor/MotifModel.hpp"
14
15 class MotifEditor : public QWidget
16 {
17   Q_OBJECT
18
19 public:
20   MotifEditor(MussaRef m, QWidget *parent=0);
21
22   //! update our window title
23   void updateTitle();
24   //! resize cells
25   void updateView();
26   
27   //! return the analysis, intended for testing
28   MussaRef get_analysis() { return analysis; }
29   //! return the internal model used by the editor
30   //! this is mostly intended for testing
31   MotifModel *get_model() { return model; }
32    
33 public slots:
34   //! create model and attach it to the table view  
35   void updateModel();
36   //! called to apply motif changes to the analysis
37   void updateAnalysisMotifs();
38
39 signals:
40   //! emitted when the use has applied the motif changes
41   void changedMotifs();
42   
43 private:
44   //! initialize all our gui widgets
45   void setupWidgets();
46   MussaRef analysis;
47
48   QPushButton *applyButton;
49   QVBoxLayout *editor_layout;
50   QHBoxLayout *button_layout;
51   QTableView *table;
52   MotifEditorDelegate *delegate;
53         
54         MotifModel *model;
55 };
56 #endif