Salome HOME
Merge branch 'V9_9_BR'
[modules/yacs.git] / src / salomewrap / SalomeWrap_Module.hxx
1 // Copyright (C) 2006-2022  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _SALOMEWRAP_MODULE_HXX_
21 #define _SALOMEWRAP_MODULE_HXX_
22
23 #include "SalomeWrapExport.hxx"
24
25 #include <SalomeApp_Module.h>
26 #include <SALOMEconfig.h>
27
28 #include <QGraphicsScene>
29 #include <QGraphicsView>
30 #include <QDockWidget>
31
32 #include <map>
33
34 class SalomeApp_Application;
35 class QxScene_ViewWindow;
36
37 class SalomeWrap_DataModel;
38
39 class SALOMEWRAP_EXPORT SalomeWrap_Module: public SalomeApp_Module
40 {
41   Q_OBJECT
42
43 public:
44   SalomeWrap_Module(const char* name);
45
46   QxScene_ViewWindow* getNewWindow(QGraphicsScene *scene);
47
48   void AssociateViewToWindow(QGraphicsView* gView,
49                             QxScene_ViewWindow* viewWindow);
50
51   QDockWidget* objectBrowser();
52
53   QAction* wCreateAction(const int id,
54                          const QString& toolTip,
55                          const QIcon& icon,
56                          const QString& menu,
57                          const QString& status,
58                          const int shortCut,
59                          QObject* parent =0,
60                          bool checkable = false,
61                          QObject* receiver =0,
62                          const char* member =0);
63       
64   int wCreateMenu(const QString& subMenu,
65                   const int parentMenuId,
66                   const int menuId = -1,
67                   const int groupId = -1,
68                   const int index = -1);
69
70   int wCreateMenu(const QString& subMenu,
71                   const QString& parentMenu,
72                   const int menuId = -1,
73                   const int groupId = -1,
74                   const int index = -1);
75
76   int wCreateMenu(const int actionId,
77                   const int menuId,
78                   const int groupId = -1,
79                   const int index = -1);
80
81   int wCreateMenu(const int actionId,
82                   const QString& menu,
83                   const int groupId = -1,
84                   const int index = -1);
85
86   int wCreateMenu(QAction* action,
87                   const int menuId,
88                   const int actionId = -1,
89                   const int groupId = -1,
90                   const int index = -1);
91
92   int wCreateMenu(QAction* action,
93                   const QString& menu,
94                   const int actionId = -1,
95                   const int groupId = -1,
96                   const int index = -1);
97
98   int wCreateTool(const QString& title,
99                   const QString& name = QString());
100
101   int wCreateTool(const int actionId,
102                   const int toolbarId, 
103                   const int index = -1);
104
105   int wCreateTool(const int actionId,
106                   const QString& toolbar,
107                   const int index = -1);
108
109   int wCreateTool(QAction* action, 
110                   const int toolbarId,
111                   const int actionId = -1,
112                   const int index = -1);
113
114   int wCreateTool(QAction* action,
115                   const QString& toolbar,
116                   const int actionId = -1,
117                   const int index = -1);
118
119   static QAction* wSeparator();
120
121   SalomeWrap_DataModel* getDataModel();
122
123 protected:
124   virtual  CAM_DataModel* createDataModel();
125
126   std::map<QGraphicsScene*, QxScene_ViewWindow*> _mapOfViewWindow;
127
128 };
129
130 #endif