GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
TaskRunner.h
1 
29 #pragma once
30 
31 #include "core/GpgFrontendCore.h"
32 #include "core/function/SecureMemoryAllocator.h"
33 #include "core/thread/Task.h"
34 
35 namespace GpgFrontend::Thread {
36 
37 class GPGFRONTEND_CORE_EXPORT TaskRunner : public QObject {
38  Q_OBJECT
39  public:
44  TaskRunner();
45 
50  ~TaskRunner() override;
51 
56  void Start();
57 
62  void Stop();
63 
69  auto GetThread() -> QThread*;
70 
77  auto IsRunning() -> bool;
78 
79  public slots:
80 
86  void PostTask(Task* task);
87 
94  void PostTask(const QString&, const Task::TaskRunnable&,
95  const Task::TaskCallback&, DataObjectPtr);
96 
102  auto RegisterTask(const QString&, const Task::TaskRunnable&,
103  const Task::TaskCallback&, DataObjectPtr)
105 
111  void PostConcurrentTask(Task* task);
112 
119  void PostScheduleTask(Task* task, size_t seconds);
120 
121  private:
122  class Impl;
123  SecureUniquePtr<Impl> p_;
124 };
125 } // namespace GpgFrontend::Thread
Definition: TaskRunner.cpp:35
Definition: TaskRunner.h:37
Definition: Task.h:39
Definition: ModuleManager.h:39