1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: QtxWorkspaceAction.h
24 // Author: Sergey TELKOV
26 #ifndef QTXWORKSPACEACTION_H
27 #define QTXWORKSPACEACTION_H
29 #include "QtxActionSet.h"
34 #pragma warning( disable:4251 )
37 class QTX_EXPORT QtxWorkspaceAction : public QtxActionSet
42 //! Actions (menu items) ID
43 enum { Cascade = 0x0001, //!< "Cascade child windows" operation
44 Tile = 0x0002, //!< "Tile child windows" operation
45 VTile = 0x0004, //!< "Tile child windows vertically" operation
46 HTile = 0x0008, //!< "Tile child windows horizontally" operation
47 Windows = 0x0010, //!< A list of child windows menu items
48 Standard = Cascade | Tile | Windows,
49 Operations = Cascade | Tile | VTile | HTile,
50 All = Standard | HTile | VTile };
53 QtxWorkspaceAction( QtxWorkspace*, QObject* = 0 );
54 virtual ~QtxWorkspaceAction();
56 QtxWorkspace* workspace() const;
58 int menuActions() const;
59 void setMenuActions( const int );
61 QIcon icon( const int ) const;
62 QString text( const int ) const;
63 int accel( const int ) const;
64 QString statusTip( const int ) const;
66 void setAccel( const int, const int );
67 void setIcon( const int, const QIcon& );
68 void setText( const int, const QString& );
69 void setStatusTip( const int, const QString& );
71 void perform( const int );
77 void tileHorizontal();
81 void onTriggered( int );
84 virtual void addedTo( QWidget* );
85 virtual void removedFrom( QWidget* );
90 void activateItem( const int );
93 QtxWorkspace* myWorkspace; //!< parent workspace
94 bool myWindowsFlag; //!< "show child windows items" flag
98 #pragma warning( default:4251 )