Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / src / salomewrap / SalomeWrap_Module.hxx
1 //  Copyright (C) 2006-2008  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.
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 #ifndef _SALOMEWRAP_MODULE_HXX_
20 #define _SALOMEWRAP_MODULE_HXX_
21
22 #include <SalomeApp_Module.h>
23 #include <SALOMEconfig.h>
24
25 #include <QGraphicsScene>
26 #include <QGraphicsView>
27
28 #include <map>
29
30 class SalomeApp_Application;
31 class QxScene_ViewWindow;
32
33 class SalomeWrap_DataModel;
34
35 class SalomeWrap_Module: public SalomeApp_Module
36 {
37   Q_OBJECT
38
39 public:
40   SalomeWrap_Module(const char* name);
41
42   QxScene_ViewWindow* getNewWindow(QGraphicsScene *scene);
43
44   int AssociateViewToWindow(QGraphicsView* gView,
45                             QxScene_ViewWindow* viewWindow);
46
47   int activeStudyId();
48
49   QAction* wCreateAction(const int id,
50                          const QString& toolTip,
51                          const QIcon& icon,
52                          const QString& menu,
53                          const QString& status,
54                          const int shortCut,
55                          QObject* parent =0,
56                          bool checkable = false,
57                          QObject* receiver =0,
58                          const char* member =0);
59       
60   int wCreateMenu(const QString& subMenu,
61                   const int parentMenuId,
62                   const int menuId = -1,
63                   const int groupId = -1,
64                   const int index = -1);
65
66   int wCreateMenu(const QString& subMenu,
67                   const QString& parentMenu,
68                   const int menuId = -1,
69                   const int groupId = -1,
70                   const int index = -1);
71
72   int wCreateMenu(const int actionId,
73                   const int menuId,
74                   const int groupId = -1,
75                   const int index = -1);
76
77   int wCreateMenu(const int actionId,
78                   const QString& menu,
79                   const int groupId = -1,
80                   const int index = -1);
81
82   int wCreateMenu(QAction* action,
83                   const int menuId,
84                   const int actionId = -1,
85                   const int groupId = -1,
86                   const int index = -1);
87
88   int wCreateMenu(QAction* action,
89                   const QString& menu,
90                   const int actionId = -1,
91                   const int groupId = -1,
92                   const int index = -1);
93
94   int wCreateTool(const QString& name);
95
96   int wCreateTool(const int actionId,
97                   const int toolbarId, 
98                   const int index = -1);
99
100   int wCreateTool(const int actionId,
101                   const QString& toolbar,
102                   const int index = -1);
103
104   int wCreateTool(QAction* action, 
105                   const int toolbarId,
106                   const int actionId = -1,
107                   const int index = -1);
108
109   int wCreateTool(QAction* action,
110                   const QString& toolbar,
111                   const int actionId = -1,
112                   const int index = -1);
113
114   static QAction* wSeparator();
115
116   SalomeWrap_DataModel* getDataModel();
117
118 protected:
119   virtual  CAM_DataModel* createDataModel();
120
121   std::map<QGraphicsScene*, QxScene_ViewWindow*> _mapOfViewWindow;
122 };
123
124 #endif