+// This thread creates a BackgroundTask event handler object
+// The thread is detached and terminates when BackgroundTask terminates
+class BackgroundTaskThread : public wxThread {
+private:
+
+public:
+ BackgroundTaskThread();
+
+ virtual wxThread::ExitCode Entry();
+
+ // called when the thread exits - whether it terminates normally or is stopped with Delete()
+ virtual void OnExit();
+};
+
+
+// Pure virtual class for BackgroundTasks that can communication
+// with BackgroundManager
+
+class BackgroundTask : public wxEvtHandler {
+private:
+ bool m_bDone;
+
+public:
+ BackgroundTask()
+ : m_bDone(false), wxEvtHandler()
+ {}
+
+ virtual ~BackgroundTask()
+ {}
+
+ virtual void cancel() = 0;
+ virtual bool start() = 0;
+ virtual bool testDone() = 0;
+
+ bool isDone() const {return m_bDone;}
+ void setDone() { m_bDone = true; }
+};