ButeoSynchronizationFramework
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 namespace Buteo {
31 
34 {
35 public:
40 
45 
51  DaySet parseDays(const QString &aDays) const;
52 
58  QString createDays(const DaySet &aDays) const;
59 
71  bool adjustDate(QDateTime &aTime, const DaySet &aDays) const;
72 
78  bool isRush(const QDateTime &aTime) const;
79 
81  DaySet iDays;
82 
84  QTime iTime;
85 
88 
90  unsigned iInterval;
91 
92  bool iEnabled;
93 
94  // ============ RUSH HOUR SETTINGS ===========
95 
97  DaySet iRushDays;
98 
100  QTime iRushBegin;
101 
103  QTime iRushEnd;
104 
106  unsigned iRushInterval;
107 
110 
113 };
114 
115 }
116 
117 #endif // SYNCSCHEDULE_P_H
bool adjustDate(QDateTime &aTime, const DaySet &aDays) const
Adjusts given date to be in the set of given week days.
Definition: SyncSchedule.cpp:524
QTime iRushEnd
indicates the schedule for rush hour end
Definition: SyncSchedule_p.h:103
bool isRush(const QDateTime &aTime) const
Checks if the given date/time is inside rush hours.
Definition: SyncSchedule.cpp:552
QTime iTime
Sync Time.
Definition: SyncSchedule_p.h:84
Definition: AccountsHelper.h:31
QString createDays(const DaySet &aDays) const
Creates a string from a set of week day numbers.
Definition: SyncSchedule.cpp:512
unsigned iInterval
Time interval.
Definition: SyncSchedule_p.h:90
DaySet iDays
Number of Days before the next sync starts.
Definition: SyncSchedule_p.h:81
Private implementation class for SyncSchedule.
Definition: SyncSchedule_p.h:33
QDateTime iScheduleConfiguredTime
sync schedule configure time for intial update
Definition: SyncSchedule_p.h:87
QTime iRushBegin
indicates the schedule for rush hour start
Definition: SyncSchedule_p.h:100
bool iRushEnabled
Indicates if Rush Hour is Enabled.
Definition: SyncSchedule_p.h:109
SyncSchedulePrivate()
Constructor.
Definition: SyncSchedule.cpp:35
DaySet parseDays(const QString &aDays) const
Parses week day numbers from a string.
Definition: SyncSchedule.cpp:491
DaySet iRushDays
indicates the schedule for rush hour - days
Definition: SyncSchedule_p.h:97
unsigned iRushInterval
Rush Hour Time interval.
Definition: SyncSchedule_p.h:106
bool iExternalRushEnabled
Indicates if External Rush Hour schedule is Enabled.
Definition: SyncSchedule_p.h:112