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 HCONTENTDURATION_H_
23
#define HCONTENTDURATION_H_
25
#include <HUpnpAv/HUpnpAv>
27
#include <QtCore/QMetaType>
28
#include <QtCore/QSharedDataPointer>
41
class HContentDurationPrivate;
44
* \brief This class is used to represent duration of media content as specified
45
* in the ContentDirectory:3 specification.
47
* \headerfile hcontentduration.h HContentDuration
49
* \ingroup hupnp_av_cds_common
51
* \remarks This class is not thread-safe.
53
class H_UPNP_AV_EXPORT HContentDuration
57
QSharedDataPointer<HContentDurationPrivate> h_ptr;
62
* \brief Creates a new, empty instance.
67
* \brief Creates a new instance.
69
* \param arg specifies the duration. The expected format is:
70
* <c>'P' [n 'D'] time</c>, where n is an integer, P and D are constant
71
* characters and time is a ISO 8601 compatible value for time.
72
* The number of days component is optional.
76
HContentDuration(const QString& arg);
79
* \brief Copy constructor.
81
* Creates a copy of \c other.
83
HContentDuration(const HContentDuration&);
86
* \brief Assignment operator.
88
* Copies the contents of \c other to this.
90
HContentDuration& operator=(const HContentDuration&);
93
* \brief Destroys the instance.
98
* \brief Indicates if the object is valid.
100
* \return \e if the object is valid.
102
bool isValid() const;
105
* \brief Returns the number of days of the duration.
107
* \return The number of days of the duration.
112
* \brief Returns the time component of the duration.
114
* \return The time component of the duration.
119
* \brief Returns a string representation of the object.
121
* \return a string representation of the object.
123
QString toString() const;
126
* \brief Specifies the number of days of the duration.
128
* \param arg the number of days of the duration.
130
void setDays(qint32 arg);
133
* \brief Specifies the time component of the duration.
135
* \param arg specifies the time component of the duration.
137
void setTime(const QTime& arg);
141
* Compares the two objects for equality.
143
* \return \e true in case the objects are logically equivalent.
145
* \relates HContentDuration
147
H_UPNP_AV_EXPORT bool operator==(const HContentDuration& obj1, const HContentDuration& obj2);
150
* Compares the two objects for inequality.
152
* \return \e true in case the objects are not logically equivalent.
154
* \relates HSoHContentDurationrtInfo
156
inline bool operator!=(const HContentDuration& obj1, const HContentDuration& obj2)
158
return !(obj1 == obj2);
165
Q_DECLARE_METATYPE(Herqq::Upnp::Av::HContentDuration)
167
#endif /* HCONTENTDURATION_H_ */