Salome HOME
a55398cb15ef6db5ab732f78739dd6ecd0411e4b
[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 XGUI_SalomeViewer;
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 reciever - QObject which will react on the command call
27   //! \param member - a method of receiver which will be called on the command
28   //! \param theKeys - hot keys
29   virtual void addFeature(const QString& theWBName,
30                           const QString& theId, 
31                           const QString& theTitle, 
32                           const QString& theTip,
33                           const QIcon& theIcon, 
34                           bool isCheckable,
35                           QObject* reciever,
36                           const char* member,
37                           const QKeySequence& theKeys) = 0;
38
39   //! Creates a command in Edit menu of SALOME desktop
40   //! \param theId - an id of the feature
41   //! \param theTitle - a menu item string
42   //! \param theTip - a tooltip string (help)
43   //! \param theIcon - icon
44   //! \param isCheckable - is checkable or not
45   //! \param reciever - QObject which will react on the command call
46   //! \param member - a method of receiver which will be called on the command
47   //! \param theKeys - hot keys
48   virtual void addEditCommand(const QString& theId,
49                               const QString& theTitle,
50                               const QString& theTip,
51                               const QIcon& theIcon, 
52                               bool isCheckable,
53                               QObject* reciever,
54                               const char* member,
55                               const QKeySequence& theKeys) = 0;
56
57   //! Insert separator into Edit menu of SALOME desktop
58   virtual void addEditMenuSeparator() = 0;
59
60   //! Returns desktop window of SALOME
61   virtual QMainWindow* desktop() const = 0;
62
63   //! Returns command string Id by QAction instance
64   virtual QString commandId(const QAction* theCmd) const = 0;
65
66   //! Returns QAction instance by command string Id
67   virtual QAction* command(const QString& theId) const = 0;
68
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;
73
74   //! Returns list of nested actions according to the given command ID
75   virtual QStringList nestedActions(const QString& theId) const = 0;
76
77   //! Returns interface to Salome viewer
78   virtual XGUI_SalomeViewer* viewer() const = 0;
79 };
80
81 #endif