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 HCONTENTDIRECTORY_SERVICECONFIGURATION_H_
23
#define HCONTENTDIRECTORY_SERVICECONFIGURATION_H_
25
#include <HUpnpAv/HUpnpAv>
26
#include <HUpnpCore/HClonable>
37
class HContentDirectoryServiceConfigurationPrivate;
40
* \brief This class contains the configuration data passed to a HContentDirectoryService.
42
* \headerfile hcontentdirectory_serviceconfiguration.h HContentDirectoryServiceConfiguration
44
* \ingroup hupnp_av_cds
46
* \remarks This class is not thread-safe.
48
* \sa HContentDirectoryService
50
class H_UPNP_AV_EXPORT HContentDirectoryServiceConfiguration :
53
H_DISABLE_COPY(HContentDirectoryServiceConfiguration)
54
H_DECLARE_PRIVATE(HContentDirectoryServiceConfiguration)
58
HContentDirectoryServiceConfigurationPrivate* h_ptr;
59
HContentDirectoryServiceConfiguration(HContentDirectoryServiceConfigurationPrivate& dd);
61
// Documented in HClonable
62
virtual void doClone(HClonable* target) const;
63
// Documented in HClonable
64
virtual HContentDirectoryServiceConfiguration* newInstance() const;
69
* \brief Creates a new instance.
71
HContentDirectoryServiceConfiguration();
74
* \brief Destroys the instance.
76
virtual ~HContentDirectoryServiceConfiguration();
78
// Documented in HClonable
79
virtual HContentDirectoryServiceConfiguration* clone() const;
82
* \brief Indicates if the object is valid.
84
* \return \e true if the object is valid, i.e. the dataSource() is defined.
86
virtual bool isValid() const;
89
* Indicates if the configuration object has the ownership of the data source.
91
* \return \e true if the configuration object has the ownership of the data source.
93
* \remarks This function returns \e false when no data source is set.
95
* \sa setDataSource(), dataSource(), detachDataSource()
97
bool hasOwnershipOfDataSource() const;
100
* \brief Returns the data source to be used by the ContentDirectoryService.
102
* \return The data source to be used by the ContentDirectoryService.
106
* \remarks The ownership of the data source is \b never transferred.
108
* \sa setDatasource()
110
HAbstractCdsDataSource* dataSource() const;
113
* \brief Sets the data source.
115
* \param dataSource specifies the data source to be used by the
116
* HMediaServerDevice.
118
* \param takeOwnership specifies whether the ownership of the \c dataSource
119
* is passed to the ContentDirectoryService instance. If \e true, the ContentDirectoryService
120
* will delete the data source once it is done using it. Otherwise the caller
121
* is responsible for ensuring that the data source is not deleted before the
122
* ContentDirectoryService.
124
* \sa datasource(), detachDatasource()
126
void setDataSource(HAbstractCdsDataSource* dataSource, bool takeOwnership);
129
* \brief Detaches the data source associated with this instance, if any.
131
* If the object has a data source set and the object has the ownership of it,
132
* this call decreases the reference count of the associated data source.
133
* In this case if the reference count goes to zero the associated data source
136
* \sa setDataSource()
138
void detachDataSource();
145
#endif /* HCONTENTDIRECTORY_SERVICECONFIGURATION_H_ */