1 #ifndef XGUI_SALOMECONNECTOR_H
2 #define XGUI_SALOMECONNECTOR_H
10 class XGUI_SalomeViewer;
13 * An interface which provides a connection of XGUI functionality
14 * with functionality of SALOME module interface.
16 class XGUI_EXPORT XGUI_SalomeConnector
19 //! Creates a feature (command) in SALOME desktop
20 //! \param theWBName - a workbench name
21 //! \param theId - an id of the feature
22 //! \param theTitle - a menu item string
23 //! \param theTip - a tooltip string (help)
24 //! \param theIcon - icon
25 //! \param isCheckable - is checkable or not
26 //! \param theKeys - hot keys
27 //! returns created action
28 virtual QAction* addFeature(const QString& theWBName,
30 const QString& theTitle,
31 const QString& theTip,
33 const QKeySequence& theKeys,
34 bool isCheckable) = 0;
36 //! Creates a command in Edit menu of SALOME desktop
37 //! \param theId - an id of the feature
38 //! \param theTitle - a menu item string
39 //! \param theTip - a tooltip string (help)
40 //! \param theIcon - icon
41 //! \param isCheckable - is checkable or not
42 //! \param theKeys - hot keys
43 //! returns created action
44 virtual QAction* addEditCommand(const QString& theId,
45 const QString& theTitle,
46 const QString& theTip,
48 const QKeySequence& theKeys,
49 bool isCheckable) = 0;
51 //! Insert separator into Edit menu of SALOME desktop
52 virtual void addEditMenuSeparator() = 0;
54 //! Returns desktop window of SALOME
55 virtual QMainWindow* desktop() const = 0;
57 //! Returns command string Id by QAction instance
58 virtual QString commandId(const QAction* theCmd) const = 0;
60 //! Returns QAction instance by command string Id
61 virtual QAction* command(const QString& theId) const = 0;
63 //! Returns list of defined actions (just by NewGeom module)
64 virtual QList<QAction*> commandList() const = 0;
66 //! Returns list of Ids of defined actions (just by NewGeom module)
67 virtual QStringList commandIdList() const = 0;
69 //! Set nested actions dependent on command Id
70 //! \param theId - the command ID
71 //! \param theActions - the list of nested actions
72 virtual void setNestedActions(const QString& theId, const QStringList& theActions) = 0;
74 //! Returns list of nested actions according to the given command ID
75 virtual QStringList nestedActions(const QString& theId) const = 0;
77 //! Returns interface to Salome viewer
78 virtual XGUI_SalomeViewer* viewer() const = 0;