Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qdbusintegrator_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2016 Intel Corporation.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5//
6// W A R N I N G
7// -------------
8//
9// This file is not part of the public API. This header file may
10// change from version to version without notice, or even be
11// removed.
12//
13// We mean it.
14//
15//
16
17#ifndef QDBUSINTEGRATOR_P_H
18#define QDBUSINTEGRATOR_P_H
19
20#include <QtDBus/private/qtdbusglobal_p.h>
21#include "qdbus_symbols_p.h"
22
23#include "qcoreevent.h"
24#include "qeventloop.h"
25#include "qobject.h"
26#include "private/qobject_p.h"
27#include "qlist.h"
28#include "qpointer.h"
29#include "qsemaphore.h"
30
31#include "qdbusconnection.h"
32#include "qdbusmessage.h"
33#include "qdbusconnection_p.h"
34
35#ifndef QT_NO_DBUS
36
38
40class QDBusMessage;
41
42// Really private structs used by qdbusintegrator.cpp
43// Things that aren't used by any other file
44
46{
47 struct Data
48 {
49 int flags;
52
53 void swap(Data &other) noexcept
54 {
55 qSwap(flags, other.flags);
56 qSwap(slotIdx, other.slotIdx);
57 qSwap(metaTypes, other.metaTypes);
58 }
59 };
62
63 void swap(QDBusSlotCache &other) noexcept { qSwap(hash, other.hash); }
64};
65Q_DECLARE_SHARED(QDBusSlotCache::Data)
66Q_DECLARE_SHARED(QDBusSlotCache)
67
69{
70public:
72 const QDBusMessage &msg, const QList<QMetaType> &types, int f = 0)
73 : QAbstractMetaCallEvent(sender, -1),
75 message(msg),
76 metaTypes(types),
77 id(id),
78 flags(f)
79 {
80 }
81
82 void placeMetaCall(QObject *object) override
83 {
84 QDBusConnectionPrivate::d(connection)->deliverCall(object, flags, message, metaTypes, id);
85 }
86
87private:
88 QDBusConnection connection; // just for refcounting
90 QList<QMetaType> metaTypes;
91 int id;
92 int flags;
93};
94
96{
97public:
100 int p, const QDBusMessage &m, QSemaphore *s = nullptr)
101 : QAbstractMetaCallEvent(sender, -1, s), connection(c), node(n),
102 pathStartPos(p), message(m), handled(false)
103 { }
104 ~QDBusActivateObjectEvent() override;
105
106 void placeMetaCall(QObject *) override;
107
108private:
109 QDBusConnection connection; // just for refcounting
111 int pathStartPos;
113 bool handled;
114};
115
117{
118public:
119 typedef void (*Hook)(const QDBusMessage&);
121 const Hook *hooks, int count)
123 {}
124 ~QDBusSpyCallEvent() override;
125 void placeMetaCall(QObject *) override;
126 static inline void invokeSpyHooks(const QDBusMessage &msg, const Hook *hooks, int hookCount);
127
128 QDBusConnection conn; // keeps the refcount in QDBusConnectionPrivate up
130 const Hook *hooks;
132};
133
135
137
138#endif // QT_NO_DBUS
139#endif
const QObject * sender() const
Definition qobject_p.h:356
void placeMetaCall(QObject *) override
QDBusActivateObjectEvent(const QDBusConnection &c, QObject *sender, const QDBusConnectionPrivate::ObjectTreeNode &n, int p, const QDBusMessage &m, QSemaphore *s=nullptr)
QDBusCallDeliveryEvent(const QDBusConnection &c, int id, QObject *sender, const QDBusMessage &msg, const QList< QMetaType > &types, int f=0)
void placeMetaCall(QObject *object) override
static QDBusConnectionPrivate * d(const QDBusConnection &q)
\inmodule QtDBus
\inmodule QtDBus
QDBusConnection conn
~QDBusSpyCallEvent() override
QDBusSpyCallEvent(QDBusConnectionPrivate *cp, const QDBusConnection &c, const QDBusMessage &msg, const Hook *hooks, int count)
void placeMetaCall(QObject *) override
static void invokeSpyHooks(const QDBusMessage &msg, const Hook *hooks, int hookCount)
void(* Hook)(const QDBusMessage &)
Definition qlist.h:74
\inmodule QtCore
Definition qhash.h:1348
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore
Definition qsemaphore.h:16
qSwap(pi, e)
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection * connection
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1367
const GLfloat * m
GLsizei GLenum GLenum * types
GLenum GLuint id
[7]
GLenum GLenum GLsizei count
GLfloat GLfloat f
GLbitfield flags
GLuint GLsizei const GLchar * message
GLfloat n
const GLubyte * c
GLdouble s
[6]
Definition qopenglext.h:235
GLfloat GLfloat p
[1]
QSharedPointer< T > other(t)
[5]
void swap(Data &other) noexcept
QList< QMetaType > metaTypes
QMultiHash< QString, Data > Hash
void swap(QDBusSlotCache &other) noexcept