Back to index

salome-gui  6.5.0
SUIT_Desktop.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 #ifndef SUIT_DESKTOP_H
00024 #define SUIT_DESKTOP_H
00025 
00026 #include "SUIT.h"
00027 
00028 #include <QList>
00029 #include <QEvent>
00030 
00031 #include <QtxMainWindow.h>
00032 
00033 class QMovie;
00034 
00035 class QtxLogoMgr;
00036 class QtxActionMenuMgr;
00037 class QtxActionToolMgr;
00038 
00039 class SUIT_ViewWindow;
00040 
00046 class SUIT_EXPORT SUIT_Desktop : public QtxMainWindow
00047 {
00048   Q_OBJECT
00049 
00050   class ReparentEvent;
00051 
00052   enum { Reparent = QEvent::User };
00053 
00054 public:
00055   SUIT_Desktop();
00056   virtual ~SUIT_Desktop();
00057 
00058   QtxActionMenuMgr*        menuMgr() const;
00059   QtxActionToolMgr*        toolMgr() const;
00060   QtxLogoMgr*              logoMgr() const;
00061 
00062   virtual SUIT_ViewWindow* activeWindow() const = 0;
00063   virtual QList<SUIT_ViewWindow*> windows() const = 0;
00064 
00065   int                      logoCount() const;
00066 
00067   void                     logoClear();
00068   void                     logoRemove( const QString& );
00069   void                     logoInsert( const QString&, QMovie*, const int = -1 );
00070   void                     logoInsert( const QString&, const QPixmap&, const int = -1 );
00071 
00072   void                     emitActivated();
00073   void                     emitMessage( const QString& );
00074 
00075 signals:
00076   void                     activated();
00077   void                     deactivated();
00078   void                     windowActivated( SUIT_ViewWindow* );
00079   void                     closing( SUIT_Desktop*, QCloseEvent* );
00080   void                     message( const QString& );
00081 
00082 protected:
00083   virtual bool             event( QEvent* );
00084   virtual void             customEvent( QEvent* );
00085   virtual void             closeEvent( QCloseEvent* );
00086   virtual void             childEvent( QChildEvent* );
00087 
00088   virtual void             addWindow( QWidget* ) = 0;
00089 
00090 private:
00091   QtxActionMenuMgr*        myMenuMgr;
00092   QtxActionToolMgr*        myToolMgr;
00093   QtxLogoMgr*              myLogoMgr;
00094 };
00095 
00096 #endif