COPASI API  4.16.103
TaskWidget.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/UI/TaskWidget.h,v $
3  $Revision: 1.29 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2011/10/14 15:07:45 $
7  End CVS Header */
8 
9 // Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
20 // Properties, Inc. and EML Research, gGmbH.
21 // All rights reserved.
22 
23 #ifndef TASKWIDGET_H
24 #define TASKWIDGET_H
25 
26 #include <QtCore/QVariant>
27 
28 #include <QtGui/QGridLayout>
29 #include <QtGui/QTableWidget>
30 #include <QtGui/QLabel>
31 
32 #include "copasi/copasi.h"
33 
35 #include "copasi/UI/copasiWidget.h"
36 
37 class CQTaskThread;
38 class QCheckBox;
39 class QComboBox;
40 class QLabel;
41 class QLineEdit;
42 class QPushButton;
43 class QSpacerItem;
44 
45 class CQTaskHeaderWidget;
46 class CQTaskMethodWidget;
47 class CQTaskBtnWidget;
48 
49 class CCopasiTask;
50 
51 //class CModel;
52 class CProgressBar;
53 
54 class CopasiPlot;
55 class CCopasiException;
56 
57 class TaskWidget : public CopasiWidget
58 {
59  Q_OBJECT
60 
61 public:
62  TaskWidget(QWidget* parent = 0,
63  const char* name = 0,
64  Qt::WFlags fl = 0);
65 
66  ~TaskWidget();
67 
68  //the TaskWidget interface
70  ListViews::Action action,
71  const std::string & key);
72 
73  virtual bool leave();
74 
75  virtual bool runTask() = 0;
76 
78 
79 protected slots:
80  void runBtnClicked();
81 
82  void revertBtnClicked();
83 
84  void reportBtnClicked();
85 
86  void assistantBtnClicked();
87 
88 public slots:
89 
90  void adjustTable();
91 
92  void slotFinishThread();
93 
94 protected:
95  virtual bool enterProtected();
96 
97  virtual bool loadTask() = 0;
98 
99  virtual bool saveTask() = 0;
100 
101  virtual CCopasiMethod * createMethod(const CCopasiMethod::SubType & type) = 0;
102 
103  //these methods should be called by the loadTask() or saveTask() methods
104  //of the derived classes. They handle the "executable" checkbox
105  bool loadCommon();
106  bool saveCommon();
107 
108  bool loadMethod();
109  bool saveMethod();
110  virtual bool taskFinishedEvent();
111 
112 
113  //this method should be called at the beginning or the end of the runTask() method
114  //of the derived classes, respectively
115  bool commonBeforeRunTask();
116  bool commonAfterRunTask();
117 
118  bool commonRunTask();
119  void finishTask();
120 
125  QGridLayout * mpMethodLayout;
126 
127  QSpacerItem * mpSpacer1;
128  QSpacerItem * mpSpacer2;
129 
132 
133  bool mChanged;
135 };
136 
137 #endif
bool saveMethod()
Definition: TaskWidget.cpp:308
QGridLayout * mpMethodLayout
Definition: TaskWidget.h:125
objectType
bool loadCommon()
Definition: TaskWidget.cpp:247
virtual bool leave()
Definition: TaskWidget.cpp:542
void finishTask()
Definition: TaskWidget.cpp:474
virtual bool loadTask()=0
void runBtnClicked()
Definition: TaskWidget.cpp:208
QSpacerItem * mpSpacer1
Definition: TaskWidget.h:127
QSpacerItem * mpSpacer2
Definition: TaskWidget.h:128
bool saveCommon()
Definition: TaskWidget.cpp:258
CCopasiTask * getTask()
Definition: TaskWidget.cpp:513
bool loadMethod()
Definition: TaskWidget.cpp:284
CProgressBar * mProgressBar
Definition: TaskWidget.h:121
virtual bool update(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
Definition: TaskWidget.cpp:519
bool commonAfterRunTask()
Definition: TaskWidget.cpp:365
bool mChanged
Definition: TaskWidget.h:133
virtual bool taskFinishedEvent()
Definition: TaskWidget.cpp:508
virtual CCopasiMethod * createMethod(const CCopasiMethod::SubType &type)=0
CCopasiTask * mpTask
Definition: TaskWidget.h:130
void assistantBtnClicked()
Definition: TaskWidget.cpp:228
CQTaskMethodWidget * mpMethodWidget
Definition: TaskWidget.h:123
void slotFinishThread()
Definition: TaskWidget.cpp:455
void revertBtnClicked()
Definition: TaskWidget.cpp:193
void adjustTable()
Definition: TaskWidget.cpp:293
bool commonRunTask()
Definition: TaskWidget.cpp:395
CQTaskBtnWidget * mpBtnWidget
Definition: TaskWidget.h:124
CQTaskHeaderWidget * mpHeaderWidget
Definition: TaskWidget.h:122
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
CQTaskThread * mpTaskThread
Definition: TaskWidget.h:134
void reportBtnClicked()
Definition: TaskWidget.cpp:216
virtual bool enterProtected()
Definition: TaskWidget.cpp:547
CCopasiMethod * mpMethod
Definition: TaskWidget.h:131
bool commonBeforeRunTask()
Definition: TaskWidget.cpp:317
virtual bool saveTask()=0
virtual bool runTask()=0
TaskWidget(QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
Definition: TaskWidget.cpp:52