Summer time/winter time/Timezone changes done
[qtmeetings] / src / Domain / Configuration / DateTimeSettings.h
1 #ifndef DATETIMESETTINGS_H_
2 #define DATETIMESETTINGS_H_
3
4 #include <QDateTime>
5 #include <QString>
6
7 #define DAYS_IN_A_WEEK 7
8
9 class DateTimeSettings
10 {
11 public:
12
13         /*!
14          * An enumeration for the weekdays to be used.
15          */
16         typedef enum 
17         {
18                 Sunday = 0,
19                 Monday,
20                 Tuesday,
21                 Wednesday,
22                 Thursday,
23                 Friday,
24                 Saturday
25         } weekDay;
26
27         /*!
28          * Overloaded.
29          * \param aStandardTimeChange The date and time when the standard time is to be used. The year part and the milliseconds are omitted.
30          * \param aDaylightTimeChange The date and time when the daylight time is to be used. The year part and the milliseconds are omitted.
31          * \param aDayOfWeek The day of the week when the time is to be used.
32          */
33         DateTimeSettings(const QDateTime &aStandardTimeChange, const QDateTime &aDaylightTimeChange, weekDay aDayOfWeek);
34
35         //! Copy constructor.
36         /*!
37          * Overloaded. Constructor to initialize a DateTimeSettings instance.
38          * \param aOther DateTimeSettings class to be copied.
39          */
40         DateTimeSettings(const DateTimeSettings &aOther);
41         //! Destructor
42         virtual ~DateTimeSettings();
43
44         /*!
45          * \return The Date/time when the standard time is to be switched into use
46          */
47         QDateTime STDDateTime();
48
49         /*!
50          * \return The Date/time when the daylight saving time is to be switched into use
51          */
52         QDateTime DSTDateTime();
53
54         /*!
55          * \return The time as a string (hh:mm:ss) of the moment the standard time is to be switched into use
56          */
57         QString STDTime();
58
59         /*!
60          * \return The month as a string (MM) of the moment the standard time is to be switched into use
61          */
62         QString STDMonth();
63
64         /*!
65          * \return The day as a string (dd) of the moment the standard time is to be switched into use
66          */
67         QString STDDay();
68
69         /*!
70          * \return The time as a string (hh:mm:ss) of the moment the daylight saving time is to be switched into use
71          */
72         QString DSTTime();
73
74         /*!
75          * \return The month as a string (MM) of the moment the daylight saving time is to be switched into use
76          */
77         QString DSTMonth();
78
79         /*!
80          * \return The day as a string (dd) of the moment the daylight saving time is to be switched into use
81          */
82         QString DSTDay();
83
84         /*!
85          * Sets the time/date of the moment the daylight saving time is to be switched into use
86          */
87         void setDSTDateTime(const QDateTime &aDaylightSaveTimeChange);
88
89         /*!
90          * Sets the time/date of the moment the standard time is to be switched into use
91          */
92         void setSTDDateTime(const QDateTime &aStandardTimeChange);
93
94         /*!
95          * Sets the appropriate day of the week the time switch is carried out.
96          * \see DateTimeSettings::weekDay
97          */
98         void setSwitchDay(DateTimeSettings::weekDay aDay);
99
100         /*!
101          * \return The appropriate day of the week the time switch is carried out.
102          */
103         QString switchDay();
104
105 private:
106         QDateTime iStandardTimeChangeMoment;
107         QDateTime iDaylightSaveTimeChangeMoment;
108         weekDay iDayOfWeek;
109
110         /*!
111          * Contains the weekday strings that are passed to the exchange server when
112          * defining the timezone variables
113          */
114         static const QString weekDays[DAYS_IN_A_WEEK];
115 };
116
117
118 #endif /*DATETIMESETTINGS_H_*/