SyncOnChangeScheduler.h
#ifndef SYNCONCHANGESCHEDULER_H
#define SYNCONCHANGESCHEDULER_H
#include <QObject>
#include <QHash>
#include <QStringList>
#include "SyncScheduler.h"
namespace Buteo {
class SyncProfile;
class SyncOnChangeScheduler : public SyncScheduler
{
Q_OBJECT
public:
SyncOnChangeScheduler();
~SyncOnChangeScheduler();
bool addProfile(const SyncProfile *aProfile);
void removeProfile(const QString &aProfileName);
private Q_SLOTS:
void sync(const SyncProfile *aProfile);
private:
QStringList iSOCProfileNames;
QMap<QString, QObject *> iSOCTimers;
};
class SyncOnChangeTimer : public QObject
{
Q_OBJECT
public:
SyncOnChangeTimer(const SyncProfile *aProfile, const quint32 &aTimeout);
~SyncOnChangeTimer();
void fire();
Q_SIGNALS:
void timeout(const SyncProfile *aProfile);
private Q_SLOTS:
void onTimeout();
private:
const SyncProfile *iSyncProfile;
quint32 iTimeout;
};
}
#endif
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::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
Buteo::SyncProfile
A top level synchronization profile.
Definition SyncProfile.h:49
Buteo::SyncScheduler::SyncScheduler
SyncScheduler(QObject *aParent=0)
Constructor.
Definition SyncScheduler.cpp:38
QMap
Definition SyncBackupAdaptor.h:41