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