Buteo Synchronization Framework: SyncOnChangeScheduler.h Source File

Buteo Synchronization Framework

SyncOnChangeScheduler.h
1 #ifndef SYNCONCHANGESCHEDULER_H
2 #define SYNCONCHANGESCHEDULER_H
3
4 #include <QObject>
5 #include <QHash>
6 #include <QStringList>
7
8 #include "SyncScheduler.h"
9
10 namespace Buteo {
11
12 class SyncProfile;
13
14 class SyncOnChangeScheduler : public SyncScheduler
15 {
16 Q_OBJECT
17
18 public:
21 SyncOnChangeScheduler();
22
25 ~SyncOnChangeScheduler();
26
46 bool addProfile(const SyncProfile *aProfile);
47
53 void removeProfile(const QString &aProfileName);
54
55 private Q_SLOTS:
61 void sync(const SyncProfile *aProfile);
62
63 private:
64 QStringList iSOCProfileNames;
65 QMap<QString, QObject *> iSOCTimers;
66 };
67
68 class SyncOnChangeTimer : public QObject
69 {
70 Q_OBJECT
71
72 public:
75 SyncOnChangeTimer(const SyncProfile *aProfile, const quint32 &aTimeout);
76
79 ~SyncOnChangeTimer();
80
83 void fire();
84
85 Q_SIGNALS:
90 void timeout(const SyncProfile *aProfile);
91
92 private Q_SLOTS:
95 void onTimeout();
96
97 private:
98 const SyncProfile *iSyncProfile;
99 quint32 iTimeout;
100 };
101
102 }
103
104 #endif
Buteo::SyncOnChangeScheduler
Definition: SyncOnChangeScheduler.h:15
Buteo::SyncOnChangeScheduler::addProfile
bool addProfile(const SyncProfile *aProfile)
Call this method to schedule SOC for a profile.
Definition: SyncOnChangeScheduler.cpp:24
Buteo::SyncOnChangeScheduler::SyncOnChangeScheduler
SyncOnChangeScheduler()
constructor
Definition: SyncOnChangeScheduler.cpp:9
Buteo::SyncOnChangeScheduler::~SyncOnChangeScheduler
~SyncOnChangeScheduler()
destructor
Definition: SyncOnChangeScheduler.cpp:14
Buteo::SyncOnChangeScheduler::removeProfile
void removeProfile(const QString &aProfileName)
call this method to disable SOC that has been scheduled for a certain profile
Definition: SyncOnChangeScheduler.cpp:45
Buteo::SyncOnChangeTimer
Definition: SyncOnChangeScheduler.h:69
Buteo::SyncOnChangeTimer::fire
void fire()
fire the timer
Definition: SyncOnChangeScheduler.cpp:77
Buteo::SyncOnChangeTimer::SyncOnChangeTimer
SyncOnChangeTimer(const SyncProfile *aProfile, const quint32 &aTimeout)
constructor
Definition: SyncOnChangeScheduler.cpp:66
Buteo::SyncOnChangeTimer::~SyncOnChangeTimer
~SyncOnChangeTimer()
destructor
Definition: SyncOnChangeScheduler.cpp:72
Buteo::SyncOnChangeTimer::timeout
void timeout(const SyncProfile *aProfile)
emit this signal when the timeout occurs
Definition: moc_SyncOnChangeScheduler.cpp:235
Buteo::SyncProfile
A top level synchronization profile.
Definition: SyncProfile.h:49
Buteo::SyncScheduler
SyncScheduler Object to be used to set Schedule via the framework.
Definition: SyncScheduler.h:55
QMap< QString, QObject * >