~renatofilho/buteo-syncfw/more-verbose

« back to all changes in this revision

Viewing changes to libsyncprofile/SyncSchedule_p.h

  • Committer: Sergey Gerasimenko
  • Date: 2010-06-29 12:51:21 UTC
  • Revision ID: git-v1:cd8dab07b102ac96752ece4f3cde5fc62697d717
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of buteo-syncfw package
 
3
 *
 
4
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 
5
 *
 
6
 * Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
 
7
 *
 
8
 * This library is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU Lesser General Public License
 
10
 * version 2.1 as published by the Free Software Foundation.
 
11
 *
 
12
 * This library is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
15
 * Lesser General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU Lesser General Public
 
18
 * License along with this library; if not, write to the Free Software
 
19
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
20
 * 02110-1301 USA
 
21
 *
 
22
 */
 
23
 
 
24
 
 
25
#ifndef SYNCSCHEDULE_P_H
 
26
#define SYNCSCHEDULE_P_H
 
27
 
 
28
#include <QDateTime>
 
29
#include <QString>
 
30
 
 
31
namespace Buteo {
 
32
    
 
33
// Private implementation class for SyncSchedule.
 
34
class SyncSchedulePrivate
 
35
{
 
36
public:
 
37
    SyncSchedulePrivate();
 
38
 
 
39
    SyncSchedulePrivate(const SyncSchedulePrivate &aSource);
 
40
 
 
41
    /*! \brief Parses week day numbers from a string.
 
42
     *
 
43
     * \param aDays String containing the week day numbers.
 
44
     * \return Set of week day numbers.
 
45
     */
 
46
    DaySet parseDays(const QString &aDays) const;
 
47
 
 
48
    /*! \brief Creates a string from a set of week day numbers.
 
49
     *
 
50
     * \param aDays Set of week day numbers.
 
51
     * \return String of week day numbers.
 
52
     */
 
53
    QString createDays(const DaySet &aDays) const;
 
54
 
 
55
    /*! \brief Adjusts given date to be in the set of given week days.
 
56
     *
 
57
     * Day is increased until the week day is contained in the given set of
 
58
     * week day numbers.
 
59
     * \param aTime Date/time to adjust.
 
60
     * \param aDays Set of enabled week day numbers.
 
61
     * \return Was day adjusted to a valid day. If the week day was already in
 
62
     *  the set of given week days, this function returns false. If the day
 
63
     *  set does not contain any valid days, this function sets aTime to null
 
64
     *  object and returns false.
 
65
     */
 
66
    bool adjustDate(QDateTime &aTime, const DaySet &aDays) const;
 
67
 
 
68
    /*! \brief Checks if the given date/time is inside rush hours.
 
69
     *
 
70
     * \param aTime Date/time to check.
 
71
     * \return True if in rush hours.
 
72
     */
 
73
    bool isRush(const QDateTime &aTime) const;
 
74
 
 
75
    DaySet iDays;
 
76
 
 
77
    QTime iTime;
 
78
 
 
79
    unsigned iInterval;
 
80
 
 
81
    DaySet iRushDays;
 
82
 
 
83
    QTime iRushBegin;
 
84
 
 
85
    QTime iRushEnd;
 
86
 
 
87
    unsigned iRushInterval;
 
88
 
 
89
    bool iRushEnabled;
 
90
};
 
91
 
 
92
}
 
93
 
 
94
#endif // SYNCSCHEDULE_P_H