Allow changing the name for a sequence in the sequence browser.
[mussa.git] / qui / MussaWindow.hpp
1 #ifndef _MUSSAWINDOW_H_
2 #define _MUSSAWINDOW_H_
3
4 #include <list>
5 #include <boost/shared_ptr.hpp>
6
7 #include <QMainWindow>
8 #include <QPixmap>
9 #include <QProgressDialog>
10 #include <QSpinBox>
11 #include <QToolBar>
12
13 #include "qui/MussaAlignedWindow.hpp"
14 #include "qui/motif_editor/MotifEditor.hpp"
15 #include "qui/mussa_setup_dialog/MussaSetupDialog.hpp"
16 #include "qui/seqbrowser/SequenceBrowserWidget.hpp"
17 #include "qui/SubanalysisWindow.hpp"
18 #include "qui/ThresholdWidget.hpp"
19 #include "qui/ZoomWidget.hpp"
20
21
22 class QAction;
23 class QLabel;
24 class QStringList;
25 class Mussa;
26 class QAssistantClient;
27
28 class MussaWindow : public QMainWindow
29 {
30   Q_OBJECT
31
32 public: 
33   MussaWindow(Mussa* analysis=0, QWidget *parent=0);
34
35   //! reset any attached window
36   void clear();
37
38   //! switch to a new analysis
39   void setAnalysis(Mussa *new_analysis);
40 public slots:
41   //! display an about box, contemplating the politics of the author list
42   void about();
43
44   //! \defgroup AnalysisFunctions Components related to running analyses
45   //\@{
46   //! open a window to collect the information needed to create a new analysis
47   void createNewAnalysis();
48   //! launch a sub analysis
49   void createSubAnalysis();
50   //\@}
51
52   //! \defgroup MotifHandling Handling of motif lists
53   //\@{
54   //! load motifs
55   void editMotifs();
56   void loadMotifList();
57   void saveMotifList();
58   void toggleMotifs();
59   //\@}
60
61   //! load a mussa parameter file (which specifies an analysis to run)
62   void loadMupa();
63   //! load a previously run analysis
64   void loadSavedAnalysis();
65   //! set the soft threshold used by the Nway_Path algorithm
66   void setSoftThreshold(int thres);
67   //! update progress bar
68   void updateProgress(const std::string& description, int cur, int max);
69
70   //! open a new mussa window so one can compare analyses
71   void newMussaWindow();
72
73   void showMussaToolbar();
74
75   //! open new window showing our alignment
76   void viewMussaAlignment();
77
78   //! display mussagl manual
79   void showManual();
80
81   void assistantError(const QString message);
82
83 signals:
84   void changedAnnotations();
85
86 protected:
87   Mussa *analysis;
88   std::list<boost::shared_ptr<MussaAlignedWindow> > aligned_windows;
89   MotifEditor *motif_editor;
90   MussaSetupDialog setup_analysis_dialog;
91   SubanalysisWindow subanalysis_window;
92
93   // display our wonderful mussa output
94   SequenceBrowserWidget browser;
95   QToolBar mussaViewTB;
96   ZoomWidget zoom;
97   ThresholdWidget threshold;
98   QProgressDialog *progress_dialog;
99
100   QAction *aboutAction;
101   QAction *closeAction;
102   QAction *createNewAnalysisAction;
103   QAction *createSubAnalysisAction;
104   QAction *editMotifsAction;
105   QAction *loadMotifListAction;
106   QAction *loadMupaAction;
107   QAction *loadSavedAnalysisAction;
108   QAction *mussaManualAssistantAction;
109   QAction *newMussaWindowAction;
110   QAction *saveMotifListAction;
111   QAction *showMussaViewToolbarAction;
112   QAction *toggleMotifsAction;
113   QAction *saveBrowserPixmapAction;
114   QAction *whatsThisAction;
115   QAction *viewMussaAlignmentAction;
116
117   QAssistantClient *manualAssistant;
118
119   //! initialze the actions
120   void setupActions();
121   //! initialize this windows menu object
122   void setupMainMenu();
123   //! initialize assistant client
124   void setupAssistant();
125   //! stub function to fill in QActions
126   void NotImplementedBox();
127
128 protected slots:  
129   //! update the SequenceBrowser with our analysis
130   void updateAnalysis();
131   //! update the view of conserved windows
132   void updateLinks();
133   //! update annotations?
134   void updateAnnotations();
135 };
136
137 #endif