]> SALOME platform Git repositories - modules/yacs.git/blob - src/salomewrap/SuitWrapper.hxx
Salome HOME
9ce3234f5104fff462d7514ed7f2e1ccbcf4433f
[modules/yacs.git] / src / salomewrap / SuitWrapper.hxx
1 // Copyright (C) 2006-2016  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 _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       QDockWidget* objectBrowser();
51
52       QAction* createAction(const int id,
53                             const QString& toolTip,
54                             const QIcon& icon,
55                             const QString& menu,
56                             const QString& status,
57                             const int shortCut,
58                             QObject* parent =0,
59                             bool checkable = false,
60                             QObject* receiver =0,
61                             const char* member =0);
62       
63       int createMenu(const QString& subMenu,
64                      const int parentMenuId,
65                      const int menuId = -1,
66                      const int groupId = -1,
67                      const int index = -1);
68
69       int createMenu(const QString& subMenu,
70                      const QString& parentMenu,
71                      const int menuId = -1,
72                      const int groupId = -1,
73                      const int index = -1);
74
75       int createMenu(const int actionId,
76                      const int menuId,
77                      const int groupId = -1,
78                      const int index = -1);
79
80       int createMenu(const int actionId,
81                      const QString& menu,
82                      const int groupId = -1,
83                      const int index = -1);
84
85       int createMenu(QAction* action,
86                      const int menuId,
87                      const int actionId = -1,
88                      const int groupId = -1,
89                      const int index = -1);
90
91       int createMenu(QAction* action,
92                      const QString& menu,
93                      const int actionId = -1,
94                      const int groupId = -1,
95                      const int index = -1);
96
97       int createTool(const QString& title,
98                      const QString& name = QString());
99
100       int createTool(const int actionId,
101                      const int toolbarId, 
102                      const int index = -1);
103
104       int createTool(const int actionId,
105                      const QString& toolbar,
106                      const int index = -1);
107
108       int createTool(QAction* action, 
109                      const int toolbarId,
110                      const int actionId = -1,
111                      const int index = -1);
112
113       int createTool(QAction* action,
114                      const QString& toolbar,
115                      const int actionId = -1,
116                      const int index = -1);
117
118       static QAction* separator();
119
120       void setMenuShown(QAction* act, bool show);
121       void setToolShown(QAction* act, bool show);
122
123       void createNewSchema(const QString& schemaName,
124                            QWidget* viewWindow);
125       bool renameSchema(const QString& oldName,
126                         const QString& newName,
127                         QWidget* viewWindow);
128       bool deleteSchema(QWidget* viewWindow);
129       void createNewRun(const QString& schemaName,
130                         const QString& runName,
131                         QWidget* refWindow,
132                         QWidget* viewWindow);
133       QStringList getQuickDirList();
134       virtual void onHelpContextModule( const QString&, const QString&, const QString& = QString() );
135
136     protected: 
137       QObject* _wrapped; // SalomeApp_module or Standalone Application
138
139     };
140   }
141 }
142 #endif