1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtDBus module of the Qt Toolkit.
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.
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.
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.
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.
40 ****************************************************************************/
42 #include "qdbusextratypes.h"
43 #include "qdbusutil_p.h"
49 void QDBusObjectPath::doCheck()
51 if (!QDBusUtil::isValidObjectPath(m_path)) {
52 qWarning("QDBusObjectPath: invalid path \"%s\"", qPrintable(m_path));
57 void QDBusSignature::doCheck()
59 if (!QDBusUtil::isValidSignature(m_signature)) {
60 qWarning("QDBusSignature: invalid signature \"%s\"", qPrintable(m_signature));
70 \brief The QDBusVariant class enables the programmer to identify
71 the variant type provided by the D-Bus typesystem.
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()):
76 \snippet doc/src/snippets/qdbusextratypes/qdbusextratypes.cpp 0
78 When a D-Bus function returns a D-Bus variant, it can be retrieved as follows:
80 \snippet doc/src/snippets/qdbusextratypes/qdbusextratypes.cpp 1
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.
85 \sa {The QtDBus type system}
89 \fn QDBusVariant::QDBusVariant()
91 Constructs a new D-Bus variant.
95 \fn QDBusVariant::QDBusVariant(const QVariant &variant)
97 Constructs a new D-Bus variant from the given Qt \a variant.
103 \fn QVariant QDBusVariant::variant() const
105 Returns this D-Bus variant as a QVariant object.
111 \fn void QDBusVariant::setVariant(const QVariant &variant)
113 Assigns the value of the given Qt \a variant to this D-Bus variant.
119 \class QDBusObjectPath
123 \brief The QDBusObjectPath class enables the programmer to
124 identify the OBJECT_PATH type provided by the D-Bus typesystem.
126 \sa {The QtDBus type system}
130 \fn QDBusObjectPath::QDBusObjectPath()
132 Constructs a new object path.
136 \fn QDBusObjectPath::QDBusObjectPath(const char *path)
138 Constructs a new object path from the given \a path.
144 \fn QDBusObjectPath::QDBusObjectPath(const QLatin1String &path)
146 Constructs a new object path from the given \a path.
150 \fn QDBusObjectPath::QDBusObjectPath(const QString &path)
152 Constructs a new object path from the given \a path.
156 \fn QString QDBusObjectPath::path() const
158 Returns this object path.
164 \fn void QDBusObjectPath::setPath(const QString &path)
166 Assigns the value of the given \a path to this object path.
172 \fn QDBusObjectPath &QDBusObjectPath::operator=(const QDBusObjectPath &path)
174 Assigns the value of the given \a path to this object path.
181 \class QDBusSignature
185 \brief The QDBusSignature class enables the programmer to
186 identify the SIGNATURE type provided by the D-Bus typesystem.
188 \sa {The QtDBus type system}
192 \fn QDBusSignature::QDBusSignature()
194 Constructs a new signature.
200 \fn QDBusSignature::QDBusSignature(const char *signature)
202 Constructs a new signature from the given \a signature.
206 \fn QDBusSignature::QDBusSignature(const QLatin1String &signature)
208 Constructs a new signature from the given \a signature.
212 \fn QDBusSignature::QDBusSignature(const QString &signature)
214 Constructs a new signature from the given \a signature.
218 \fn QString QDBusSignature::signature() const
220 Returns this signature.
226 \fn void QDBusSignature::setSignature(const QString &signature)
228 Assigns the value of the given \a signature to this signature.
233 \fn QDBusSignature &QDBusSignature::operator=(const QDBusSignature &signature)
235 Assigns the value of the given \a signature to this signature.