ticket:104 fix some pointer problems with MussaAlignedWindow
[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/ThresholdWidget.hpp"
18 #include "qui/ZoomWidget.hpp"
19
20
21 class QAction;
22 class QLabel;
23 class QStringList;
24 class Mussa;
25 class QAssistantClient;
26
27 class MussaWindow : public QMainWindow
28 {
29   Q_OBJECT
30
31 public: 
32   MussaWindow(Mussa* analysis=0, QWidget *parent=0);
33   ~MussaWindow();
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
92   // display our wonderful mussa output
93   SequenceBrowserWidget browser;
94   QToolBar mussaViewTB;
95   ZoomWidget zoom;
96   ThresholdWidget threshold;
97   QProgressDialog *progress_dialog;
98
99   QAction *aboutAction;
100   QAction *closeAction;
101   QAction *createNewAnalysisAction;
102   QAction *createSubAnalysisAction;
103   QAction *editMotifsAction;
104   QAction *loadMotifListAction;
105   QAction *loadMupaAction;
106   QAction *loadSavedAnalysisAction;
107   QAction *mussaManualAssistantAction;
108   QAction *newMussaWindowAction;
109   QAction *saveMotifListAction;
110   QAction *showMussaViewToolbarAction;
111   QAction *toggleMotifsAction;
112   QAction *saveBrowserPixmapAction;
113   QAction *whatsThisAction;
114   QAction *viewMussaAlignmentAction;
115
116   QAssistantClient *manualAssistant;
117
118   //! initialze the actions
119   void setupActions();
120   //! initialize this windows menu object
121   void setupMainMenu();
122   //! initialize assistant client
123   void setupAssistant();
124   //! stub function to fill in QActions
125   void NotImplementedBox();
126
127 protected slots:  
128   //! update the SequenceBrowser with our analysis
129   void updateAnalysis();
130   //! update the view of conserved windows
131   void updateLinks();
132   //! update annotations?
133   void updateAnnotations();
134 };
135
136 #endif