]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_SalomeConnector.h
Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom.git into Dev_0.7.1
[modules/shaper.git] / src / XGUI / XGUI_SalomeConnector.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 #ifndef XGUI_SALOMECONNECTOR_H
4 #define XGUI_SALOMECONNECTOR_H
5
6 #include "XGUI.h"
7
8 #include <QString>
9 #include <QStringList>
10
11 class QMainWindow;
12 class ModuleBase_IViewer;
13
14 /**
15  * \ingroup GUI
16  * An interface which provides a connection of XGUI functionality 
17  * with functionality of SALOME module interface.
18  */
19 class XGUI_EXPORT XGUI_SalomeConnector
20 {
21  public:
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;
34
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;
50
51   //! Insert separator into Edit menu of SALOME desktop
52   virtual void addDesktopMenuSeparator(const char* theMenuSourceText,
53                                        const int theMenuPosition = 10) = 0;
54
55   //! Returns desktop window of SALOME
56   virtual QMainWindow* desktop() const = 0;
57
58   //! Returns command string Id by QAction instance
59   virtual QString commandId(const QAction* theCmd) const = 0;
60
61   //! Returns QAction instance by command string Id
62   virtual QAction* command(const QString& theId) const = 0;
63
64   //! Returns list of defined actions (just by NewGeom module)
65   virtual QList<QAction*> commandList() const = 0;
66
67   //! Returns list of Ids of defined actions (just by NewGeom module)
68   virtual QStringList commandIdList() const = 0;
69
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;
74
75   //! Returns list of nested actions according to the given command ID
76   virtual QStringList nestedActions(const QString& theId) const = 0;
77
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;
82
83   //! Returns the document kind of the action by the given command ID
84   virtual QString documentKind(const QString& theId) const = 0;
85
86   //! Returns interface to Salome viewer
87   virtual ModuleBase_IViewer* viewer() const = 0;
88
89   //! Create preferences
90   virtual void createPreferences() = 0;
91 };
92
93 #endif