]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_SalomeConnector.h
Salome HOME
d055e67c37f13bdd2758cc7c4e878ed6feaf0deb
[modules/shaper.git] / src / XGUI / XGUI_SalomeConnector.h
1 #ifndef XGUI_SALOMECONNECTOR_H
2 #define XGUI_SALOMECONNECTOR_H
3
4 #include "XGUI.h"
5
6 #include <QString>
7 #include <QStringList>
8
9 class QMainWindow;
10 class ModuleBase_IViewer;
11
12 /**
13  * An interface which provides a connection of XGUI functionality 
14  * with functionality of SALOME module interface.
15  */
16 class XGUI_EXPORT XGUI_SalomeConnector
17 {
18  public:
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, const QString& theId,
29                               const QString& theTitle, const QString& theTip, const QIcon& theIcon,
30                               const QKeySequence& theKeys, bool isCheckable) = 0;
31
32   //! Creates a command in Edit menu of SALOME desktop
33   //! \param theId - an id of the feature
34   //! \param theTitle - a menu item string
35   //! \param theTip - a tooltip string (help)
36   //! \param theIcon - icon
37   //! \param isCheckable - is checkable or not
38   //! \param theKeys - hot keys
39   //! \param theMenuSourceText - a source text of the desktop menu
40   //! \param theMenuPosition - a position of the command in the desktop menu
41   //! returns created action
42   virtual QAction* addDesktopCommand(const QString& theId, const QString& theTitle,
43                                      const QString& theTip, const QIcon& theIcon,
44                                      const QKeySequence& theKeys, bool isCheckable,
45                                      const char* theMenuSourceText,
46                                      const int theMenuPosition = 10) = 0;
47
48   //! Insert separator into Edit menu of SALOME desktop
49   virtual void addDesktopMenuSeparator(const char* theMenuSourceText,
50                                        const int theMenuPosition = 10) = 0;
51
52   //! Returns desktop window of SALOME
53   virtual QMainWindow* desktop() const = 0;
54
55   //! Returns command string Id by QAction instance
56   virtual QString commandId(const QAction* theCmd) const = 0;
57
58   //! Returns QAction instance by command string Id
59   virtual QAction* command(const QString& theId) const = 0;
60
61   //! Returns list of defined actions (just by NewGeom module)
62   virtual QList<QAction*> commandList() const = 0;
63
64   //! Returns list of Ids of defined actions (just by NewGeom module)
65   virtual QStringList commandIdList() const = 0;
66
67   //! Set nested actions dependent on command Id
68   //! \param theId - the command ID
69   //! \param theActions - the list of nested actions
70   virtual void setNestedActions(const QString& theId, const QStringList& theActions) = 0;
71
72   //! Returns list of nested actions according to the given command ID
73   virtual QStringList nestedActions(const QString& theId) const = 0;
74
75   //! Set the document kind of the action by the given command Id
76   //! \param theId - the command ID
77   //! \param theKind - the document kind
78   virtual void setDocumentKind(const QString& theId, const QString& theKind) = 0;
79
80   //! Returns the document kind of the action by the given command ID
81   virtual QString documentKind(const QString& theId) const = 0;
82
83   //! Returns interface to Salome viewer
84   virtual ModuleBase_IViewer* viewer() const = 0;
85
86   virtual void createPreferences() = 0;
87 };
88
89 #endif