SHAPER  9.12.0
XGUI_SalomeConnector.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef XGUI_SALOMECONNECTOR_H
21 #define XGUI_SALOMECONNECTOR_H
22 
23 #include "XGUI.h"
24 
25 #include <QString>
26 #include <QStringList>
27 
28 #include <ModuleBase_ActionInfo.h>
29 
30 class QMainWindow;
32 class ModuleBase_IViewer;
33 
39 class XGUI_EXPORT XGUI_SalomeConnector
40 {
41  public:
45  virtual ~XGUI_SalomeConnector();
46 
58  virtual QAction* addFeature(const QString& theWBName, const QString& theTBName,
59  const QString& theId,
60  const QString& theTitle, const QString& theTip,
61  const QIcon& theIcon,
62  const QKeySequence& theKeys, bool isCheckable,
63  const bool isAddSeparator,
64  const QString& theStatusTip) = 0;
65 
70  virtual QAction* addFeature(const QString& theWBName,
71  const ActionInfo& theInfo, const bool isAddSeparator) = 0;
72 
77  virtual QAction* addFeatureOfNested(const QString& theWBName,
78  const ActionInfo& theInfo,
79  const QList<QAction*>& theNestedActions) = 0;
80 
85  virtual bool isFeatureOfNested(const QAction* theAction) = 0;
86 
99  virtual QAction* addDesktopCommand(const QString& theId, const QString& theTitle,
100  const QString& theTip, const QIcon& theIcon,
101  const QKeySequence& theKeys, bool isCheckable,
102  const char* theMenuSourceText,
103  const QString& theSubMenu = QString(),
104  const int theMenuPosition = 10,
105  const int theSuibMenuPosition = -1) = 0;
106 
108  virtual void addDesktopMenuSeparator(const char* theMenuSourceText,
109  const int theMenuPosition = 10) = 0;
110 
114  virtual bool addActionInToolbar( QAction* theAction, const QString& theToolBarTitle ) = 0;
115 
117  virtual void createFeatureActions() = 0;
118 
120  virtual QMainWindow* desktop() const = 0;
121 
123  virtual QList<QAction*> commandList() const = 0;
124 
128  virtual void setFeatureInfo(const QString& theFeatureId,
129  const std::shared_ptr<Config_FeatureMessage>& theMessage) = 0;
130 
134  virtual std::shared_ptr<Config_FeatureMessage> featureInfo(const QString& theFeatureId) = 0;
135 
137  virtual ModuleBase_IViewer* viewer() const = 0;
138 
140  virtual void createPreferences() = 0;
141 
145  // If 0, default value is used, it is 3000
146  virtual void putInfo(const QString& theInfo, const int theMSecs = 0) = 0;
147 };
148 
149 #endif
Class to pass a feature entry extracted from xml file.
Definition: Config_FeatureMessage.h:39
A Base object for definition of connector object to Salome Viewer.
Definition: ModuleBase_IViewer.h:47
An interface which provides a connection of XGUI functionality with functionality of SALOME module in...
Definition: XGUI_SalomeConnector.h:40
virtual void setFeatureInfo(const QString &theFeatureId, const std::shared_ptr< Config_FeatureMessage > &theMessage)=0
Stores XML information for the feature kind.
virtual QAction * addFeatureOfNested(const QString &theWBName, const ActionInfo &theInfo, const QList< QAction * > &theNestedActions)=0
Creates a feature (command) in SALOME desktop.
virtual void addDesktopMenuSeparator(const char *theMenuSourceText, const int theMenuPosition=10)=0
Insert separator into Edit menu of SALOME desktop.
virtual bool isFeatureOfNested(const QAction *theAction)=0
Returns true if the feature action is a nested action, in other words, it is created by addFeatureOfN...
virtual QAction * addFeature(const QString &theWBName, const ActionInfo &theInfo, const bool isAddSeparator)=0
Creates a feature (command) in SALOME desktop.
virtual QAction * addFeature(const QString &theWBName, const QString &theTBName, const QString &theId, const QString &theTitle, const QString &theTip, const QIcon &theIcon, const QKeySequence &theKeys, bool isCheckable, const bool isAddSeparator, const QString &theStatusTip)=0
Creates a feature (command) in SALOME desktop.
virtual void createFeatureActions()=0
Creates menu/tool bar actions for loaded features stored in the menu manager.
virtual std::shared_ptr< Config_FeatureMessage > featureInfo(const QString &theFeatureId)=0
Returns XML information for the feature kind.
virtual void putInfo(const QString &theInfo, const int theMSecs=0)=0
Shows the given text in status bar as a permanent text \theInfo a string value \theMsecs interval of ...
virtual QAction * addDesktopCommand(const QString &theId, const QString &theTitle, const QString &theTip, const QIcon &theIcon, const QKeySequence &theKeys, bool isCheckable, const char *theMenuSourceText, const QString &theSubMenu=QString(), const int theMenuPosition=10, const int theSuibMenuPosition=-1)=0
Creates a command in Edit menu of SALOME desktop.
virtual void createPreferences()=0
Create preferences.
virtual ModuleBase_IViewer * viewer() const =0
Returns interface to Salome viewer.
virtual QList< QAction * > commandList() const =0
Returns list of defined actions (just by SHAPER module)
virtual bool addActionInToolbar(QAction *theAction, const QString &theToolBarTitle)=0
Add an action into tool bar.
virtual QMainWindow * desktop() const =0
Returns desktop window of SALOME.
Definition: ModuleBase_ActionInfo.h:37