]> Creatis software - cpPlugins.git/blob - lib/cpPipelineEditor/BaseQtMainWindow.h
...
[cpPlugins.git] / lib / cpPipelineEditor / BaseQtMainWindow.h
1 #ifndef __CPPIPELINEEDITOR__BASEQTMAINWINDOW__H__
2 #define __CPPIPELINEEDITOR__BASEQTMAINWINDOW__H__
3
4 #include <cpPipelineEditor/cpPipelineEditor_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 cpPipelineEditor
19 {
20   class Editor;
21
22   /**
23    */
24   class cpPipelineEditor_EXPORT BaseQtMainWindow
25     : public QMainWindow
26   {
27     Q_OBJECT;
28
29   public:
30     typedef BaseQtMainWindow 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 BaseQtMainWindow(
45       int argc, char* argv[],
46       QApplication* app,
47       QWidget* parent = NULL
48       );
49     virtual ~BaseQtMainWindow( );
50
51   protected:
52     void _Configure(
53       QTreeWidget* tree,
54       cpExtensions::QT::SimpleMPRWidget* mpr,
55       cpPipelineEditor::Editor* editor
56       );
57     void _LoadPlugins( const std::string& filename );
58     void _LoadPluginsFromPath( const std::string& path );
59     void _UpdateLoadedPlugins( );
60     void _Block( );
61     void _UnBlock( );
62
63     void _LoadWorkspace( const std::string& filename );
64     void _SaveWorkspace( const std::string& filename );
65
66   protected slots:
67     void _InteractiveLoadPlugins( );
68     void _InteractiveLoadPluginsFromPath( );
69     void _InteractiveLoadWorkspace( );
70     void _InteractiveSaveWorkspace( );
71     void _ExecFilter( const std::string& filter_name );
72
73   protected:
74     QApplication*        m_Application;
75     _TBlocker            m_Blocker;
76     cpPlugins::Workspace m_Workspace;
77     cpPlugins::Interface m_Interface;
78     std::string          m_PluginsPath;
79
80     QTreeWidget* m_TreeWidget;
81     Editor*      m_Editor;
82   };
83
84 } // ecapseman
85
86 #endif // __CPPIPELINEEDITOR__BASEQTMAINWINDOW__H__
87
88 // eof - $RCSfile$