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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
/*
 *  Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
 *
 *  Author: Tuomo Penttinen <tp@herqq.org>
 *
 *  This file is part of Herqq UPnP Av (HUPnPAv) library.
 *
 *  Herqq UPnP Av is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Herqq UPnP Av is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Herqq UPnP Av. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef HLASTCHANGEINFO_H_
#define HLASTCHANGEINFO_H_

#include <HUpnpAv/HUpnpAv>

namespace Herqq
{

namespace Upnp
{

namespace Av
{

class HCdsLastChangeInfoPrivate;

/*!
 * \brief This class is used to contain information of a LastChange event.
 *
 * \headerfile hcds_lastchange_info.h HCdsLastChangeInfo
 *
 * \ingroup hupnp_av_cds_browsing
 *
 * \remarks This class is not thread-safe.
 *
 * \sa HMediaBrowser
 */
class H_UPNP_AV_EXPORT HCdsLastChangeInfo
{
public:

    /*!
     * \brief This enumeration defines the different event types used in LastChange
     * Data Format.
     */
    enum EventType
    {
        /*!
         * The event type is not defined.
         */
        Undefined = 0,

        /*!
         * A new object was added.
         */
        ObjectAdded,

        /*!
         * An existing object was modified.
         */
        ObjectModified,

        /*!
         * An object was deleted.
         */
        ObjectDeleted
    };

private:

    HCdsLastChangeInfoPrivate* h_ptr;

public:

    /*!
     * Creates a new, invalid instance.
     *
     * \sa isValid()
     */
    HCdsLastChangeInfo();

    /*!
     * \brief Creates a new instance.
     *
     * \param objectId specifies the ID of the object.
     *
     * \param eventType specifies the type of the event.
     *
     * \sa isValid()
     */
    HCdsLastChangeInfo(const QString& objectId, EventType eventType);

    /*!
     * \brief Destroys the instance.
     */
    ~HCdsLastChangeInfo();

    /*!
     * \brief Copy constructor.
     *
     * Creates a copy of \c other.
     */
    HCdsLastChangeInfo(const HCdsLastChangeInfo&);

    /*!
     * \brief Assignment operator.
     *
     * Copies the contents of \c other to this.
     */
    HCdsLastChangeInfo& operator=(const HCdsLastChangeInfo&);

    /*!
     * \brief Specifies the ID of the object.
     *
     * \param id specifies the ID of the object.
     *
     * \sa objectId()
     */
    void setObjectId(const QString& id);

    /*!
     * \brief Specifies the type of the event.
     *
     * \param type specifies the type of the event.
     *
     * \sa eventType()
     */
    void setEventType(EventType type);

    /*!
     * \brief Specifies the ID of the parent object.
     *
     * \param id specifies the ID of the parent object.
     *
     * \sa parentId()
     */
    void setParentId(const QString& id);

    /*!
     * \brief Specifies the value of the upnp:class property.
     *
     * \param objClass specifies the value of the upnp:class property.
     *
     * \sa objectClass()
     */
    void setObjectClass(const QString& objClass);

    /*!
     * Specifies the value of the SystemUpdateID state variable that
     * resulted when the object was modified.
     *
     * \param arg specifies the value of the SystemUpdateID state variable that
     * resulted when the object was modified.
     *
     * \sa updateId()
     */
    void setUpdateId(quint32 arg);

    /*!
     * Specifies whether the change was part of a sub-tree operation.
     *
     * \param set specifies whether the change was part of a sub-tree operation.
     *
     * \sa stUpdate()
     */
    void setStUpdate(bool set);

    /*!
     * \brief Indicates the validity of the object.
     *
     * \return \e true in case the object is valid, i.e. at least objectId() and
     * eventType() are defined.
     */
    bool isValid() const;

    /*!
     * \brief Returns the ID of the object.
     *
     * \return The ID of the object.
     *
     * \sa setObjectId()
     */
    QString objectId() const;

    /*!
     * \brief Returns the type of the event.
     *
     * \return The type of the event.
     *
     * \sa setEventType()
     */
    EventType eventType() const;

    /*!
     * \brief Returns the ID of the parent object.
     *
     * \return The ID of the parent object.
     *
     * \sa setParentId()
     */
    QString parentId() const;

    /*!
     * \brief Returns the value of the upnp:class property.
     *
     * \return the value of the upnp:class property.
     *
     * \sa setObjectClass()
     */
    QString objectClass() const;

    /*!
     * Returns the value of the SystemUpdateID state variable that
     * resulted when the object was modified.
     *
     * \return the value of the SystemUpdateID state variable that
     * resulted when the object was modified.
     *
     * \sa setUpdateId()
     */
    quint32 updateId() const;

    /*!
     * Indicates whether the change was part of a sub-tree operation.
     *
     * \return \e true if the change was part of a sub-tree operation.
     *
     * \sa setStUpdate();
     */
    bool stUpdate() const;
};

/*!
 * Compares the two objects for equality.
 *
 * \return \e true in case the objects are logically equivalent.
 *
 * \relates HCdsLastChangeInfo
 */
H_UPNP_AV_EXPORT bool operator==(const HCdsLastChangeInfo& obj1, const HCdsLastChangeInfo& obj2);

/*!
 * Compares the two objects for inequality.
 *
 * \return \e true in case the objects are not logically equivalent.
 *
 * \relates HCdsLastChangeInfo
 */
inline bool operator!=(const HCdsLastChangeInfo& obj1, const HCdsLastChangeInfo& obj2)
{
    return !(obj1 == obj2);
}

}
}
}

#endif /* HLASTCHANGEINFO_H_ */