Merge remote-tracking branch 'origin/api_changes'
[profile/ivi/qtbase.git] / src / dbus / qdbusextratypes.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the QtDBus module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
20 **
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
28 **
29 ** Other Usage
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #include "qdbusextratypes.h"
43 #include "qdbusutil_p.h"
44
45 #ifndef QT_NO_DBUS
46
47 QT_BEGIN_NAMESPACE
48
49 void QDBusObjectPath::doCheck()
50 {
51     if (!QDBusUtil::isValidObjectPath(m_path)) {
52         qWarning("QDBusObjectPath: invalid path \"%s\"", qPrintable(m_path));
53         m_path.clear();
54     }
55 }
56
57 void QDBusSignature::doCheck()
58 {
59     if (!QDBusUtil::isValidSignature(m_signature)) {
60         qWarning("QDBusSignature: invalid signature \"%s\"", qPrintable(m_signature));
61         m_signature.clear();
62     }
63 }
64
65 /*!
66     \class QDBusVariant
67     \inmodule QtDBus
68     \since 4.2
69
70     \brief The QDBusVariant class enables the programmer to identify
71     the variant type provided by the D-Bus typesystem.
72
73     A D-Bus function that takes an integer, a D-Bus variant and a string as parameters
74     can be called with the following argument list (see QDBusMessage::setArguments()):
75
76     \snippet doc/src/snippets/qdbusextratypes/qdbusextratypes.cpp 0
77
78     When a D-Bus function returns a D-Bus variant, it can be retrieved as follows:
79
80     \snippet doc/src/snippets/qdbusextratypes/qdbusextratypes.cpp 1
81
82     The QVariant within a QDBusVariant is required to distinguish between a normal
83     D-Bus value and a value within a D-Bus variant.
84
85     \sa {The QtDBus type system}
86 */
87
88 /*!
89     \fn QDBusVariant::QDBusVariant()
90
91     Constructs a new D-Bus variant.
92 */
93
94 /*!
95     \fn QDBusVariant::QDBusVariant(const QVariant &variant)
96
97     Constructs a new D-Bus variant from the given Qt \a variant.
98
99     \sa setVariant()
100 */
101
102 /*!
103     \fn QVariant QDBusVariant::variant() const
104
105     Returns this D-Bus variant as a QVariant object.
106
107     \sa setVariant()
108 */
109
110 /*!
111     \fn void QDBusVariant::setVariant(const QVariant &variant)
112
113     Assigns the value of the given Qt \a variant to this D-Bus variant.
114
115     \sa variant()
116 */
117
118 /*!
119     \class QDBusObjectPath
120     \inmodule QtDBus
121     \since 4.2
122
123     \brief The QDBusObjectPath class enables the programmer to
124     identify the OBJECT_PATH type provided by the D-Bus typesystem.
125
126     \sa {The QtDBus type system}
127 */
128
129 /*!
130     \fn QDBusObjectPath::QDBusObjectPath()
131
132     Constructs a new object path.
133 */
134
135 /*!
136     \fn QDBusObjectPath::QDBusObjectPath(const char *path)
137
138     Constructs a new object path from the given \a path.
139
140     \sa setPath()
141 */
142
143 /*!
144     \fn QDBusObjectPath::QDBusObjectPath(const QLatin1String &path)
145
146     Constructs a new object path from the given \a path.
147 */
148
149 /*!
150     \fn QDBusObjectPath::QDBusObjectPath(const QString &path)
151
152     Constructs a new object path from the given \a path.
153 */
154
155 /*!
156     \fn QString QDBusObjectPath::path() const
157
158     Returns this object path.
159
160     \sa setPath()
161 */
162
163 /*!
164     \fn void QDBusObjectPath::setPath(const QString &path)
165
166     Assigns the value of the given \a path to this object path.
167
168     \sa path()
169 */
170
171 /*!
172     \fn QDBusObjectPath &QDBusObjectPath::operator=(const QDBusObjectPath &path)
173
174     Assigns the value of the given \a path to this object path.
175
176     \sa setPath()
177 */
178
179
180 /*!
181     \class QDBusSignature
182     \inmodule QtDBus
183     \since 4.2
184
185     \brief The QDBusSignature class enables the programmer to
186     identify the SIGNATURE type provided by the D-Bus typesystem.
187
188     \sa {The QtDBus type system}
189 */
190
191 /*!
192     \fn QDBusSignature::QDBusSignature()
193
194     Constructs a new signature.
195
196     \sa setSignature()
197 */
198
199 /*!
200     \fn QDBusSignature::QDBusSignature(const char *signature)
201
202     Constructs a new signature from the given \a signature.
203 */
204
205 /*!
206     \fn QDBusSignature::QDBusSignature(const QLatin1String &signature)
207
208     Constructs a new signature from the given \a signature.
209 */
210
211 /*!
212     \fn QDBusSignature::QDBusSignature(const QString &signature)
213
214     Constructs a new signature from the given \a signature.
215 */
216
217 /*!
218     \fn QString QDBusSignature::signature() const
219
220     Returns this signature.
221
222     \sa setSignature()
223 */
224
225 /*!
226     \fn void QDBusSignature::setSignature(const QString &signature)
227
228     Assigns the value of the given \a signature to this signature.
229     \sa signature()
230 */
231
232 /*!
233     \fn QDBusSignature &QDBusSignature::operator=(const QDBusSignature &signature)
234
235     Assigns the value of the given \a signature to this signature.
236
237     \sa setSignature()
238 */
239
240 QT_END_NAMESPACE
241
242 #endif // QT_NO_DBUS