Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/gui.git] / src / SUIT / SUIT_ViewWindow.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/ or email : webmaster.salome@opencascade.com
18 //
19 // SUIT_ViewWindow.h: interface for the SUIT_ViewWindow class.
20 //
21
22 #if !defined(AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_)
23 #define AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_
24
25 #if _MSC_VER > 1000
26 #pragma once
27 #endif // _MSC_VER > 1000
28
29 #include "SUIT.h"
30
31 #include <qmainwindow.h>
32
33 class SUIT_Desktop;
34 class SUIT_ViewManager;
35 class QImage;
36
37 class SUIT_EXPORT SUIT_ViewWindow: public QMainWindow 
38 {
39   Q_OBJECT
40 public:
41   SUIT_ViewWindow( SUIT_Desktop* );
42   virtual ~SUIT_ViewWindow();
43
44   void              setViewManager( SUIT_ViewManager* );
45   SUIT_ViewManager* getViewManager() const;
46
47   bool              event(QEvent*);
48
49   virtual QImage    dumpView();
50   bool              dumpViewToFormat( const QString& fileName, const QString& format );
51
52   bool              onAccelAction( int );
53
54   virtual QString   getVisualParameters();
55   virtual void      setVisualParameters( const QString& parameters );
56
57   void              setDestructiveClose( const bool );
58
59 public slots:
60   virtual void      onDumpView();
61
62 signals:
63   void              closing( SUIT_ViewWindow* );
64   void              mousePressed( SUIT_ViewWindow*, QMouseEvent* );
65   void              mouseReleased( SUIT_ViewWindow*, QMouseEvent* );
66   void              mouseDoubleClicked( SUIT_ViewWindow*, QMouseEvent* );
67   void              mouseMoving( SUIT_ViewWindow*, QMouseEvent* );
68   void              wheeling( SUIT_ViewWindow*, QWheelEvent* );
69   void              keyPressed( SUIT_ViewWindow*, QKeyEvent* );
70   void              keyReleased( SUIT_ViewWindow*, QKeyEvent* );
71   void              contextMenuRequested( QContextMenuEvent *e );
72
73 protected:
74   void              closeEvent( QCloseEvent* );
75   virtual void      contextMenuEvent( QContextMenuEvent* );
76   virtual QString   filter() const;
77   virtual bool      action( const int );
78   virtual bool      dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
79
80   SUIT_Desktop*     myDesktop;
81   SUIT_ViewManager* myManager;
82 };
83
84 #endif // !defined(AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_)