~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp_av/src/cds_model/hstatevariablecollection.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-09-27 21:41:30 UTC
  • mfrom: (1.2.43)
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: package-import@ubuntu.com-20120927214130-i8v3ufr21nesp29i
Tags: 4:3.0.0~beta1a-1
* New upstream release

* Fix "wrongly conflicts phonon-backend-vlc" dropped (Closes: #688142)
* debian/watch include download.kde.org

* digikam 3.0.0 uses features from unreleased kdegraphics >=4.10 & ships 
a private version of the kdegraphics libs - this is not the Debian way :-(
* Unsatisfactory Conflicts: libkipi8, libkexiv2-10, libkdcraw20, libksane0
* Suspend digikam-dbg >130Mb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
 
3
 *
 
4
 *  Author: Tuomo Penttinen <tp@herqq.org>
 
5
 *
 
6
 *  This file is part of Herqq UPnP Av (HUPnPAv) library.
 
7
 *
 
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.
 
12
 *
 
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.
 
17
 *
 
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/>.
 
20
 */
 
21
 
 
22
#ifndef HSTATEVARIABLECOLLECTION_H_
 
23
#define HSTATEVARIABLECOLLECTION_H_
 
24
 
 
25
#include <HUpnpAv/HUpnpAv>
 
26
#include <HUpnpAv/HChannel>
 
27
 
 
28
#include <QtCore/QMetaType>
 
29
#include <QtCore/QSharedDataPointer>
 
30
 
 
31
namespace Herqq
 
32
{
 
33
 
 
34
namespace Upnp
 
35
{
 
36
 
 
37
namespace Av
 
38
{
 
39
 
 
40
/*!
 
41
 * Encapsulates the state of a single state variable.
 
42
 *
 
43
 * \headerfile hstatevariablecollection.h HStateVariableData
 
44
 *
 
45
 * \ingroup hupnp_av_cds_common
 
46
 *
 
47
 * \remarks This class is not thread-safe.
 
48
 */
 
49
class H_UPNP_AV_EXPORT HStateVariableData
 
50
{
 
51
private:
 
52
 
 
53
    QString m_svName, m_svValue;
 
54
    HChannel m_channel;
 
55
 
 
56
public:
 
57
 
 
58
    /*!
 
59
     * Creates a new, invalid instance.
 
60
     *
 
61
     * \sa isValid()
 
62
     */
 
63
    HStateVariableData();
 
64
 
 
65
    /*!
 
66
     * Creates a new, invalid instance.
 
67
     *
 
68
     * \param name specifies the name of the state variable.
 
69
     *
 
70
     * \param value specifies the value of the state variable.
 
71
     *
 
72
     * \sa isValid()
 
73
     */
 
74
    HStateVariableData(
 
75
        const QString& name, const QString& value, const HChannel& = HChannel());
 
76
 
 
77
   /*!
 
78
     * \brief Indicates if the object is valid.
 
79
     *
 
80
     * \return \e true if the object is valid, i.e. name() is defined.
 
81
     */
 
82
    bool isValid() const;
 
83
 
 
84
    /*!
 
85
     * \brief Returns the name of the state variable.
 
86
     *
 
87
     * \return The name of the state variable.
 
88
     */
 
89
    inline QString name() const
 
90
    {
 
91
        return m_svName;
 
92
    }
 
93
 
 
94
    /*!
 
95
     * \brief Returns the value of the state variable.
 
96
     *
 
97
     * \return The value of the state variable.
 
98
     */
 
99
    inline QString value() const
 
100
    {
 
101
        return m_svValue;
 
102
    }
 
103
 
 
104
    /*!
 
105
     * \brief Returns the associated channel of audio stream, if any.
 
106
     *
 
107
     * \return The associated channel of audio stream, if any.
 
108
     */
 
109
    inline const HChannel& channel() const
 
110
    {
 
111
        return m_channel;
 
112
    }
 
113
 
 
114
    /*!
 
115
     * \brief Specifies the name of the state variable.
 
116
     *
 
117
     * \param arg specifies the name of the state variable.
 
118
     */
 
119
    void setName(const QString& arg);
 
120
 
 
121
    /*!
 
122
     * \brief Specifies the value of the state variable.
 
123
     *
 
124
     * \param arg specifies the value of the state variable.
 
125
     */
 
126
    void setValue(const QString& arg);
 
127
 
 
128
    /*!
 
129
     * \brief Specifies the associated channel of audio stream.
 
130
     *
 
131
     * \param arg specifies the associated channel of audio stream.
 
132
     */
 
133
    void setChannel(const HChannel& arg);
 
134
};
 
135
 
 
136
/*!
 
137
 * Compares the two objects for equality.
 
138
 *
 
139
 * \return \e true in case the objects are logically equivalent.
 
140
 *
 
141
 * \relates HStateVariableData
 
142
 */
 
143
H_UPNP_AV_EXPORT bool operator==(const HStateVariableData& obj1, const HStateVariableData& obj2);
 
144
 
 
145
/*!
 
146
 * Compares the two objects for inequality.
 
147
 *
 
148
 * \return \e true in case the objects are not logically equivalent.
 
149
 *
 
150
 * \relates HStateVariableData
 
151
 */
 
152
inline bool operator!=(const HStateVariableData& obj1, const HStateVariableData& obj2)
 
153
{
 
154
    return !(obj1 == obj2);
 
155
}
 
156
 
 
157
class HStateVariableCollectionPrivate;
 
158
 
 
159
/*!
 
160
 * \brief This class is used to encapsulate the state of a set of state variables.
 
161
 *
 
162
 * \headerfile hstatevariablecollection.h HStateVariableCollection
 
163
 *
 
164
 * \ingroup hupnp_av_cds_common
 
165
 *
 
166
 * \remarks This class is not thread-safe.
 
167
 */
 
168
class H_UPNP_AV_EXPORT HStateVariableCollection
 
169
{
 
170
private:
 
171
 
 
172
    QSharedDataPointer<HStateVariableCollectionPrivate> h_ptr;
 
173
 
 
174
public:
 
175
 
 
176
    /*!
 
177
     * \brief This enumeration specifies whether a RenderingControl service instance
 
178
     * is pre-mix or post-mix.
 
179
     *
 
180
     * \see ContentDirectory:3, Appendix B.13.5.2.
 
181
     */
 
182
    enum RcsInstanceType
 
183
    {
 
184
        /*!
 
185
         * The RCS instance type is not defined.
 
186
         */
 
187
        Undefined,
 
188
 
 
189
        /*!
 
190
         * Pre-mix.
 
191
         */
 
192
        PreMix,
 
193
 
 
194
        /*!
 
195
         * Post-mix.
 
196
         */
 
197
        PostMix
 
198
    };
 
199
 
 
200
    /*!
 
201
     * Creates a new, invalid instance.
 
202
     *
 
203
     * \sa isValid()
 
204
     */
 
205
    HStateVariableCollection();
 
206
 
 
207
    /*!
 
208
     * Creates a new, invalid instance.
 
209
     *
 
210
     * \sa isValid()
 
211
     */
 
212
    HStateVariableCollection(
 
213
        const QString& serviceName, RcsInstanceType rcsInstanceType = Undefined);
 
214
 
 
215
    /*!
 
216
     * \brief Destroys the instance.
 
217
     */
 
218
    ~HStateVariableCollection();
 
219
 
 
220
    /*!
 
221
     * \brief Copy constructor.
 
222
     *
 
223
     * Creates a copy of \c other.
 
224
     */
 
225
    HStateVariableCollection(const HStateVariableCollection&);
 
226
 
 
227
    /*!
 
228
     * \brief Assignment operator.
 
229
     *
 
230
     * Copies the contents of \c other to this.
 
231
     */
 
232
    HStateVariableCollection& operator=(const HStateVariableCollection&);
 
233
 
 
234
    /*!
 
235
     * \brief Indicates if the object is valid.
 
236
     *
 
237
     * \return \e true if the object is valid, i.e. serviceName() is defined.
 
238
     */
 
239
    bool isValid() const;
 
240
 
 
241
    /*!
 
242
     * Converts the specified RcsInstanceType value to string.
 
243
     *
 
244
     * \param type specifies the RcsInstanceType value to be converted to string.
 
245
     *
 
246
     * \return a string representation of the specified RcsInstanceType value.
 
247
     */
 
248
    static QString toString(RcsInstanceType type);
 
249
 
 
250
    /*!
 
251
     * \brief Returns a RcsInstanceType value corresponding to the specified string, if any.
 
252
     *
 
253
     * \param type specifies the RcsInstanceType as string.
 
254
     *
 
255
     * \return a RcsInstanceType value corresponding to the specified string, if any.
 
256
     */
 
257
    static RcsInstanceType fromString(const QString& type);
 
258
 
 
259
    /*!
 
260
     * \brief Returns the name of the service from which the state variables were retrieved.
 
261
     *
 
262
     * \return The name of the service from which the state variables were retrieved.
 
263
     */
 
264
    QString serviceName() const;
 
265
 
 
266
    /*!
 
267
     * \brief Indicates whether a RenderingControl service instance
 
268
     * is pre-mix or post-mix.
 
269
     *
 
270
     * \return a value indicating whether a RenderingControl service instance
 
271
     * is pre-mix or post-mix.
 
272
     */
 
273
    RcsInstanceType rcsInstanceType() const;
 
274
 
 
275
    /*!
 
276
     * \brief Returns the state variable data.
 
277
     *
 
278
     * \return The state variable data.
 
279
     *
 
280
     * \sa setStateVariables()
 
281
     */
 
282
    QList<HStateVariableData> stateVariables() const;
 
283
 
 
284
    /*!
 
285
     * \brief Specifies whether a RenderingControl service instance
 
286
     * is pre-mix or post-mix.
 
287
     *
 
288
     * \param arg specifies whether a RenderingControl service instance
 
289
     * is pre-mix or post-mix.
 
290
     *
 
291
     * \sa rcsInstanceType()
 
292
     */
 
293
    void setRcsInstanceType(RcsInstanceType arg);
 
294
 
 
295
    /*!
 
296
     * \brief Specifies the state variable data.
 
297
     *
 
298
     * \param arg specifies the state variable data.
 
299
     *
 
300
     * \sa stateVariables()
 
301
     */
 
302
    void setStateVariables(const QList<HStateVariableData>& arg);
 
303
 
 
304
    /*!
 
305
     * Adds a new state variable data instance to the collection.
 
306
     *
 
307
     * \param arg specifies the state variable data instance to add.
 
308
     *
 
309
     * \sa setStateVariables()
 
310
     *
 
311
     * \remarks only valid HStateVariableData instances are added.
 
312
     */
 
313
    void add(const HStateVariableData& arg);
 
314
};
 
315
 
 
316
/*!
 
317
 * Compares the two objects for equality.
 
318
 *
 
319
 * \return \e true in case the objects are logically equivalent.
 
320
 *
 
321
 * \relates HStateVariableCollection
 
322
 */
 
323
H_UPNP_AV_EXPORT bool operator==(const HStateVariableCollection& obj1, const HStateVariableCollection& obj2);
 
324
 
 
325
/*!
 
326
 * Compares the two objects for inequality.
 
327
 *
 
328
 * \return \e true in case the objects are not logically equivalent.
 
329
 *
 
330
 * \relates HStateVariableCollection
 
331
 */
 
332
inline bool operator!=(const HStateVariableCollection& obj1, const HStateVariableCollection& obj2)
 
333
{
 
334
    return !(obj1 == obj2);
 
335
}
 
336
 
 
337
}
 
338
}
 
339
}
 
340
 
 
341
Q_DECLARE_METATYPE(Herqq::Upnp::Av::HStateVariableCollection)
 
342
 
 
343
#endif /* HSTATEVARIABLECOLLECTION_H_ */