1/****************************************************************************
2**
3** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the QtDBus module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
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
47QT_BEGIN_NAMESPACE
48
49void QDBusObjectPath::check()
50{
51 if (!QDBusUtil::isValidObjectPath(*this)) {
52 qWarning("QDBusObjectPath: invalid path \"%s\"", qPrintable(*this));
53 clear();
54 }
55}
56
57void 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
240QT_END_NAMESPACE
241
242#endif // QT_NO_DBUS
243