1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 #ifndef XGUI_SALOMECONNECTOR_H
4 #define XGUI_SALOMECONNECTOR_H
12 class ModuleBase_IViewer;
16 * An interface which provides a connection of XGUI functionality
17 * with functionality of SALOME module interface.
19 class XGUI_EXPORT XGUI_SalomeConnector
22 //! Creates a feature (command) in SALOME desktop
23 //! \param theWBName - a workbench name
24 //! \param theId - an id of the feature
25 //! \param theTitle - a menu item string
26 //! \param theTip - a tooltip string (help)
27 //! \param theIcon - icon
28 //! \param isCheckable - is checkable or not
29 //! \param theKeys - hot keys
30 //! returns created action
31 virtual QAction* addFeature(const QString& theWBName, const QString& theId,
32 const QString& theTitle, const QString& theTip, const QIcon& theIcon,
33 const QKeySequence& theKeys, bool isCheckable) = 0;
35 //! Creates a command in Edit menu of SALOME desktop
36 //! \param theId - an id of the feature
37 //! \param theTitle - a menu item string
38 //! \param theTip - a tooltip string (help)
39 //! \param theIcon - icon
40 //! \param isCheckable - is checkable or not
41 //! \param theKeys - hot keys
42 //! \param theMenuSourceText - a source text of the desktop menu
43 //! \param theMenuPosition - a position of the command in the desktop menu
44 //! returns created action
45 virtual QAction* addDesktopCommand(const QString& theId, const QString& theTitle,
46 const QString& theTip, const QIcon& theIcon,
47 const QKeySequence& theKeys, bool isCheckable,
48 const char* theMenuSourceText,
49 const int theMenuPosition = 10) = 0;
51 //! Insert separator into Edit menu of SALOME desktop
52 virtual void addDesktopMenuSeparator(const char* theMenuSourceText,
53 const int theMenuPosition = 10) = 0;
55 //! Returns desktop window of SALOME
56 virtual QMainWindow* desktop() const = 0;
58 //! Returns command string Id by QAction instance
59 virtual QString commandId(const QAction* theCmd) const = 0;
61 //! Returns QAction instance by command string Id
62 virtual QAction* command(const QString& theId) const = 0;
64 //! Returns list of defined actions (just by NewGeom module)
65 virtual QList<QAction*> commandList() const = 0;
67 //! Returns list of Ids of defined actions (just by NewGeom module)
68 virtual QStringList commandIdList() const = 0;
70 //! Set nested actions dependent on command Id
71 //! \param theId - the command ID
72 //! \param theActions - the list of nested actions
73 virtual void setNestedActions(const QString& theId, const QStringList& theActions) = 0;
75 //! Returns list of nested actions according to the given command ID
76 virtual QStringList nestedActions(const QString& theId) const = 0;
78 //! Set the document kind of the action by the given command Id
79 //! \param theId - the command ID
80 //! \param theKind - the document kind
81 virtual void setDocumentKind(const QString& theId, const QString& theKind) = 0;
83 //! Returns the document kind of the action by the given command ID
84 virtual QString documentKind(const QString& theId) const = 0;
86 //! Returns interface to Salome viewer
87 virtual ModuleBase_IViewer* viewer() const = 0;
89 //! Create preferences
90 virtual void createPreferences() = 0;