1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: QtxActionSet.h
21 // Author: Sergey TELKOV
23 #ifndef QTXACTIONSET_H
24 #define QTXACTIONSET_H
26 #include "QtxAction.h"
31 #pragma warning( disable:4251 )
34 class QTX_EXPORT QtxActionSet : public QtxAction
39 QtxActionSet( QObject* = 0 );
40 virtual ~QtxActionSet();
42 QList<QAction*> actions() const;
43 void setActions( const QList<QAction*>& );
45 void insertActions( const QList<QAction*>&, const int = -1 );
47 int insertAction( QAction*, const int id = -1, const int = -1 );
48 int insertAction( const QString&, const int id = -1, const int = -1 );
49 int insertAction( const QString&, const QIcon&, const int id = -1, const int = -1 );
51 void removeAction( QAction* );
52 void removeAction( const int );
57 void triggered( int );
58 void triggered( QAction* );
62 void onActionTriggered( bool = false );
65 virtual void addedTo( QWidget* );
66 virtual void removedFrom( QWidget* );
68 virtual void actionAdded( QAction* );
69 virtual void actionRemoved( QAction* );
71 QAction* action( int ) const;
72 int actionId( QAction* ) const;
73 void setActionId( QAction*, const int );
75 virtual bool isEmptyAction() const;
77 virtual void updateAction();
78 virtual void updateAction( QWidget* );
81 int generateId() const;
84 typedef QList<QAction*> ActionList;
87 ActionList mySet; //!< actions list
91 #pragma warning( default:4251 )