Back to index

salome-gui  6.5.0
QtxWorkspaceAction.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 // File:      QtxWorkspaceAction.h
00024 // Author:    Sergey TELKOV
00025 //
00026 #ifndef QTXWORKSPACEACTION_H
00027 #define QTXWORKSPACEACTION_H
00028 
00029 #include "QtxActionSet.h"
00030 
00031 class QtxWorkspace;
00032 
00033 #ifdef WIN32
00034 #pragma warning( disable:4251 )
00035 #endif
00036 
00037 class QTX_EXPORT QtxWorkspaceAction : public QtxActionSet
00038 {
00039   Q_OBJECT
00040 
00041 public:
00043   enum { Cascade    = 0x0001,   
00044          Tile       = 0x0002,   
00045          VTile      = 0x0004,   
00046          HTile      = 0x0008,   
00047          Windows    = 0x0010,   
00048          Standard   = Cascade | Tile | Windows,
00049          Operations = Cascade | Tile | VTile | HTile,
00050          All        = Standard | HTile | VTile };
00051 
00052 public:
00053   QtxWorkspaceAction( QtxWorkspace*, QObject* = 0 );
00054   virtual ~QtxWorkspaceAction();
00055 
00056   QtxWorkspace* workspace() const;
00057 
00058   int           menuActions() const;
00059   void          setMenuActions( const int );
00060 
00061   QIcon         icon( const int ) const;
00062   QString       text( const int ) const;
00063   int           accel( const int ) const;
00064   QString       statusTip( const int ) const;
00065 
00066   void          setAccel( const int, const int );
00067   void          setIcon( const int, const QIcon& );
00068   void          setText( const int, const QString& );
00069   void          setStatusTip( const int, const QString& );
00070 
00071   void          perform( const int );
00072 
00073 public slots:
00074   void          tile();
00075   void          cascade();
00076   void          tileVertical();
00077   void          tileHorizontal();
00078 
00079 private slots:
00080   void          onAboutToShow();
00081   void          onTriggered( int );
00082 
00083 protected:
00084   virtual void  addedTo( QWidget* );
00085   virtual void  removedFrom( QWidget* );
00086 
00087 private:
00088   void          updateContent();
00089   void          updateWindows();
00090   void          activateItem( const int );
00091 
00092 private:
00093   QtxWorkspace* myWorkspace;       
00094   bool          myWindowsFlag;     
00095 };
00096 
00097 #ifdef WIN32
00098 #pragma warning( default:4251 )
00099 #endif
00100 
00101 #endif