1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation ([email protected])
|
---|
6 | **
|
---|
7 | ** This file is part of the QtDBus module of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Lesser General Public License Usage
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
18 | ** General Public License version 2.1 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
20 | ** packaging of this file. Please review the following information to
|
---|
21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
23 | **
|
---|
24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at [email protected].
|
---|
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::check()
|
---|
50 | {
|
---|
51 | if (!QDBusUtil::isValidObjectPath(*this)) {
|
---|
52 | qWarning("QDBusObjectPath: invalid path \"%s\"", qPrintable(*this));
|
---|
53 | clear();
|
---|
54 | }
|
---|
55 | }
|
---|
56 |
|
---|
57 | void QDBusSignature::check()
|
---|
58 | {
|
---|
59 | if (!QDBusUtil::isValidSignature(*this)) {
|
---|
60 | qWarning("QDBusSignature: invalid signature \"%s\"", qPrintable(*this));
|
---|
61 | 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
|
---|