ButeoSynchronizationFramework
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 
13 class SyncProfile;
14 
16 {
17  Q_OBJECT;
18 
19 public:
23 
27 
47  bool addProfile(const SyncProfile* aProfile);
48 
54  void removeProfile(const QString &aProfileName);
55 
56 private Q_SLOTS:
62  void sync(const SyncProfile* aProfile);
63 
64 private:
65  QStringList iSOCProfileNames;
66  QMap<QString, QObject*> iSOCTimers;
67 };
68 
69 class SyncOnChangeTimer : public QObject
70 {
71  Q_OBJECT
72 
73 public:
76  SyncOnChangeTimer(const SyncProfile* aProfile, const quint32& aTimeout);
77 
81 
84  void fire();
85 
86 Q_SIGNALS:
91  void timeout(const SyncProfile* aProfile);
92 
93 private Q_SLOTS:
96  void onTimeout();
97 
98 private:
99  const SyncProfile* iSyncProfile;
100  quint32 iTimeout;
101 };
102 
103 }
104 
105 #endif
void timeout(const SyncProfile *aProfile)
emit this signal when the timeout occurs
Definition: moc_SyncOnChangeScheduler.cpp:224
Definition: SyncOnChangeScheduler.h:15
Definition: SyncOnChangeScheduler.h:69
~SyncOnChangeTimer()
destructor
Definition: SyncOnChangeScheduler.cpp:76
void fire()
fire the timer
Definition: SyncOnChangeScheduler.cpp:81
SyncOnChangeScheduler()
constructor
Definition: SyncOnChangeScheduler.cpp:9
SyncOnChangeTimer(const SyncProfile *aProfile, const quint32 &aTimeout)
constructor
Definition: SyncOnChangeScheduler.cpp:70
Definition: AccountsHelper.h:31
~SyncOnChangeScheduler()
destructor
Definition: SyncOnChangeScheduler.cpp:14
SyncScheduler Object to be used to set Schedule via the framework.
Definition: SyncScheduler.h:52
bool addProfile(const SyncProfile *aProfile)
Call this method to schedule SOC for a profile.
Definition: SyncOnChangeScheduler.cpp:24
A top level synchronization profile.
Definition: SyncProfile.h:47
void removeProfile(const QString &aProfileName)
call this method to disable SOC that has been scheduled for a certain profile
Definition: SyncOnChangeScheduler.cpp:48