]> SALOME platform Git repositories - modules/gui.git/blob - src/SUIT/SUIT_ViewWindow.h
Salome HOME
e7dc87a1a8492625fc37c8face92e17287a06b5f
[modules/gui.git] / src / SUIT / SUIT_ViewWindow.h
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // SUIT_ViewWindow.h: interface for the SUIT_ViewWindow class.
24 //
25 #ifndef SUIT_VIEWWINDOW_H
26 #define SUIT_VIEWWINDOW_H
27
28 #include "SUIT.h"
29
30 #include <QMainWindow>
31 #include <QList>
32 #include <QMap>
33
34 class SUIT_Desktop;
35 class SUIT_ViewManager;
36 class QtxActionToolMgr;
37 class QtxMultiAction;
38 class QImage;
39
40 class SUIT_EXPORT SUIT_ViewWindow: public QMainWindow 
41 {
42   Q_OBJECT
43
44 public:
45
46   SUIT_ViewWindow( SUIT_Desktop* );
47   virtual ~SUIT_ViewWindow();
48
49   virtual void      setViewManager( SUIT_ViewManager* );
50   SUIT_ViewManager* getViewManager() const;
51
52   bool              event(QEvent*);
53
54   virtual QImage    dumpView();
55   bool              dumpViewToFormat( const QString& fileName, const QString& format );
56
57   bool              onAccelAction( int );
58
59   bool              closable() const;
60   bool              setClosable( const bool );
61
62   virtual QString   getVisualParameters();
63   virtual void      setVisualParameters( const QString& parameters );
64
65   void              setDestructiveClose( const bool );
66   
67   int               getId() const;
68
69   QtxActionToolMgr* toolMgr() const;
70
71   virtual void      setDropDownButtons( bool );
72   bool              dropDownButtons() const;
73
74 public slots:
75   virtual void      onDumpView();
76
77 signals:
78   void              tryClosing( SUIT_ViewWindow* );
79   void              closing( SUIT_ViewWindow* );
80   void              mousePressed( SUIT_ViewWindow*, QMouseEvent* );
81   void              mouseReleased( SUIT_ViewWindow*, QMouseEvent* );
82   void              mouseDoubleClicked( SUIT_ViewWindow*, QMouseEvent* );
83   void              mouseMoving( SUIT_ViewWindow*, QMouseEvent* );
84   void              wheeling( SUIT_ViewWindow*, QWheelEvent* );
85   void              keyPressed( SUIT_ViewWindow*, QKeyEvent* );
86   void              keyReleased( SUIT_ViewWindow*, QKeyEvent* );
87   void              contextMenuRequested( QContextMenuEvent *e );
88
89 protected:
90   void              closeEvent( QCloseEvent* );
91   virtual void      contextMenuEvent( QContextMenuEvent* );
92   virtual QString   filter() const;
93   virtual bool      action( const int );
94   virtual bool      dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
95
96   SUIT_Desktop*     myDesktop;
97   SUIT_ViewManager* myManager;
98
99 private:
100   typedef QMap< int, QList<QtxMultiAction*> > ActionsMap;
101
102   QtxActionToolMgr* myToolMgr;
103   bool              myIsDropDown;
104   ActionsMap        myMultiActions;
105 };
106
107 #endif // SUIT_VIEWWINDOW_H