24 #ifndef SYNCSCHEDULE_H 25 #define SYNCSCHEDULE_H 35 class SyncSchedulePrivate;
36 class SyncScheduleTest;
38 typedef QSet<int> DaySet;
40 const QString SYNC_SCHEDULE_ENABLED_KEY_BOOL(
"scheduler/schedule_enabled");
41 const QString SYNC_SCHEDULE_PEAK_ENABLED_KEY_BOOL(
"scheduler/schedule_peak_enabled");
42 const QString SYNC_SCHEDULE_OFFPEAK_ENABLED_KEY_BOOL(
"scheduler/schedule_offpeak_enabled");
43 const QString SYNC_SCHEDULE_PEAK_DAYS_KEY_INT (
"scheduler/schedule_peak_days");
44 const QString SYNC_SCHEDULE_PEAK_START_TIME_KEY_INT (
"scheduler/schedule_peak_start_time");
45 const QString SYNC_SCHEDULE_PEAK_END_TIME_KEY_INT (
"scheduler/schedule_peak_end_time");
46 const QString SYNC_SCHEDULE_PEAK_SCHEDULE_KEY_INT (
"scheduler/schedule_peak");
47 const QString SYNC_SCHEDULE_OFFPEAK_SCHEDULE_KEY_INT (
"scheduler/schedule_off_peak");
93 QDomElement
toXml(QDomDocument &aDoc)
const;
113 void setDays(
const DaySet &aDays);
126 void setTime(
const QTime &aTime);
224 void setRushTime(
const QTime &aBegin,
const QTime &aEnd);
250 QDateTime
nextSyncTime(
const QDateTime &aPrevSync)
const;
264 #ifdef SYNCFW_UNIT_TESTS 265 friend class SyncScheduleTest;
272 #endif // SYNCSCHEDULE_H Class for handling sync schedule settings.
Definition: SyncSchedule.h:52
void setRushDays(const DaySet &aDays)
Sets days enabled for rush hours.
Definition: SyncSchedule.cpp:245
void setScheduleEnabled(bool aEnabled)
Sets if normal schedule is to be obeyed.
Definition: SyncSchedule.cpp:215
DaySet rushDays() const
Gets days enabled for rush hours.
Definition: SyncSchedule.cpp:240
~SyncSchedule()
Destructor.
Definition: SyncSchedule.cpp:92
void setRushInterval(unsigned aInterval)
Sets sync interval for rush hours.
Definition: SyncSchedule.cpp:271
QDomElement toXml(QDomDocument &aDoc) const
Exports the sync schedule to XML.
Definition: SyncSchedule.cpp:133
void setRushEnabled(bool aEnabled)
Sets rush hour schedule is to be obeyed.
Definition: SyncSchedule.cpp:225
QDateTime scheduleConfiguredTime()
To get the scheduled config time.
Definition: SyncSchedule.cpp:185
void setScheduleConfiguredTime(const QDateTime &aDateTime)
Sets scheduled config time.
Definition: SyncSchedule.cpp:180
Definition: AccountsHelper.h:31
bool scheduleEnabled() const
Checks if normal schedule is obeyed.
Definition: SyncSchedule.cpp:210
void setRushTime(const QTime &aBegin, const QTime &aEnd)
Sets begin and end times of rush hours.
Definition: SyncSchedule.cpp:260
SyncSchedule()
Constructs an empty schedule.
Definition: SyncSchedule.cpp:55
unsigned rushInterval() const
Gets sync interval for rush hours.
Definition: SyncSchedule.cpp:266
void setTime(const QTime &aTime)
Sets the exact time for sync.
Definition: SyncSchedule.cpp:195
QString toString() const
Exports the sync schedule to QString.
Definition: SyncSchedule.cpp:157
void setSyncExternallyDuringRush(bool aEnabled)
Sets if rush schedule is controlled by a external process.
Definition: SyncSchedule.cpp:235
Private implementation class for SyncSchedule.
Definition: SyncSchedule_p.h:33
QDateTime nextRushSwitchTime(const QDateTime &aFromTime) const
Gets next time to switch rush/off-rush schedule intervals.
Definition: SyncSchedule.cpp:466
void setInterval(unsigned aInterval)
Sets sync interval in minutes.
Definition: SyncSchedule.cpp:205
QTime time() const
Gets the exact time set in sync schedule.
Definition: SyncSchedule.cpp:190
QTime rushEnd() const
Gets end time of rush hours.
Definition: SyncSchedule.cpp:255
unsigned interval() const
Gets sync interval in minutes.
Definition: SyncSchedule.cpp:200
void setDays(const DaySet &aDays)
Sets the enabled week days.
Definition: SyncSchedule.cpp:175
QTime rushBegin() const
Gets begin time of rush hours.
Definition: SyncSchedule.cpp:250
DaySet days() const
Gets the enabled week days of the sync schedule.
Definition: SyncSchedule.cpp:170
bool operator==(const SyncSchedule &aRhs)
Equal to operator.
Definition: SyncSchedule.cpp:109
SyncSchedule & operator=(const SyncSchedule &aRhs)
Assignment operator.
Definition: SyncSchedule.cpp:98
bool rushEnabled() const
Checks if rush hour schedule is to be obeyed.
Definition: SyncSchedule.cpp:220
bool inExternalSyncRushPeriod(const QDateTime &aDateTime) const
Checks if a given time is inside rush hour and if the sync is controlled by a external process...
Definition: SyncSchedule.cpp:276
QDateTime nextSyncTime(const QDateTime &aPrevSync) const
Gets next sync time based on the sync schedule settings.
Definition: SyncSchedule.cpp:286
bool syncExternallyDuringRush() const
Checks if rush schedule is controlled by a external process.
Definition: SyncSchedule.cpp:230