Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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/qshareddata.h>
22#include <QtCore/qstring.h>
23#include <QtCore/qstringlist.h>
24
25#ifndef QT_NO_DBUS
26
28
29class Q_DBUS_EXPORT QDBusIntrospection
30{
31public:
32 // forward declarations
33 struct Argument;
34 struct Method;
35 struct Signal;
36 struct Property;
37 struct Interface;
38 struct Object;
39 struct ObjectTree;
40 struct Annotation;
41
42 // typedefs
43 typedef QMap<QString, Annotation> Annotations;
44 typedef QList<Argument> Arguments;
45 typedef QMultiMap<QString, Method> Methods;
46 typedef QMultiMap<QString, Signal> Signals;
47 typedef QMap<QString, Property> Properties;
48 typedef QMap<QString, QSharedDataPointer<Interface> > Interfaces;
49 typedef QMap<QString, QSharedDataPointer<ObjectTree> > Objects;
50
51public:
52 // the structs
53
54 // Line and column numbers have the same meaning as in QXmlStreamReader.
56 {
57 qint64 lineNumber = 1;
58 qint64 columnNumber = 0;
59 };
60
61 class Q_DBUS_EXPORT DiagnosticsReporter
62 {
63 Q_DISABLE_COPY_MOVE(DiagnosticsReporter)
64 public:
67 virtual void warning(const SourceLocation &location, const char *msg, ...)
69 virtual void error(const SourceLocation &location, const char *msg, ...)
71 };
72
74 {
78
79 inline bool operator==(const Annotation &other) const
80 {
81 return name == other.name && value == other.value;
82 }
83 };
84
85 struct Argument
86 {
90
91 inline bool operator==(const Argument& other) const
92 { return name == other.name && type == other.type; }
93 };
94
95 struct Method
96 {
102
103 inline bool operator==(const Method& other) const
104 { return name == other.name && annotations == other.annotations &&
105 inputArgs == other.inputArgs && outputArgs == other.outputArgs; }
106 };
107
108 struct Signal
109 {
114
115 inline bool operator==(const Signal& other) const
116 { return name == other.name && annotations == other.annotations &&
117 outputArgs == other.outputArgs; }
118 };
119
120 struct Property
121 {
122 enum Access { Read, Write, ReadWrite };
128
129 inline bool operator==(const Property& other) const
130 { return access == other.access && name == other.name &&
131 annotations == other.annotations && type == other.type; }
132 };
133
148
158
159public:
160 static Interface parseInterface(const QString &xml, DiagnosticsReporter *reporter = nullptr);
161 static Interfaces parseInterfaces(const QString &xml, DiagnosticsReporter *reporter = nullptr);
162 static Object parseObject(const QString &xml, const QString &service = QString(),
163 const QString &path = QString(),
164 DiagnosticsReporter *reporter = nullptr);
165
166private:
168};
169
171
172#endif // QT_NO_DBUS
173#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.
\inmodule QtCore
Definition qshareddata.h:19
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Definition lalr.h:268
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:60
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.