3 #ifndef PYINTERP_REQUEST_H
4 #define PYINTERP_REQUEST_H
7 #include "PyInterp_Event.h"
12 class PyInterp_Interp;
13 class PyInterp_Watcher;
14 class PyInterp_Dispatcher;
15 class PyInterp_ExecuteEvent;
16 class PyConsole_Editor;
18 class PYINTERP_EXPORT PyInterp_Request
20 friend class PyInterp_Dispatcher;
21 friend class PyInterp_ExecuteEvent;
24 PyInterp_Request( const PyInterp_Request& );
27 virtual ~PyInterp_Request() {};
28 // protected destructor - to control deletion of requests
31 PyInterp_Request( QObject* listener, bool sync = false )
32 : myIsSync( sync ), myListener( listener ) {};
34 static void Destroy( PyInterp_Request* );
37 bool IsSync() const { return myIsSync; }
38 // Returns true if this request should be processed synchronously,
39 // without putting it to a queue
42 virtual void safeExecute();
44 virtual void execute() = 0;
45 // Should be redefined in successors, contains actual request code
47 virtual QEvent* createEvent();
48 // This method can be overridden to customize notification event creation
50 virtual void processEvent( QObject* );
52 QObject* listener() const { return myListener; }
53 void setListener( QObject* );
64 class PYINTERP_EXPORT PyInterp_LockRequest : public PyInterp_Request
68 PyInterp_LockRequest( PyInterp_Interp* interp, QObject* listener = 0, bool sync = false )
69 : PyInterp_Request( listener, sync ), myInterp( interp )
73 PyInterp_Interp* getInterp() const { return myInterp; }
75 virtual void safeExecute();
78 PyInterp_Interp* myInterp;
81 #endif // PYINTERP_REQUEST_H