/
backupEngine.h
58 lines (44 loc) · 1.27 KB
/
backupEngine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef BACKUPENGINE
#define BACKUPENGINE
#include <qobject.h>
#include <qmutex.h>
class backupWorker;
class QProgressBar;
class QLabel;
class IBackupOperationsInterface
{
public:
virtual void threadedCopyOperation() = 0;
virtual void threadedVerifyOperation() = 0;
virtual void operationFinishedEvent() = 0;
virtual void processProgressMaximum(int maximum) = 0;
virtual void processProgressValue(int value) = 0;
virtual void processProgressText(QString const &text) = 0;
virtual void processFileNameText(QString const &text) = 0;
};
class backupEngine : public QObject
{
public:
backupEngine(IBackupOperationsInterface &backupHandler);
virtual ~backupEngine();
void setProgressMaximum(int max);
void setProgressValue(int value);
void setProgressText(QString const &text);
void setFileNameText(QString const &text);
void setToolTipText(QString const &text);
void start(bool verifyOnly);
void processEventsAndWait();
protected:
virtual void timerEvent(QTimerEvent */*event*/ );
volatile bool m_changed;
int m_progressMax;
int m_progressValue;
QString m_progressText;
QString m_filenameText;
QString m_tooltipText;
QMutex m_locker;
private:
IBackupOperationsInterface &m_backupHandler;
backupWorker *m_worker;
};
#endif // BACKUPENGINE