Salome HOME
Merge branch 'master' of newgeom:newgeom
[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 <AIS_InteractiveContext.hxx>
7 #include <QString>
8
9 class QMainWindow;
10
11 /**
12 * An interface which provides a connection of XGUI functionality 
13 * with functionality of SALOME module interface.
14 */
15 class XGUI_EXPORT XGUI_SalomeConnector
16 {
17 public:
18   //! Creates a feature (command) in SALOME desktop
19   //! \param theWBName - a workbench name
20   //! \param theId - an id of the feature
21   //! \param theTitle - a menu item string
22   //! \param theTip - a tooltip string (help)
23   //! \param theIcon - icon
24   //! \param isCheckable - is checkable or not
25   //! \param reciever - QObject which will react on the command call
26   //! \param member - a method of receiver which will be called on the command
27   //! \param theKeys - hot keys
28   virtual void addFeature(const QString& theWBName,
29                           const QString& theId, 
30                           const QString& theTitle, 
31                           const QString& theTip,
32                           const QIcon& theIcon, 
33                           bool isCheckable,
34                           QObject* reciever,
35                           const char* member,
36                           const QKeySequence& theKeys) = 0;
37
38   //! Creates a command in Edit menu of SALOME desktop
39   //! \param theId - an id of the feature
40   //! \param theTitle - a menu item string
41   //! \param theTip - a tooltip string (help)
42   //! \param theIcon - icon
43   //! \param isCheckable - is checkable or not
44   //! \param reciever - QObject which will react on the command call
45   //! \param member - a method of receiver which will be called on the command
46   //! \param theKeys - hot keys
47   virtual void addEditCommand(const QString& theId,
48                               const QString& theTitle,
49                               const QString& theTip,
50                               const QIcon& theIcon, 
51                               bool isCheckable,
52                               QObject* reciever,
53                               const char* member,
54                               const QKeySequence& theKeys) = 0;
55
56   //! Insert separator into Edit menu of SALOME desktop
57   virtual void addEditMenuSeparator() = 0;
58
59   //! Returns desktop window of SALOME
60   virtual QMainWindow* desktop() const = 0;
61
62   //! Returns command string Id by QAction instance
63   virtual QString commandId(const QAction* theCmd) const = 0;
64
65   //! Returns QAction instance by command string Id
66   virtual QAction* command(const QString& theId) const = 0;
67
68   //! Returns AIS_InteractiveContext from current OCCViewer
69   virtual Handle(AIS_InteractiveContext) AISContext() const = 0;
70 };
71
72 #endif