~ubuntu-branches/ubuntu/vivid/digikam/vivid

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp/src/devicemodel/client/hclientstatevariable.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2010, 2011 Tuomo Penttinen, all rights reserved.
 
3
 *
 
4
 *  Author: Tuomo Penttinen <tp@herqq.org>
 
5
 *
 
6
 *  This file is part of Herqq UPnP (HUPnP) library.
 
7
 *
 
8
 *  Herqq UPnP is free software: you can redistribute it and/or modify
 
9
 *  it under the terms of the GNU Lesser 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 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 Lesser General Public License for more details.
 
17
 *
 
18
 *  You should have received a copy of the GNU Lesser General Public License
 
19
 *  along with Herqq UPnP. If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
 
 
22
#ifndef HCLIENT_STATEVARIABLE_H_
 
23
#define HCLIENT_STATEVARIABLE_H_
 
24
 
 
25
#include <HUpnpCore/HUpnpDataTypes>
 
26
 
 
27
#include <QtCore/QObject>
 
28
#include <QtCore/QVariant>
 
29
 
 
30
namespace Herqq
 
31
{
 
32
 
 
33
namespace Upnp
 
34
{
 
35
 
 
36
class HStateVariablePrivate;
 
37
 
 
38
/*!
 
39
 * \brief A client-side class that represents a server-side UPnP state variable.
 
40
 *
 
41
 * \c %HClientStateVariable is a core component of the HUPnP's client-side \ref hupnp_devicemodel
 
42
 * and it models a UPnP state variable. The UPnP Device Architecture specifies a
 
43
 * UPnP state variable as an item or aspect that models state in a service.
 
44
 * In a way a state variable is an abstraction to a member variable inside a
 
45
 * UPnP service.
 
46
 *
 
47
 * A state variable can be \e evented in which case it notifies interested listeners
 
48
 * of changes in its value. You can see if a state variable is evented by checking
 
49
 * the HStateVariableInfo object using info() and you can connect to the signal
 
50
 * valueChanged() to be notified when the value of the state variable changes.
 
51
 * Note, only evented state variables emit the valueChanged() signal.
 
52
 *
 
53
 * \headerfile hclientstatevariable.h HClientStateVariable
 
54
 *
 
55
 * \ingroup hupnp_devicemodel
 
56
 *
 
57
 * \sa HClientService
 
58
 *
 
59
 * \remarks This class is not thread-safe.
 
60
 */
 
61
class H_UPNP_CORE_EXPORT HClientStateVariable :
 
62
    public QObject
 
63
{
 
64
Q_OBJECT
 
65
H_DISABLE_COPY(HClientStateVariable)
 
66
 
 
67
protected:
 
68
 
 
69
    HStateVariablePrivate* h_ptr;
 
70
 
 
71
    /*!
 
72
     * \brief Creates a new instance.
 
73
     *
 
74
     * \param info specifies information of the state variable. This is often
 
75
     * read from a service description document.
 
76
     *
 
77
     * \param parent specifies the UPnP service instance that contains this
 
78
     * state variable.
 
79
     */
 
80
    HClientStateVariable(const HStateVariableInfo& info, HClientService* parent);
 
81
 
 
82
    /*!
 
83
     * Changes the value of the state variable. If the instance is evented,
 
84
     * the valueChanged() signal is emitted after the value has been changed.
 
85
     *
 
86
     * \param newValue specifies the new value of the state variable. The new value
 
87
     * must have the same underlying data type as the previous value
 
88
     * (and the default value). If the new value has different data type, the value
 
89
     * is not changed, no event is sent and false is returned.
 
90
     *
 
91
     * \retval true in case the new value was successfully set.
 
92
     * \retval false in case the new value could not be set.
 
93
     *
 
94
     * \remarks the new value will be set if the value:
 
95
     *  - does not violate the defined constraints
 
96
     *  - has the same variant type or the type of the new value can be converted
 
97
     *  to the same variant type
 
98
     *  - is not QVariant::Invalid
 
99
     */
 
100
    bool setValue(const QVariant& newValue);
 
101
 
 
102
public:
 
103
 
 
104
    /*!
 
105
     * \brief Destroys the instance.
 
106
     *
 
107
     * An \c %HClientStateVariable is always destroyed by the
 
108
     * \c %HClientService that contains it when it is being deleted.
 
109
     * Further, unless you hold the ownership of the \c %HClientStateVariable
 
110
     * instance, you should never destroy it.
 
111
     */
 
112
    virtual ~HClientStateVariable() = 0;
 
113
 
 
114
    /*!
 
115
     * \brief Returns the HClientService that contains this state variable.
 
116
     *
 
117
     * \return The HClientService that contains this state variable.
 
118
     *
 
119
     * \warning the pointer is guaranteed to point to a valid object as long
 
120
     * as the \c %HClientStateVariable exists, which ultimately is as long as the
 
121
     * containing root device exists.
 
122
     */
 
123
    HClientService* parentService() const;
 
124
 
 
125
    /*!
 
126
     * \brief Returns the current value of the state variable.
 
127
     *
 
128
     * \return The current value of the state variable.
 
129
     */
 
130
    QVariant value() const;
 
131
 
 
132
    /*!
 
133
     * \brief Returns information about the state variable.
 
134
     *
 
135
     * \return information about the state variable. This information is often read
 
136
     * from a service description document.
 
137
     */
 
138
    const HStateVariableInfo& info() const;
 
139
 
 
140
Q_SIGNALS:
 
141
 
 
142
    /*!
 
143
     * \brief This signal is emitted when the value of the state variable has changed.
 
144
     *
 
145
     * \param source specifies the state variable that sent the event.
 
146
     *
 
147
     * \param event specifies information about the event that occurred.
 
148
     *
 
149
     * \remarks This signal has thread affinity to the thread where the object
 
150
     * resides. Do not connect to this signal from other threads.
 
151
     */
 
152
    void valueChanged(
 
153
        const Herqq::Upnp::HClientStateVariable* source,
 
154
        const Herqq::Upnp::HStateVariableEvent& event);
 
155
};
 
156
 
 
157
}
 
158
}
 
159
 
 
160
#endif /* HCLIENT_STATEVARIABLE_H_ */