implement analysis save as dialog
[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   //! save an analysis
51   void saveAnalysis();
52   //\@}
53
54   //! \defgroup MotifHandling Handling of motif lists
55   //\@{
56   //! load motifs
57   void editMotifs();
58   void loadMotifList();
59   void saveMotifList();
60   void toggleMotifs();
61   //\@}
62
63   //! load a mussa parameter file (which specifies an analysis to run)
64   void loadMupa();
65   //! load a previously run analysis
66   void loadSavedAnalysis();
67   //! set the soft threshold used by the Nway_Path algorithm
68   void setSoftThreshold(int thres);
69   //! update progress bar
70   void updateProgress(const std::string& description, int cur, int max);
71
72   //! open a new mussa window so one can compare analyses
73   void newMussaWindow();
74
75   void showMussaToolbar();
76
77   //! open new window showing our alignment
78   void viewMussaAlignment();
79
80   //! display mussagl manual
81   void showManual();
82
83   void assistantError(const QString message);
84
85 signals:
86   void changedAnnotations();
87
88 protected:
89   Mussa *analysis;
90   std::list<boost::shared_ptr<MussaAlignedWindow> > aligned_windows;
91   MotifEditor *motif_editor;
92   MussaSetupDialog setup_analysis_dialog;
93   SubanalysisWindow subanalysis_window;
94
95   // display our wonderful mussa output
96   SequenceBrowserWidget browser;
97   QToolBar mussaViewTB;
98   ZoomWidget zoom;
99   ThresholdWidget threshold;
100   QProgressDialog *progress_dialog;
101
102   QAction *aboutAction;
103   QAction *closeAction;
104   QAction *createNewAnalysisAction;
105   QAction *createSubAnalysisAction;
106   QAction *saveAnalysisAction;
107   QAction *editMotifsAction;
108   QAction *loadMotifListAction;
109   QAction *loadMupaAction;
110   QAction *loadSavedAnalysisAction;
111   QAction *mussaManualAssistantAction;
112   QAction *newMussaWindowAction;
113   QAction *saveMotifListAction;
114   QAction *showMussaViewToolbarAction;
115   QAction *toggleMotifsAction;
116   QAction *saveBrowserPixmapAction;
117   QAction *whatsThisAction;
118   QAction *viewMussaAlignmentAction;
119
120   QAssistantClient *manualAssistant;
121
122   //! initialze the actions
123   void setupActions();
124   //! initialize this windows menu object
125   void setupMainMenu();
126   //! initialize assistant client
127   void setupAssistant();
128   //! stub function to fill in QActions
129   void NotImplementedBox();
130
131 protected slots:  
132   //! update the SequenceBrowser with our analysis
133   void updateAnalysis();
134   //! update the view of conserved windows
135   void updateLinks();
136   //! update annotations?
137   void updateAnnotations();
138 };
139
140 #endif