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