Salome HOME
Test scenario playback made cleaner and less path dependent.
[modules/med.git] / src / MEDCalc / gui / TestController.hxx
1 // Copyright (C) 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 SRC_MEDCALC_GUI_TESTCONTROLLER_HXX_
21 #define SRC_MEDCALC_GUI_TESTCONTROLLER_HXX_
22
23 #include <QObject>
24 #include <QString>
25
26 class pqTestUtility;
27 class MEDModule;
28 class SUIT_Desktop;
29 class QAction;
30 namespace MEDCALC {
31   class MedEvent;
32 };
33
34 class TestController: public QObject {
35   Q_OBJECT
36
37 public:
38   TestController(MEDModule* mod);
39   virtual ~TestController();
40
41   void createActions();
42
43
44
45 protected:
46   virtual void customEvent(QEvent * event);
47
48 public slots:
49   void processWorkspaceEvent(const MEDCALC::MedEvent* event);
50
51   void onRecordTest();
52   void onPlayTest();
53 //  void onPlayTestFile();
54   void onLockViewSize() const;
55   void onTakeSnapshot() const;
56   void onRequestTermination();
57
58 protected:
59   MEDModule* _salomeModule;
60   SUIT_Desktop * _desk;
61
62   pqTestUtility * _tester;
63   QAction * _lock_action;
64
65 private:
66   const int _playEventType;
67   const int _quitEventType;
68
69   bool _aboutToPlayTest;
70 };
71
72 #endif /* SRC_MEDCALC_GUI_TESTCONTROLLER_HXX_ */