2
* Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
4
* Author: Tuomo Penttinen <tp@herqq.org>
6
* This file is part of Herqq UPnP Av (HUPnPAv) library.
8
* Herqq UPnP Av is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
13
* Herqq UPnP Av is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with Herqq UPnP Av. If not, see <http://www.gnu.org/licenses/>.
22
#ifndef HDATETIMERANGE_H_
23
#define HDATETIMERANGE_H_
25
#include <HUpnpAv/HUpnpAv>
27
#include <QtCore/QMetaType>
28
#include <QtCore/QSharedDataPointer>
41
class HDateTimeRangePrivate;
44
* \brief This class is used to specify a time range.
46
* \headerfile hdatetimerange.h HDateTimeRange
48
* \ingroup hupnp_av_cds_common
50
* \remarks This class is not thread-safe.
52
class H_UPNP_AV_EXPORT HDateTimeRange
56
QSharedDataPointer<HDateTimeRangePrivate> h_ptr;
61
* Creates a new, invalid instance.
68
* \brief Creates a new instance.
70
* \param value specifies the date time range. The expected format is:
71
* <c>start datetime value '/' end datetime value</c>. The datetime values
72
* are expected to follow ISO 8601.
74
* \param dlSaving specifies the daylight saving reference point.
78
HDateTimeRange(const QString& value, HDaylightSaving dlSaving = Unknown_DaylightSaving);
81
* \brief Copy constructor.
83
* Creates a copy of \c other.
85
HDateTimeRange(const HDateTimeRange&);
88
* \brief Assignment operator.
90
* Copies the contents of \c other to this.
92
HDateTimeRange& operator=(const HDateTimeRange&);
95
* \brief Destroys the instance.
100
* \brief Indicates if the object is valid.
102
* \return \e true when the object is valid, i.e. the startTime() and endTime()
105
bool isValid() const;
108
* \brief Returns the starting date time value.
110
* \return The starting date time value.
114
QDateTime startTime() const;
117
* \brief Returns the ending date time value.
119
* \return The ending date time value.
123
QDateTime endTime() const;
126
* \brief Indicates whether the range is expressed using either Daylight Saving
127
* or Standard Time as a point of reference.
129
* \return a value indicating whether the range is expressed using either
130
* Daylight Saving or Standard Time as a point of reference.
132
* \sa setDaylightSaving()
134
HDaylightSaving daylightSaving() const;
137
* \brief Returns a string representation of the object.
139
* \return a string representation of the object.
141
QString toString() const;
144
* \brief Specifies the starting date time value.
146
* \param value specifies the starting date time value.
150
void setStartTime(const QDateTime& value);
153
* \brief Specifies the ending date time value.
155
* \param value specifies the ending date time value.
159
void setEndTime(const QDateTime& value);
162
* \brief Specifies whether the value() is expressed using either Daylight Saving
163
* or Standard Time as a point of reference.
165
* \param arg specifies whether the value() is expressed using either Daylight Saving
166
* or Standard Time as a point of reference.
168
* \sa daylightSaving()
170
void setDaylightSaving(HDaylightSaving arg);
174
* Compares the two objects for equality.
176
* \return \e true in case the objects are logically equivalent.
178
* \relates HDateTimeRange
180
H_UPNP_AV_EXPORT bool operator==(const HDateTimeRange& obj1, const HDateTimeRange& obj2);
183
* Compares the two objects for inequality.
185
* \return \e true in case the objects are not logically equivalent.
187
* \relates HDateTimeRange
189
inline bool operator!=(const HDateTimeRange& obj1, const HDateTimeRange& obj2)
191
return !(obj1 == obj2);
198
Q_DECLARE_METATYPE(Herqq::Upnp::Av::HDateTimeRange)
200
#endif /* HDATETIMERANGE_H_ */