Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qdbusintrospection_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QDBUSINTROSPECTION_P_H
5#define QDBUSINTROSPECTION_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of the QLibrary class. This header file may change from
13// version to version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtDBus/private/qtdbusglobal_p.h>
19#include <QtCore/qlist.h>
20#include <QtCore/qmap.h>
21#include <QtCore/qpair.h>
22#include <QtCore/qshareddata.h>
23#include <QtCore/qstring.h>
24#include <QtCore/qstringlist.h>
25
26#ifndef QT_NO_DBUS
27
29
30class Q_DBUS_EXPORT QDBusIntrospection
31{
32public:
33 // forward declarations
34 struct Argument;
35 struct Method;
36 struct Signal;
37 struct Property;
38 struct Interface;
39 struct Object;
40 struct ObjectTree;
41 struct Annotation;
42
43 // typedefs
51
52public:
53 // the structs
54
55 // Line and column numbers have the same meaning as in QXmlStreamReader.
57 {
58 qint64 lineNumber = 1;
59 qint64 columnNumber = 0;
60 };
61
63 {
64 public:
65 virtual void warning(const SourceLocation &location, const char *msg, ...)
67 virtual void error(const SourceLocation &location, const char *msg, ...)
69 };
70
71 struct Argument
72 {
76
77 inline bool operator==(const Argument& other) const
78 { return name == other.name && type == other.type; }
79 };
80
81 struct Method
82 {
88
89 inline bool operator==(const Method& other) const
90 { return name == other.name && annotations == other.annotations &&
91 inputArgs == other.inputArgs && outputArgs == other.outputArgs; }
92 };
93
94 struct Signal
95 {
100
101 inline bool operator==(const Signal& other) const
102 { return name == other.name && annotations == other.annotations &&
103 outputArgs == other.outputArgs; }
104 };
105
106 struct Property
107 {
108 enum Access { Read, Write, ReadWrite };
114
115 inline bool operator==(const Property& other) const
116 { return access == other.access && name == other.name &&
117 annotations == other.annotations && type == other.type; }
118 };
119
121 {
125
126 inline bool operator==(const Annotation &other) const
127 {
128 return name == other.name && value == other.value;
129 }
130 };
131
132 struct Interface: public QSharedData
133 {
137
142
143 inline bool operator==(const Interface &other) const
144 { return !name.isEmpty() && name == other.name; }
145 };
146
147 struct Object: public QSharedData
148 {
152
155 };
156
157public:
158 static Interface parseInterface(const QString &xml, DiagnosticsReporter *reporter = nullptr);
159 static Interfaces parseInterfaces(const QString &xml, DiagnosticsReporter *reporter = nullptr);
160 static Object parseObject(const QString &xml, const QString &service = QString(),
161 const QString &path = QString(),
162 DiagnosticsReporter *reporter = nullptr);
163
164private:
166};
167
169
170#endif // QT_NO_DBUS
171#endif
virtual void warning(const SourceLocation &location, const char *msg,...) Q_ATTRIBUTE_FORMAT_PRINTF(3
QMultiMap< QString, Signal > Signals
Contains a QMap of signals and their names.
QList< Argument > Arguments
Contains a list of arguments to either a Method or a Signal.
QMap< QString, Property > Properties
Contains a QMap of properties and their names.
QMultiMap< QString, Method > Methods
Contains a QMap of methods and their names.
QMap< QString, Annotation > Annotations
\variable QDBusIntrospection::Object::service The object's service name.
QMap< QString, QSharedDataPointer< ObjectTree > > Objects
Contains a QMap of objects and their paths relative to their immediate parent.
QMap< QString, QSharedDataPointer< Interface > > Interfaces
Contains a QMap of interfaces and their names.
Definition qlist.h:74
Definition qmap.h:186
\inmodule QtCore
Definition qshareddata.h:19
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
Definition lalr.h:269
Combined button and popup list for selecting options.
#define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint location
GLenum type
GLenum access
GLuint name
GLsizei const GLchar *const * path
long long qint64
Definition qtypes.h:55
QSharedPointer< T > other(t)
[5]
QXmlStreamReader xml
[0]
bool operator==(const Annotation &other) const
bool operator==(const Argument &other) const
\variable QDBusIntrospection::Argument::type The argument type.
bool operator==(const Interface &other) const
\variable QDBusIntrospection::Interface::name The interface's name.
bool operator==(const Method &other) const
\variable QDBusIntrospection::Method::name The method's name.
bool operator==(const Property &other) const
\variable QDBusIntrospection::Property::access The property's access rights.
Access
\variable QDBusIntrospection::Property::name The property's name.
bool operator==(const Signal &other) const
\variable QDBusIntrospection::Signal::name The signal's name.