Salome HOME
Merge from V6_main 01/04/2013
[modules/yacs.git] / src / salomewrap / SuitWrapper.hxx
1 // Copyright (C) 2006-2013  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
20 #ifndef _SUITWRAPPER_HXX_
21 #define _SUITWRAPPER_HXX_
22
23 #include "SalomeWrapExport.hxx"
24
25 #include <QAction>
26 #include <QString>
27 #include <QIcon>
28 #include <QObject>
29 #include <QWidget>
30 #include <QDockWidget>
31 #include <QGraphicsScene>
32
33 namespace YACS
34 {
35   namespace HMI
36   {
37     //! viewer QGraphicsScene: deriver SUIT_ViewModel comme QxGraph_Viewer
38     //                         deriver idem SUIT_ViewManager et SUIT_ViewWindows
39
40     //! wrapping for SalomeApp_Module
41
42     class SALOMEWRAP_EXPORT SuitWrapper
43     {
44       
45     public:
46       SuitWrapper(QObject* wrapped);
47       virtual ~SuitWrapper();
48
49       QWidget* getNewWindow(QGraphicsScene *scene);
50       int AssociateViewToWindow(QGraphicsView* gView, QWidget* viewWindow);
51       int activeStudyId();
52       QDockWidget* objectBrowser();
53
54       QAction* createAction(const int id,
55                             const QString& toolTip,
56                             const QIcon& icon,
57                             const QString& menu,
58                             const QString& status,
59                             const int shortCut,
60                             QObject* parent =0,
61                             bool checkable = false,
62                             QObject* receiver =0,
63                             const char* member =0);
64       
65       int createMenu(const QString& subMenu,
66                      const int parentMenuId,
67                      const int menuId = -1,
68                      const int groupId = -1,
69                      const int index = -1);
70
71       int createMenu(const QString& subMenu,
72                      const QString& parentMenu,
73                      const int menuId = -1,
74                      const int groupId = -1,
75                      const int index = -1);
76
77       int createMenu(const int actionId,
78                      const int menuId,
79                      const int groupId = -1,
80                      const int index = -1);
81
82       int createMenu(const int actionId,
83                      const QString& menu,
84                      const int groupId = -1,
85                      const int index = -1);
86
87       int createMenu(QAction* action,
88                      const int menuId,
89                      const int actionId = -1,
90                      const int groupId = -1,
91                      const int index = -1);
92
93       int createMenu(QAction* action,
94                      const QString& menu,
95                      const int actionId = -1,
96                      const int groupId = -1,
97                      const int index = -1);
98
99       int createTool(const QString& name);
100
101       int createTool(const int actionId,
102                      const int toolbarId, 
103                      const int index = -1);
104
105       int createTool(const int actionId,
106                      const QString& toolbar,
107                      const int index = -1);
108
109       int createTool(QAction* action, 
110                      const int toolbarId,
111                      const int actionId = -1,
112                      const int index = -1);
113
114       int createTool(QAction* action,
115                      const QString& toolbar,
116                      const int actionId = -1,
117                      const int index = -1);
118
119       static QAction* separator();
120
121       void setMenuShown(QAction* act, bool show);
122       void setToolShown(QAction* act, bool show);
123
124       void createNewSchema(const QString& schemaName,
125                            QWidget* viewWindow);
126       bool renameSchema(const QString& oldName,
127                         const QString& newName,
128                         QWidget* viewWindow);
129       bool deleteSchema(QWidget* viewWindow);
130       void createNewRun(const QString& schemaName,
131                         const QString& runName,
132                         QWidget* refWindow,
133                         QWidget* viewWindow);
134       QStringList getQuickDirList();
135       virtual void onHelpContextModule( const QString&, const QString&, const QString& = QString() );
136
137     protected: 
138       QObject* _wrapped; // SalomeApp_module or Standalone Application
139
140     };
141   }
142 }
143 #endif