Salome HOME
Create validators for constraint operations
[modules/shaper.git] / src / PyInterp / PyInterp_Event.h
1
2
3 #ifndef PYINTERP_EVENT_H
4 #define PYINTERP_EVENT_H
5
6 #include "PyInterp.h"
7
8 #include <PyEvent_Event.h>
9
10 #include <QEvent>
11
12 class PyInterp_Request;
13
14 class PyInterp_ExecuteEvent: public PyEvent_Event
15 {
16 public:
17   PyInterp_ExecuteEvent( PyInterp_Request* r )
18     : myRequest( r ) {}
19
20   virtual void Execute();
21
22 protected:
23   PyInterp_Request* myRequest;
24 };
25
26 /**
27  * Events thrown by the interpreter having executed a command and indicating
28  * the return status.
29  */
30 //
31 class PYINTERP_EXPORT PyInterp_Event : public QEvent
32 {
33   PyInterp_Event();
34   PyInterp_Event( const PyInterp_Event& );
35
36 public:
37   //Execution state
38   enum { ES_NOTIFY = QEvent::User + 5000, ES_OK, ES_ERROR, ES_INCOMPLETE,
39          ES_TAB_COMPLETE_OK, ES_TAB_COMPLETE_ERR, ES_LAST };
40
41   PyInterp_Event( int type, PyInterp_Request* request )
42     : QEvent( (QEvent::Type)type ), myRequest( request ) {}
43
44   virtual ~PyInterp_Event();
45
46   PyInterp_Request* GetRequest() const { return myRequest; }
47   operator PyInterp_Request*() const { return myRequest; }
48
49 private:
50   PyInterp_Request* myRequest;
51 };
52
53 #endif // PYINTERP_EVENT_H