Buteo Synchronization Framework
SyncSchedule_p.h
1/*
2 * This file is part of buteo-syncfw package
3 *
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 * Copyright (C) 2014-2015 Jolla Ltd.
6 *
7 * Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * version 2.1 as published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24#ifndef SYNCSCHEDULE_P_H
25#define SYNCSCHEDULE_P_H
26
27#include <QDateTime>
28#include <QString>
29
30#include "SyncSchedule.h"
31
32namespace Buteo {
33
36{
37public:
42
47
54 static bool daysMatch(SyncSchedule::Days aDays, int aDay);
55
61 SyncSchedule::Days parseDays(const QString &aDays) const;
62
68 QString createDays(SyncSchedule::Days aDays) const;
69
81 bool adjustDate(QDateTime &aTime, SyncSchedule::Days aDays) const;
82
88 bool isRush(const QDateTime &aTime) const;
89
91 SyncSchedule::Days iDays;
92
94 QTime iTime;
95
98
100 unsigned int iInterval;
101
102 bool iEnabled;
103
104 // ============ RUSH HOUR SETTINGS ===========
105
107 SyncSchedule::Days iRushDays;
108
111
113 QTime iRushEnd;
114
116 unsigned int iRushInterval;
117
120
123};
124
125}
126
127#endif // SYNCSCHEDULE_P_H
Private implementation class for SyncSchedule.
Definition SyncSchedule_p.h:36
SyncSchedule::Days iDays
Days for the sync.
Definition SyncSchedule_p.h:91
QTime iRushEnd
indicates the schedule for rush hour end
Definition SyncSchedule_p.h:113
QString createDays(SyncSchedule::Days aDays) const
Creates a string from a set of week day numbers.
Definition SyncSchedule.cpp:585
unsigned int iInterval
Time interval.
Definition SyncSchedule_p.h:100
QTime iTime
Sync Time.
Definition SyncSchedule_p.h:94
static bool daysMatch(SyncSchedule::Days aDays, int aDay)
Tell if aDays contains aDay.
Definition SyncSchedule.cpp:614
bool iExternalRushEnabled
Indicates if External Rush Hour schedule is Enabled.
Definition SyncSchedule_p.h:122
bool iRushEnabled
Indicates if Rush Hour is Enabled.
Definition SyncSchedule_p.h:119
bool adjustDate(QDateTime &aTime, SyncSchedule::Days aDays) const
Adjusts given date to be in the set of given week days.
Definition SyncSchedule.cpp:625
SyncSchedulePrivate()
Constructor.
Definition SyncSchedule.cpp:38
SyncSchedule::Days iRushDays
indicates the schedule for rush hour - days
Definition SyncSchedule_p.h:107
QTime iRushBegin
indicates the schedule for rush hour start
Definition SyncSchedule_p.h:110
unsigned int iRushInterval
Rush Hour Time interval.
Definition SyncSchedule_p.h:116
SyncSchedule::Days parseDays(const QString &aDays) const
Parses week day numbers from a string.
Definition SyncSchedule.cpp:562
QDateTime iScheduleConfiguredTime
sync schedule configure time for intial update
Definition SyncSchedule_p.h:97
bool isRush(const QDateTime &aTime) const
Checks if the given date/time is inside rush hours.
Definition SyncSchedule.cpp:650