1 // Copyright (C) 2007-2012 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.
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 : LightApp_ModuleAction.h
21 // Author : Sergey TELKOV, Vadim SANDLER
23 #ifndef LIGHTAPP_MODULEACTION_H
24 #define LIGHTAPP_MODULEACTION_H
28 #include <QtxAction.h>
31 #pragma warning ( disable:4251 )
36 class LIGHTAPP_EXPORT LightApp_ModuleAction : public QtxAction
46 enum { None = 0x00, Buttons = 0x01, ComboItem = 0x02, All = Buttons | ComboItem };
49 LightApp_ModuleAction( const QString&, QObject* = 0 );
50 LightApp_ModuleAction( const QString&, const QIcon&, QObject* = 0 );
51 virtual ~LightApp_ModuleAction();
53 QStringList modules() const;
55 QIcon moduleIcon( const QString& ) const;
56 void setModuleIcon( const QString&, const QIcon& );
58 void insertModule( const QString&, const QIcon&, const int = -1 );
59 void removeModule( const QString& );
61 QString activeModule() const;
62 void setActiveModule( const QString& );
64 void setMode( const int );
68 virtual void addedTo( QWidget* );
69 virtual void removedFrom( QWidget* );
71 virtual bool event( QEvent* );
74 void moduleActivated( const QString& );
80 void update( QtxComboBox* );
82 QAction* active() const;
83 void activate( int, bool = true );
87 void onTriggered( int );
88 void onComboActivated( int );
96 class LightApp_ModuleAction::ComboAction : public QtxAction
101 ComboAction( QObject* parent );
103 QList<QtxComboBox*> widgets() const;
106 void activatedId( int );
109 virtual QWidget* createWidget( QWidget* );
112 #endif // LIGHTAPP_MODULEACTION_H