Salome HOME
Copyrights update
[modules/gui.git] / src / Qtx / QtxMainWindow.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/
18 //
19 // File:      QtxMainWindow.h
20 // Author:    Sergey TELKOV
21
22 #ifndef QTXMAINWINDOW_H
23 #define QTXMAINWINDOW_H
24
25 #include "Qtx.h"
26
27 #include <qmainwindow.h>
28
29 class QDockWindow;
30 class QtxResourceMgr;
31
32 class QTX_EXPORT QtxMainWindow : public QMainWindow
33 {
34   Q_OBJECT
35
36   class Filter;
37
38   enum { WS_Normal, WS_Minimized, WS_Maximized, WS_Hidden };
39   enum { WP_Absolute, WP_Center, WP_Left, WP_Right, WP_Top = WP_Left, WP_Bottom = WP_Right };
40
41 public:
42   QtxMainWindow( QWidget* = 0, const char* = 0, WFlags = WType_TopLevel );
43   virtual ~QtxMainWindow();
44
45   bool              isDockableMenuBar() const;
46   void              setDockableMenuBar( const bool );
47
48   bool              isDockableStatusBar() const;
49   void              setDockableStatusBar( const bool );
50
51   void              loadGeometry( QtxResourceMgr*, const QString& );
52   void              saveGeometry( QtxResourceMgr*, const QString& ) const;
53
54   virtual bool      eventFilter( QObject*, QEvent* );
55
56 public slots:
57   virtual void      show();
58   virtual void      setAppropriate( QDockWindow*, bool );
59
60 protected:
61   virtual void      setUpLayout();
62
63 private slots:
64   void              onDestroyed( QObject* );
65
66 private:
67   int               windowState( const QString& ) const;
68   int               windowPosition( const QString& ) const;
69   int               relativeCoordinate( const int, const int, const int ) const;
70
71 private:
72   int               myMode;
73   QDockWindow*      myMenuBar;
74   QDockWindow*      myStatusBar;
75 };
76
77 #endif