Salome HOME
The save returns the list of saved files
[modules/shaper.git] / src / XGUI / XGUI_MainWindow.h
1 #ifndef XGUI_MAINWINDOW_H
2 #define XGUI_MAINWINDOW_H
3
4 #include "XGUI.h"
5 #include <QMainWindow>
6
7 class XGUI_MainMenu;
8 class XGUI_Viewer;
9 class XGUI_ActionsMgr;
10 class XGUI_ViewWindow;
11 class QMdiArea;
12 class QMdiSubWindow;
13 class PyConsole_EnhConsole;
14 class QCloseEvent;
15
16 /**\class XGUI_MainWindow
17  * \ingroup GUI
18  * \brief Main window of the application (Desktop).
19  * It contains: Object Browser, 3d Viewer, Python console, property panel, main menu
20  */
21 class XGUI_EXPORT XGUI_MainWindow : public QMainWindow
22 {
23 Q_OBJECT
24
25  public:
26   XGUI_MainWindow(QWidget* parent = 0);
27   virtual ~XGUI_MainWindow();
28
29   //! Returns main menu object
30   XGUI_MainMenu* menuObject() const
31   {
32     return myMenuBar;
33   }
34
35   //! Returns MDI area
36   QMdiArea* mdiArea() const;
37
38   //! Returns 3d viewer
39   XGUI_Viewer* viewer() const
40   {
41     return myViewer;
42   }
43
44  public slots:
45   void showPythonConsole();
46   void hidePythonConsole();
47   //! Python console can be a dock widget 
48   void dockPythonConsole();
49   //! or can be a tab in the main menu.
50   void undockPythonConsole();
51
52   void createSubWindow();
53
54  private slots:
55   void cascadeWindows();
56   void onViewCreated(XGUI_ViewWindow* theWindow);
57   void onDeleteView(XGUI_ViewWindow* theWindow);
58   void activateView();
59   void onViewActivated(QMdiSubWindow* theSubWnd);
60
61 signals:
62   void exitKeySequence();
63
64  protected:
65   void closeEvent(QCloseEvent* event);
66   void createMainMenu();
67
68  private:
69   XGUI_MainMenu* myMenuBar;
70   XGUI_Viewer* myViewer;
71
72   PyConsole_EnhConsole* myPythonConsole;
73 };
74
75 class XGUI_EXPORT CloseEventWatcher : public QObject
76 {
77 Q_OBJECT
78
79  public:
80   CloseEventWatcher(QObject* theParent);
81
82 signals:
83   void widgetClosed();
84
85  protected:
86   bool eventFilter(QObject *obj, QEvent *);
87
88 };
89
90 #endif