Buteo Synchronization Framework: SyncSchedule_p.h Source File

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
35 class SyncSchedulePrivate
36{
37public:
41 SyncSchedulePrivate();
42
46 SyncSchedulePrivate(const SyncSchedulePrivate &aSource);
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
97 QDateTime iScheduleConfiguredTime;
98
100 unsigned int iInterval;
101
102 bool iEnabled;
103
104 // ============ RUSH HOUR SETTINGS ===========
105
107 SyncSchedule::Days iRushDays;
108
110 QTime iRushBegin;
111
113 QTime iRushEnd;
114
116 unsigned int iRushInterval;
117
119 bool iRushEnabled;
120
122 bool iExternalRushEnabled;
123};
124
125}
126
127#endif // SYNCSCHEDULE_P_H
Buteo::SyncSchedulePrivate
Private implementation class for SyncSchedule.
Definition: SyncSchedule_p.h:36
Buteo::SyncSchedulePrivate::iDays
SyncSchedule::Days iDays
Days for the sync.
Definition: SyncSchedule_p.h:91
Buteo::SyncSchedulePrivate::iRushEnd
QTime iRushEnd
indicates the schedule for rush hour end
Definition: SyncSchedule_p.h:113
Buteo::SyncSchedulePrivate::createDays
QString createDays(SyncSchedule::Days aDays) const
Creates a string from a set of week day numbers.
Definition: SyncSchedule.cpp:585
Buteo::SyncSchedulePrivate::iInterval
unsigned int iInterval
Time interval.
Definition: SyncSchedule_p.h:100
Buteo::SyncSchedulePrivate::iTime
QTime iTime
Sync Time.
Definition: SyncSchedule_p.h:94
Buteo::SyncSchedulePrivate::daysMatch
static bool daysMatch(SyncSchedule::Days aDays, int aDay)
Tell if aDays contains aDay.
Definition: SyncSchedule.cpp:614
Buteo::SyncSchedulePrivate::iExternalRushEnabled
bool iExternalRushEnabled
Indicates if External Rush Hour schedule is Enabled.
Definition: SyncSchedule_p.h:122
Buteo::SyncSchedulePrivate::iRushEnabled
bool iRushEnabled
Indicates if Rush Hour is Enabled.
Definition: SyncSchedule_p.h:119
Buteo::SyncSchedulePrivate::adjustDate
bool adjustDate(QDateTime &aTime, SyncSchedule::Days aDays) const
Adjusts given date to be in the set of given week days.
Definition: SyncSchedule.cpp:625
Buteo::SyncSchedulePrivate::SyncSchedulePrivate
SyncSchedulePrivate()
Constructor.
Definition: SyncSchedule.cpp:38
Buteo::SyncSchedulePrivate::iRushDays
SyncSchedule::Days iRushDays
indicates the schedule for rush hour - days
Definition: SyncSchedule_p.h:107
Buteo::SyncSchedulePrivate::iRushBegin
QTime iRushBegin
indicates the schedule for rush hour start
Definition: SyncSchedule_p.h:110
Buteo::SyncSchedulePrivate::iRushInterval
unsigned int iRushInterval
Rush Hour Time interval.
Definition: SyncSchedule_p.h:116
Buteo::SyncSchedulePrivate::parseDays
SyncSchedule::Days parseDays(const QString &aDays) const
Parses week day numbers from a string.
Definition: SyncSchedule.cpp:562
Buteo::SyncSchedulePrivate::iScheduleConfiguredTime
QDateTime iScheduleConfiguredTime
sync schedule configure time for intial update
Definition: SyncSchedule_p.h:97
Buteo::SyncSchedulePrivate::isRush
bool isRush(const QDateTime &aTime) const
Checks if the given date/time is inside rush hours.
Definition: SyncSchedule.cpp:650