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 HSTORAGESYSTEM_H_
23
#define HSTORAGESYSTEM_H_
25
#include <HUpnpAv/HContainer>
36
class HStorageSystemPrivate;
39
* \brief This class represents potentially heterogeneous collection of storage media.
41
* The class identifier specified by the AV Working Committee is
42
* \c object.container.storageSystem.
44
* \headerfile hstoragesystem.h HStorageSystem
46
* \ingroup hupnp_av_cds_objects
48
* \remarks This class is not thread-safe.
50
class H_UPNP_AV_EXPORT HStorageSystem :
54
H_DISABLE_COPY(HStorageSystem)
55
H_DECLARE_PRIVATE(HStorageSystem)
60
* Constructs a new instance.
62
* \param clazz specifies the UPnP class of the object. This cannot be empty.
64
* \param cdsType specifies the CDS type of the object. This cannot be
65
* HObject::UndefinedCdsType.
69
HStorageSystem(const QString& clazz = sClass(), CdsType cdsType = sType());
70
HStorageSystem(HStorageSystemPrivate&);
72
// Documented in HClonable
73
virtual HStorageSystem* newInstance() const;
78
* \brief Creates a new instance.
80
* \param title specifies the title of the object.
82
* \param parentId specifies the ID of the object that contains this
83
* object. If the object has no parent, this has to be left empty.
85
* \param id specifies the ID of this object. If this is not specified,
86
* a unique identifier within the running process is created for the object.
92
const QString& parentId,
93
const QString& id = QString());
96
* \brief Destroys the instance.
98
virtual ~HStorageSystem();
101
* \brief Returns the total capacity in bytes of the storage represented by the
104
* upnp:storageTotal, ContentDirectory:3, Appendix B.6.1.
106
* \return he total capacity in bytes of the storage represented by the
109
* \sa setStorageTotal()
111
qint64 storageTotal() const;
114
* \brief Returns the combined space in bytes used by all the objects held
115
* in storage represented by this container.
117
* upnp:storageUsed, ContentDirectory:3, Appendix B.6.2.
119
* \return The combined space in bytes used by all the objects held
120
* in storage represented by this container.
122
* \sa setStorageUsed()
124
qint64 storageUsed() const;
127
* \brief Returns the total free capacity in bytes of the storage represented by
130
* upnp:storageFree, ContentDirectory:3, Appendix B.6.3
132
* \return The total free capacity in bytes of the storage represented by
135
* \sa setStorageFree()
137
qint64 storageFree() const;
140
* \brief Returns the largest amount of space in bytes available for storing
141
* a single resource in the container.
143
* upnp:storageMaxPartition, ContentDirectory:3, Appendix B.6.4.
145
* \return The largest amount of space in bytes available for storing
146
* a single resource in the container.
148
* \sa setStorageMaxPartition()
150
qint64 storageMaxPartition() const;
153
* \brief Indicates the type of storage medium used for the content.
155
* upnp:storageMedium, ContentDirectory:3, Appendix B.6.5.
157
* \return The type of storage medium used for the content.
159
* \sa setStorageMedium()
161
HStorageMedium storageMedium() const;
164
* \brief Specifies the total capacity in bytes of the storage represented by the
167
* \param arg specifies the total capacity in bytes of the storage represented by the
172
void setStorageTotal(qint64 arg);
175
* \brief Specifies the combined space in bytes used by all the objects held
176
* in storage represented by this container.
178
* \param arg specifies the combined space in bytes used by all the objects held
179
* in storage represented by this container.
183
void setStorageUsed(qint64 arg);
186
* \brief Specifies the total free capacity in bytes of the storage represented by
189
* \param arg specifies the total free capacity in bytes of the storage represented by
194
void setStorageFree(qint64 arg);
197
* \brief Specifies the largest amount of space in bytes available for storing
198
* a single resource in the container.
200
* \param arg specifies the largest amount of space in bytes available for storing
201
* a single resource in the container.
203
* \sa storageMaxPartition()
205
void setStorageMaxPartition(qint64 arg);
208
* \brief Specifies the type of storage medium used for the content.
210
* \param arg specifies the type of storage medium used for the content.
212
* \sa storageMedium()
214
void setStorageMedium(const HStorageMedium& arg);
217
* \brief Returns the CdsType value of this class.
219
* \return The CdsType value of this class.
221
inline static CdsType sType() { return StorageSystem; }
224
* \brief Returns the class identifier specified by the AV Working Committee.
226
* \return The class identifier specified by the AV Working Committee.
228
inline static QString sClass() { return "object.container.storageSystem"; }
231
* Creates a new instance with no title or parentID.
233
* \return a pointer to the newly created instance.
235
* \remarks the ownership of the object is transferred to the caller. Make sure
236
* to delete the object.
238
inline static HStorageSystem* create() { return new HStorageSystem(); }
245
#endif /* HSTORAGESYSTEM_H_ */