]> Creatis software - cpPlugins.git/blob - lib/cpBaseQtApplication/MainWindow.h
...
[cpPlugins.git] / lib / cpBaseQtApplication / MainWindow.h
1 #ifndef __CPBASEQTAPPLICATION__MAINWINDOW__H__
2 #define __CPBASEQTAPPLICATION__MAINWINDOW__H__
3
4 #include <cpBaseQtApplication_Export.h>
5 #include <QMainWindow>
6 #include <cpPlugins/Interface.h>
7 #include <cpPlugins/Workspace.h>
8
9 namespace cpExtensions
10 {
11   namespace QT
12   {
13     class SimpleMPRWidget;
14   }
15 }
16 class QTreeWidget;
17
18 namespace cpBaseQtApplication
19 {
20   class Editor;
21
22   /**
23    */
24   class cpBaseQtApplication_EXPORT MainWindow
25     : public QMainWindow
26   {
27     Q_OBJECT;
28
29   public:
30     typedef MainWindow  Self;
31     typedef QMainWindow Superclass;
32
33   protected:
34     /**
35      */
36     class _TBlocker
37       : public QObject
38     {
39     protected:
40       virtual bool eventFilter( QObject* obj, QEvent* event ) ITK_OVERRIDE;
41     };
42
43   public:
44     explicit MainWindow(
45       int argc, char* argv[],
46       QApplication* app,
47       QWidget* parent = NULL
48       );
49     virtual ~MainWindow( );
50
51     void UpdateEnvironment( );
52
53   protected:
54     void _Configure(
55       QTreeWidget* tree,
56       cpExtensions::QT::SimpleMPRWidget* mpr,
57       cpBaseQtApplication::Editor* editor
58       );
59     void _ClearWorkspace( );
60     void _LoadPlugins( const std::string& filename );
61     void _LoadPluginsFromPath( const std::string& path );
62     void _UpdateLoadedPlugins( );
63     void _ShowPlugins( );
64     void _Block( );
65     void _UnBlock( );
66
67     void _LoadWorkspace( const std::string& filename );
68     void _SaveWorkspace( const std::string& filename );
69
70     void _BackgroundProperties( unsigned int i );
71
72   protected slots:
73     void _InteractiveLoadPlugins( );
74     void _InteractiveLoadPluginsFromPath( );
75     void _InteractiveLoadWorkspace( );
76     void _InteractiveSaveWorkspace( );
77     void _ExecFilter( const std::string& filter_name );
78     void _ShowData(
79       const std::string& filter_name, const std::string& output_name
80       );
81     void _HideData(
82       const std::string& filter_name, const std::string& output_name
83       );
84     void _DataProperties(
85       const std::string& filter_name, const std::string& output_name
86       );
87
88   protected:
89     QApplication* m_Application;
90     _TBlocker     m_Blocker;
91     std::string   m_PluginsPath;
92
93     std::string m_ExecutionPath;
94     cpPlugins::Interface m_Interface;
95     cpPlugins::Workspace m_Workspace;
96
97     QTreeWidget* m_TreeWidget;
98     Editor*      m_Editor;
99     cpExtensions::QT::SimpleMPRWidget* m_MPR;
100   };
101
102 } // ecapseman
103
104 #endif // __CPBASEQTAPPLICATION__MAINWINDOW__H__
105
106 // eof - $RCSfile$