]> SALOME platform Git repositories - modules/shaper.git/blob - src/PyInterp/PyInterp_Event.h
Salome HOME
Python console added to the application
[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 class PYINTERP_EXPORT PyInterp_Event : public QEvent
31 {
32   PyInterp_Event();
33   PyInterp_Event( const PyInterp_Event& );
34
35 public:
36   //Execution state
37   enum { ES_NOTIFY = QEvent::User + 5000, ES_OK, ES_ERROR, ES_INCOMPLETE,
38          ES_TAB_COMPLETE_OK, ES_TAB_COMPLETE_ERR, ES_LAST };
39
40   PyInterp_Event( int type, PyInterp_Request* request )
41     : QEvent( (QEvent::Type)type ), myRequest( request ) {}
42
43   virtual ~PyInterp_Event();
44
45   PyInterp_Request* GetRequest() const { return myRequest; }
46   operator PyInterp_Request*() const { return myRequest; }
47
48 private:
49   PyInterp_Request* myRequest;
50 };
51
52 #endif // PYINTERP_EVENT_H