Back to index

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