1 // Copyright (C) 2006-2008 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef _GENERICGUI_HXX_
20 #define _GENERICGUI_HXX_
23 #include <QActionGroup>
25 #include <QMainWindow>
26 #include <QDockWidget>
29 #include "SuitWrapper.hxx"
51 class GenericGui: public QObject
56 GenericGui(YACS::HMI::SuitWrapper* wrapper, QMainWindow *parent = 0);
57 virtual ~GenericGui();
63 void showBaseMenus(bool show);
64 void showEditionMenus(bool show);
65 void showExecMenus(bool show);
66 void switchContext(QWidget *view);
67 void showDockWidgets(bool isVisible);
69 CatalogWidget* getCatalogWidget() { return _catalogsWidget; };
70 std::list<std::string> getMachineList();
72 QAction *_newSchemaAct;
73 QAction *_importSchemaAct;
74 QAction *_importSupervSchemaAct;
75 QAction *_exportSchemaAct;
76 QAction *_exportSchemaAsAct;
77 QAction *_importCatalogAct;
79 QAction *_runLoadedSchemaAct;
80 QAction *_loadRunStateSchemaAct;
81 QAction *_loadAndRunSchemaAct;
83 QAction *_startResumeAct;
88 QAction *_saveRunStateAct;
89 QAction *_newEditionAct;
91 QActionGroup *_execModeGroup;
92 QAction *_withoutStopModeAct;
93 QAction *_breakpointsModeAct;
94 QAction *_stepByStepModeAct;
96 QAction *_toggleStopOnErrorAct;
98 QAction *_getYacsContainerLogAct;
99 QAction *_getErrorReportAct;
100 QAction *_getErrorDetailsAct;
101 QAction *_getContainerLogAct;
103 QAction *_editDataTypesAct;
104 QAction *_createDataTypeAct;
105 QAction *_importDataTypeAct;
106 QAction *_newContainerAct;
107 QAction *_newSalomeComponentAct;
108 QAction *_newSalomePythonComponentAct;
109 QAction *_newCorbaComponentAct;
110 QAction *_salomeServiceNodeAct;
111 QAction *_serviceInlineNodeAct;
112 QAction *_CORBAServiceNodeAct;
113 QAction *_nodeNodeServiceNodeAct;
114 QAction *_cppNodeAct;
115 QAction *_XMLNodeAct;
116 QAction *_inDataNodeAct;
117 QAction *_outDataNodeAct;
118 QAction *_inStudyNodeAct;
119 QAction *_outStudyNodeAct;
120 QAction *_inlineScriptNodeAct;
121 QAction *_inlineFunctionNodeAct;
122 QAction *_blockNodeAct;
123 QAction *_FORNodeAct;
124 QAction *_FOREACHNodeAct;
125 QAction *_WHILENodeAct;
126 QAction *_SWITCHNodeAct;
127 QAction *_nodeFromCatalogAct;
128 QAction *_deleteItemAct;
129 QAction *_cutItemAct;
130 QAction *_copyItemAct;
131 QAction *_pasteItemAct;
132 QAction *_arrangeLocalNodesAct;
133 QAction *_arrangeRecurseNodesAct;
134 QAction *_computeLinkAct;
135 QAction *_toggleAutomaticComputeLinkAct;
136 QAction *_toggleSimplifyLinkAct;
137 QAction *_toggleForce2NodesLinkAct;
138 QAction *_toggleSceneItemVisibleAct;
139 QAction *_selectReferenceAct;
140 QAction *_whatsThisAct;
142 YACS::HMI::GuiEditor *_guiEditor;
145 void onCleanOnExit();
148 int getMenuId() { return _menuId++; }
149 void createContext(YACS::ENGINE::Proc* proc,
150 const QString& schemaName,
151 const QString& runName,
153 void setLoadedPresentation(YACS::ENGINE::Proc* proc);
154 QString getSaveFileName(const QString& fileName = QString());
156 YACSGuiLoader *_loader;
157 SuitWrapper* _wrapper;
158 QMainWindow* _parent;
159 QDockWidget* _dwTree;
160 QDockWidget* _dwStacked;
161 QDockWidget* _dwCatalogs;
162 YACS::ENGINE::Catalog* _builtinCatalog;
163 YACS::ENGINE::Catalog* _sessionCatalog;
164 CatalogWidget* _catalogsWidget;
165 std::map<QWidget*, YACS::HMI::QtGuiContext*> _mapViewContext;
169 std::list<std::string> _machineList;
174 void onImportSchema();
175 void onImportSupervSchema();
176 void onExportSchema();
177 void onExportSchemaAs();
178 void onImportCatalog();
180 void onRunLoadedSchema(bool withState = false);
181 void onLoadRunStateSchema();
182 void onLoadAndRunSchema();
184 void onStartResume();
188 void onSaveRunState();
191 void onWithoutStopMode(bool checked);
192 void onBreakpointsMode(bool checked);
193 void onStepByStepMode(bool checked);
195 void onToggleStopOnError(bool checked);
197 void onGetYacsContainerLog();
198 void onGetErrorReport();
199 void onGetErrorDetails();
200 void onGetContainerLog();
202 void onEditDataTypes();
203 void onCreateDataType();
204 void onImportDataType();
206 void onNewContainer();
207 void onNewSalomeComponent();
208 void onNewSalomePythonComponent();
209 void onNewCorbaComponent();
211 void onSalomeServiceNode();
212 void onServiceInlineNode();
213 void onCORBAServiceNode();
214 void onNodeNodeServiceNode();
218 void onOutDataNode();
219 void onInStudyNode();
220 void onOutStudyNode();
221 void onInlineScriptNode();
222 void onInlineFunctionNode();
225 void onFOREACHNode();
228 void onNodeFromCatalog();
235 void onArrangeLocalNodes();
236 void onArrangeRecurseNodes();
237 void onRebuildLinks();
238 void onToggleAutomaticComputeLinks(bool checked);
239 void onToggleSimplifyLinks(bool checked);
240 void onToggleForce2NodesLinks(bool checked);
242 void onToggleSceneItemVisible(bool checked);
244 void onSelectReference();