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

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp/src/devicemodel/client/hclientdevice_adapter.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 HCLIENTDEVICE_ADAPTER_H_
 
23
#define HCLIENTDEVICE_ADAPTER_H_
 
24
 
 
25
#include <HUpnpCore/HUpnp>
 
26
 
 
27
#include <QtCore/QObject>
 
28
 
 
29
namespace Herqq
 
30
{
 
31
 
 
32
namespace Upnp
 
33
{
 
34
 
 
35
class HClientDeviceAdapterPrivate;
 
36
 
 
37
/*!
 
38
 * This is an abstract base class for classes that compose HClientDevice instances
 
39
 * and provide alternate interfaces for interacting with HClientDevices.
 
40
 *
 
41
 * \headerfile hclientdevice_adapter.h HClientDeviceAdapter
 
42
 *
 
43
 * \ingroup hupnp_devicemodel
 
44
 *
 
45
 * \remarks This class is not thread-safe.
 
46
 */
 
47
class H_UPNP_CORE_EXPORT HClientDeviceAdapter :
 
48
    public QObject
 
49
{
 
50
Q_OBJECT
 
51
H_DISABLE_COPY(HClientDeviceAdapter)
 
52
 
 
53
protected:
 
54
 
 
55
    HClientDeviceAdapterPrivate* h_ptr;
 
56
 
 
57
    /*!
 
58
     * \brief Creates a new instance.
 
59
     *
 
60
     * \param deviceType specifies the UPnP device type this adapter can handle.
 
61
     * Note, every HClientDevice to be associated with this adapter has to be
 
62
     * of the specified device type.
 
63
     *
 
64
     * \param parent specifies the parent \c QObject.
 
65
     */
 
66
    HClientDeviceAdapter(const HResourceType& deviceType, QObject* parent = 0);
 
67
 
 
68
    //
 
69
    // \internal
 
70
    //
 
71
    HClientDeviceAdapter(
 
72
        HClientDeviceAdapterPrivate& dd, QObject* parent = 0);
 
73
 
 
74
    /*!
 
75
     * Prepares the instance to be associated with the specified HClientDevice.
 
76
     *
 
77
     * \param device specifies the device to be associated.
 
78
     *
 
79
     * \return \e true if the instance was successfully prepared to be used
 
80
     * with the specified HClientDevice. If \e false is returned the specified
 
81
     * HClientDevice was not associated with this instance and
 
82
     * isReady() will return \e false.
 
83
     */
 
84
    virtual bool prepareDevice(HClientDevice* device);
 
85
 
 
86
    /*!
 
87
     * \brief Specifies the device model info provider the adapter should use to validate
 
88
     * HClientDevice instances with which this instance is associated.
 
89
     *
 
90
     * \param infoProvider specifies the device model info provider to be used.
 
91
     */
 
92
    void setDeviceModelInfoProvider(const HDeviceModelInfoProvider&);
 
93
 
 
94
    /*!
 
95
     * \brief Returns the device model info provider the adapter uses to validate
 
96
     * HClientDevice instances with which this instance is associated.
 
97
     *
 
98
     * \return The device model info provider the adapter uses to validate
 
99
     * HClientDevice instances with which this instance is associated.
 
100
     */
 
101
    const HDeviceModelInfoProvider* deviceModelInfoProvider() const;
 
102
 
 
103
    /*!
 
104
     * Specifies a human readable error description.
 
105
     *
 
106
     * \param arg specifies a human readable error description.
 
107
     *
 
108
     * \sa lastErrorDescription()
 
109
     */
 
110
    void setLastErrorDescription(const QString& arg);
 
111
 
 
112
public:
 
113
 
 
114
    /*!
 
115
     * \brief Destroys the instance.
 
116
     */
 
117
    virtual ~HClientDeviceAdapter() = 0;
 
118
 
 
119
    /*!
 
120
     * \brief This enumeration specifies the different methods of validating
 
121
     * HClientDevice instances.
 
122
     */
 
123
    enum ValidationType
 
124
    {
 
125
        /*!
 
126
         * Only the device type should be checked to be correct.
 
127
         *
 
128
         * \sa deviceType()
 
129
         */
 
130
        MinimalValidation,
 
131
 
 
132
        /*!
 
133
         * The device type is checked and the device should be validated
 
134
         * using the deviceModelInfoProvider().
 
135
         */
 
136
        FullValidation
 
137
    };
 
138
 
 
139
    /*!
 
140
     * Associates the specified \c HClientDevice with this instance.
 
141
     *
 
142
     * \param device specifies the HClientDevice to be associated with this instance.
 
143
     *
 
144
     * \return \e true in case the \c device was successfully associated with
 
145
     * this instance.
 
146
     *
 
147
     * \sa device()
 
148
     */
 
149
    bool setDevice(HClientDevice* device, ValidationType vt = FullValidation);
 
150
 
 
151
    /*!
 
152
     * \brief Returns a human readable description of the last error occurred.
 
153
     *
 
154
     * \return a human readable description of the last error occurred.
 
155
     */
 
156
    QString lastErrorDescription() const;
 
157
 
 
158
    /*!
 
159
     * \brief Returns the \c HClientDevice associated with this instance.
 
160
     *
 
161
     * \return The \c HClientDevice associated with this instance, if any.
 
162
     * A null pointer is returned in case setDevice() has not been called
 
163
     * successfully.
 
164
     *
 
165
     * \sa setDevice()
 
166
     */
 
167
    HClientDevice* device() const;
 
168
 
 
169
    /*!
 
170
     * \brief Indicates if the object is ready to be used.
 
171
     *
 
172
     * \return \e true if the object is ready to be used.
 
173
     */
 
174
    bool isReady() const;
 
175
 
 
176
    /*!
 
177
     * \brief Returns the device type this adapter abstracts.
 
178
     *
 
179
     * \return The device type this adapter abstracts.
 
180
     */
 
181
    const HResourceType& deviceType() const;
 
182
};
 
183
 
 
184
}
 
185
}
 
186
 
 
187
#endif /* HCLIENTDEVICE_ADAPTER_H_ */