Back to index

salome-gui  6.5.0
SUIT_ViewWindow.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // SUIT_ViewWindow.h: interface for the SUIT_ViewWindow class.
00024 //
00025 #ifndef SUIT_VIEWWINDOW_H
00026 #define SUIT_VIEWWINDOW_H
00027 
00028 #include "SUIT.h"
00029 
00030 #include <QMainWindow>
00031 #include <QList>
00032 #include <QMap>
00033 
00034 class SUIT_Desktop;
00035 class SUIT_ViewManager;
00036 class QtxActionToolMgr;
00037 class QtxMultiAction;
00038 class QImage;
00039 
00040 class SUIT_EXPORT SUIT_ViewWindow: public QMainWindow 
00041 {
00042   Q_OBJECT
00043 
00044 public:
00045 
00046   SUIT_ViewWindow( SUIT_Desktop* );
00047   virtual ~SUIT_ViewWindow();
00048 
00049   virtual void      setViewManager( SUIT_ViewManager* );
00050   SUIT_ViewManager* getViewManager() const;
00051 
00052   bool              event(QEvent*);
00053 
00054   virtual QImage    dumpView();
00055   bool              dumpViewToFormat( const QString& fileName, const QString& format );
00056 
00057   bool              onAccelAction( int );
00058 
00059   bool              closable() const;
00060   bool              setClosable( const bool );
00061 
00062   virtual QString   getVisualParameters();
00063   virtual void      setVisualParameters( const QString& parameters );
00064 
00065   void              setDestructiveClose( const bool );
00066   
00067   int               getId() const;
00068 
00069   QtxActionToolMgr* toolMgr() const;
00070 
00071   virtual void      setDropDownButtons( bool );
00072   bool              dropDownButtons() const;
00073 
00074 public slots:
00075   virtual void      onDumpView();
00076 
00077 signals:
00078   void              tryClosing( SUIT_ViewWindow* );
00079   void              closing( SUIT_ViewWindow* );
00080   void              mousePressed( SUIT_ViewWindow*, QMouseEvent* );
00081   void              mouseReleased( SUIT_ViewWindow*, QMouseEvent* );
00082   void              mouseDoubleClicked( SUIT_ViewWindow*, QMouseEvent* );
00083   void              mouseMoving( SUIT_ViewWindow*, QMouseEvent* );
00084   void              wheeling( SUIT_ViewWindow*, QWheelEvent* );
00085   void              keyPressed( SUIT_ViewWindow*, QKeyEvent* );
00086   void              keyReleased( SUIT_ViewWindow*, QKeyEvent* );
00087   void              contextMenuRequested( QContextMenuEvent *e );
00088 
00089 protected:
00090   void              closeEvent( QCloseEvent* );
00091   virtual void      contextMenuEvent( QContextMenuEvent* );
00092   virtual QString   filter() const;
00093   virtual bool      action( const int );
00094   virtual bool      dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
00095 
00096   SUIT_Desktop*     myDesktop;
00097   SUIT_ViewManager* myManager;
00098 
00099 private:
00100   typedef QMap< int, QList<QtxMultiAction*> > ActionsMap;
00101 
00102   QtxActionToolMgr* myToolMgr;
00103   bool              myIsDropDown;
00104   ActionsMap        myMultiActions;
00105 };
00106 
00107 #endif // SUIT_VIEWWINDOW_H