13 #ifndef ML_BACKGROUND_TASK_HANDLE_H
14 #define ML_BACKGROUND_TASK_HANDLE_H
#define MLBACKGROUNDTASKS_EXPORT
This class offers direct access to the contained background task.
static BackgroundTask * get(const BackgroundTaskHandle &handle)
A handle to a task that has been created by the background task manager.
bool isCanceled() const
Returns whether the task was canceled.
void clear()
Clears the handle. Make sure to call this from the taskFinishedCB of the background task manager.
bool hasTask() const
Returns whether the handle has a task.
BackgroundTaskHandle(BackgroundTask *task)
void setOwnerWasDeleted()
Tells the task that the owner was deleted.
void cancel()
Cancels the running task.
bool hasRunningTask() const
Returns whether the handle has a task that is not canceled.
The BackgroundTaskManager is the central singleton that manages running background tasks.
Base class for a task that is started in an extra thread.