17 #include <QtGui/QMainWindow>
18 #include <QtCore/QModelIndex>
19 #include <QtCore/QMap>
20 #include <QtCore/QPointer>
22 #ifdef COPASI_SBW_INTEGRATION
23 # include <QtGui/QApplication>
24 # include <QtCore/QEvent>
25 # include <QtCore/QMutex>
26 # include <QtCore/QWaitCondition>
28 # define WIN32_LEAN_AND_MEAN
34 using namespace SystemsBiologyWorkbench;
37 #endif // COPASI_SBW_INTEGRATION
55 #ifdef COPASI_SBW_INTEGRATION
58 #endif // COPASI_SBW_INTEGRATION
68 static bool isMainThread();
76 void checkPendingMessages();
77 void suspendAutoSave(
const bool & suspend);
86 void disableSliders(
bool disable);
93 void importSBMLFromString(
const std::string & sbmlDocumentText);
95 void exportSBMLToString(std::string & SBML);
104 void importSEDMLFromString(
const std::string & sedmlDocumentText);
106 void exportSEDMLToString(std::string & SEDML);
109 void addWindow(QMainWindow * pWindow);
110 void removeWindow(QMainWindow * pWindow);
112 void setMessageShown(
const bool & shown);
114 const bool & messageShown()
const;
119 const QList< QPointer<QMainWindow> >& getWindows()
const;
122 void signalLoadFile(QString newFile);
126 virtual void closeEvent(QCloseEvent* e);
131 void dragEnterEvent(QDragEnterEvent *event);
132 void dropEvent(QDropEvent *event);
135 void slotShowSliders(
bool flag);
141 void slotObjectBrowserDialogWasClosed();
145 void openInitialDocument(
const QString & file);
147 void slotFileOpen(QString file = QString::null);
150 void slotFileOpenFinished(
bool success);
151 void slotFileExamplesCopasiFiles(QString file = QString::null);
152 void slotFileExamplesSBMLFiles(QString file = QString::null);
154 void slotFileSaveAs(QString str = QString::null);
155 void slotFileSaveFinished(
bool success);
156 void slotFunctionDBSave(QString str = QString::null);
157 void slotFunctionDBLoad(QString str = QString::null);
159 void slotFilePrint();
160 void slotImportSBML(QString file = QString::null);
161 void slotImportSBMLFinished(
bool success);
162 void slotImportSBMLFromStringFinished(
bool success);
163 void slotExportSBML();
164 void slotExportSBMLFinished(
bool success);
165 void slotExportSBMLToStringFinished(
bool success);
166 void slotExportMathModel();
167 void slotExportMathModelFinished(
bool success);
168 void slotTutorialWizard();
173 void slotQuitFinished(
bool success);
174 void slotPreferences();
175 void slotConvertToIrreversible();
176 #ifdef WITH_PE_EVENT_CREATION
177 void slotCreateEventsForTimeseries();
179 void listViewsFolderChanged(
const QModelIndex & index);
180 void slotOpenRecentFile(QAction * pAction);
181 void slotOpenRecentSBMLFile(QAction * pAction);
182 void slotCheckModel();
183 void slotApplyInitialState();
184 void slotUpdateInitialState();
185 void slotFrameworkChanged(
int index);
187 void slotUpdateMIRIAM();
188 void slotUpdateMIRIAMFinished(
bool);
189 void slotExpandModel();
190 void slotFontSelection();
192 void slotCloseAllWindows();
193 void slotActivateWindowTriggered(QAction* action);
195 #ifdef WITH_MERGEMODEL
196 void slotAddFileOpen(QString file = QString::null);
197 void slotAddFileOpenFinished(
bool success);
198 void slotMergeModels();
202 void customEvent(QEvent *);
208 void slotShowObjectBrowserDialog(
bool flag);
212 void slotFileExamplesSEDMLFiles(QString file = QString::null);
213 void slotImportSEDML(QString file = QString::null);
214 void slotImportSEDMLFinished(
bool success);
215 void slotImportSEDMLFromStringFinished(
bool success);
216 void slotExportSEDML();
217 void slotExportSEDMLFinished(
bool success);
218 void slotExportSEDMLToStringFinished(
bool success);
219 void slotOpenRecentSEDMLFile(QAction * pAction);
225 void createActions();
226 void createToolBar();
227 void createMenuBar();
233 void setApplicationFont();
265 #ifdef WITH_MERGEMODEL
266 QAction* mpaAddModel;
267 QAction* mpaMergeModels;
282 void refreshRecentFileMenu();
283 void refreshWindowsMenu();
289 void refreshRecentSBMLFileMenu();
308 QMenu * mpMenuSEDMLSupport;
309 QAction* mpaImportSEDML;
310 QAction* mpaExportSEDML;
311 QAction* mpaOpenSEDMLFiles;
312 QMenu * mpMenuRecentSEDMLFiles;
313 QMap< QAction *, int > mRecentSEDMLFilesActionMap;
314 QActionGroup * mpRecentSEDMLFilesActionGroup;
315 void refreshRecentSEDMLFileMenu();
318 #ifdef COPASI_SBW_INTEGRATION
323 class QSBWSBMLEvent :
public QEvent
330 QSBWSBMLEvent(
const std::string & SBMLModel);
336 const std::string & getSBMLModel()
const;
348 class QSBWShutdownEvent:
public QEvent
355 SystemsBiologyWorkbench::DataBlockWriter sbwAnalysis(SystemsBiologyWorkbench::Module from,
356 SystemsBiologyWorkbench::DataBlockReader reader);
359 SystemsBiologyWorkbench::DataBlockWriter sbwGetSBML(SystemsBiologyWorkbench::Module from,
360 SystemsBiologyWorkbench::DataBlockReader reader);
363 void registerMethods(SystemsBiologyWorkbench::MethodTable<CopasiUI3Window> & table);
366 virtual void onShutdown();
377 void sbwDisconnect();
388 void sbwUnregister(
const std::string & moduleName)
const;
393 void sbwRefreshMenu();
401 std::vector< SystemsBiologyWorkbench::DataBlockReader > sbwFindServices(
const std::string & category,
402 const bool & recursive);
405 void sbwSlotMenuTriggered(QAction * pAction);
406 void sbwSlotMenuTriggeredFinished(
bool success);
407 void sbwSlotGetSBMLFinished(
bool success);
413 SystemsBiologyWorkbench::ModuleImpl * mpSBWModule;
418 QStringList mSBWAnalyzerModules;
423 QStringList mSBWAnalyzerServices;
428 QMap< QAction *, int > mSBWActionMap;
433 QActionGroup * mpSBWActionGroup;
443 QAction * mpSBWAction;
448 bool mSBWIgnoreShutdownEvent;
452 QWaitCondition mSBWWaitSlot;
454 bool mSBWCallFinished;
458 std::string mSBWDocumentString;
460 QStringList::size_type mSBWActionId;
462 #endif // COPASI_SBW_INTEGRATION
ObjectBrowserDialog * mpObjectBrowser
QActionGroup * mpWindowsActionGroup
SliderDialog(QWidget *parent, const char *name=0, bool modal=false, Qt::WFlags fl=0)
QAction * mpaUpdateInitialState
QAction * mpaFontSelectionDialog
QMenu * mpMenuRecentFiles
QActionGroup * mpRecentSBMLFilesActionGroup
QAction * mpaFunctionDBLoad
QAction * mpaOpenSBMLFiles
QComboBox * mpBoxSelectFramework
QMenu * mpMenuRecentSBMLFiles
bool mSliderDialogEnabled
QAction * mpaObjectBrowser
QAction * mpaCloseAllWindows
QAction * mpaFunctionDBSave
QActionGroup * mpRecentFilesActionGroup
static CopasiUI3Window * pMainWindow
QMap< QAction *, int > mRecentFilesActionMap
QAction * mpaOpenCopasiFiles
QAction * mpaApplyInitialState
QAction * mpaUpdateMIRIAM
CMIRIAMResources * mpMIRIAMResources
DataModelGUI * mpDataModelGUI
QMap< QAction *, int > mRecentSBMLFilesActionMap
QList< QPointer< QMainWindow > > mWindows