Salome HOME
Updated copyright comment
[modules/med.git] / src / MEDCalc / gui / TestController.hxx
1 // Copyright (C) 2016-2024  CEA, EDF
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   bool isMainEventLoopStarted() const { return _myEventLoopStarted; }
44
45   bool eventFilter(QObject *obj, QEvent *event);
46   
47 protected:
48   virtual void customEvent(QEvent * event);
49
50 public slots:
51   void processWorkspaceEvent(const MEDCALC::MedEvent* event);
52
53   void onRecordTest();
54   void onPlayTest();
55 //  void onPlayTestFile();
56   void onLockViewSize() const;
57   void onTakeSnapshot() const;
58   void onRequestTermination();
59
60 protected:
61   MEDModule* _salomeModule;
62   SUIT_Desktop * _desk;
63
64   pqTestUtility * _tester;
65   QAction * _lock_action;
66
67 private slots:
68   void onMainEventLoopStarting();
69
70 private:
71   const int _playEventType;
72   const int _quitEventType;
73
74   bool _aboutToPlayTest;
75
76   bool _myEventLoopStarted;
77 };
78
79 #endif /* SRC_MEDCALC_GUI_TESTCONTROLLER_HXX_ */