X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLightApp%2FLightApp_ModuleAction.h;h=62dfcd9fea7feba1233f15787f15cf44054b01ee;hb=refs%2Ftags%2FV9_11_0;hp=f669d681e8ed3a182d5ecaf2e07b7417928c1dba;hpb=6d083b4f89b0644ced3f98c578612097712a71f2;p=modules%2Fgui.git diff --git a/src/LightApp/LightApp_ModuleAction.h b/src/LightApp/LightApp_ModuleAction.h index f669d681e..62dfcd9fe 100644 --- a/src/LightApp/LightApp_ModuleAction.h +++ b/src/LightApp/LightApp_ModuleAction.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -32,6 +32,8 @@ #endif class QtxComboBox; +class QtxResourceMgr; +class QSignalMapper; class LIGHTAPP_EXPORT LightApp_ModuleAction : public QtxAction { @@ -43,11 +45,14 @@ private: class ActivateEvent; public: - enum { None = 0x00, Buttons = 0x01, ComboItem = 0x02, All = Buttons | ComboItem }; + typedef enum { Buttons = 0x01, + List = 0x02, + AddRemove = 0x04, + All = Buttons | List | AddRemove + } Mode; public: - LightApp_ModuleAction( const QString&, QObject* = 0 ); - LightApp_ModuleAction( const QString&, const QIcon&, QObject* = 0 ); + LightApp_ModuleAction( QtxResourceMgr*, QObject* = 0 ); virtual ~LightApp_ModuleAction(); int count() const; @@ -59,13 +64,21 @@ public: QAction* moduleAction( const QString& ) const; void insertModule( const QString&, const QIcon&, const int = -1 ); + void insertModule( const QString&, const QIcon&, bool, const int = -1 ); void removeModule( const QString& ); + void insertExtension(const QString&); + void removeExtension(const QString&); + void updateExtActions(); QString activeModule() const; + + void setMode( const Mode& ); + void setModeEnabled( const Mode&, bool ); + bool isModeEnabled( const Mode& ) const; + +public slots: void setActiveModule( const QString& ); - void setMode( const int ); - int mode() const; protected: virtual void addedTo( QWidget* ); @@ -75,10 +88,11 @@ protected: signals: void moduleActivated( const QString& ); + void adding(); + void removing( const QString& ); + void showExtInfo(); private: - void init(); - void update(); void update( QtxComboBox* ); @@ -92,8 +106,13 @@ private slots: private: ComboAction* myCombo; + QtxAction* myAdd; + QtxAction* myRemove; + QtxAction* myInfo; ActionSet* mySet; + QAction* mySeparator; int myMode; + QSignalMapper* myMapper; }; class LightApp_ModuleAction::ComboAction : public QtxAction