summaryrefslogtreecommitdiffstats
path: root/qt/src/qdbusabstractadaptor_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago@kde.org>2006-06-04 15:52:05 +0000
committerThiago Macieira <thiago@kde.org>2006-06-04 15:52:05 +0000
commitedbf2bfc109ce94b2604ea20328fda25542e4383 (patch)
tree3281d191fa9dde9f1f26b947b145d02373f031b0 /qt/src/qdbusabstractadaptor_p.h
parent435c7af9b605c3ffc8641142b6d7add18bf7080b (diff)
* qt/: Update to Subversion r548032.
This includes a big reorganisation of the files inside the subdir. We really need a version control system that supports moving of files. I'm not bothering with history anyways anymore, since the bindings will be moved out to git. The history should be restored from Subversion when that happens.
Diffstat (limited to 'qt/src/qdbusabstractadaptor_p.h')
-rw-r--r--qt/src/qdbusabstractadaptor_p.h127
1 files changed, 127 insertions, 0 deletions
diff --git a/qt/src/qdbusabstractadaptor_p.h b/qt/src/qdbusabstractadaptor_p.h
new file mode 100644
index 00000000..71bfb582
--- /dev/null
+++ b/qt/src/qdbusabstractadaptor_p.h
@@ -0,0 +1,127 @@
+/* -*- mode: C++; set-fill-width: 100 -*-
+ *
+ * Copyright (C) 2006 Trolltech AS. All rights reserved.
+ * Author: Thiago Macieira <thiago.macieira@trolltech.com>
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the public API. This header file may
+// change from version to version without notice, or even be
+// removed.
+//
+// We mean it.
+//
+//
+
+#ifndef QDBUSABSTRACTADAPTORPRIVATE_H
+#define QDBUSABSTRACTADAPTORPRIVATE_H
+
+#include <QtCore/qobject.h>
+#include <QtCore/qmap.h>
+#include <QtCore/qhash.h>
+#include <QtCore/qreadwritelock.h>
+#include <QtCore/qvariant.h>
+#include <QtCore/qvector.h>
+
+#define QCLASSINFO_DBUS_INTERFACE "D-Bus Interface"
+#define QCLASSINFO_DBUS_INTROSPECTION "D-Bus Introspection"
+
+class QDBusAbstractAdaptor;
+class QDBusAdaptorConnector;
+class QDBusAdaptorManager;
+class QDBusConnectionPrivate;
+
+#if QT_VERSION < 0x040200
+/* mirrored in qobject_p.h, DON'T CHANGE without prior warning */
+struct QSignalSpyCallbackSet
+{
+ typedef void (*BeginCallback)(QObject *caller, int method_index, void **argv);
+ typedef void (*EndCallback)(QObject *caller, int method_index);
+ BeginCallback signal_begin_callback,
+ slot_begin_callback;
+ EndCallback signal_end_callback,
+ slot_end_callback;
+};
+#else
+# error Qt 4.2.0 is supposed to have a better solution!
+ CHOKE!
+#endif // Qt 4.2.0
+
+class QDBusAbstractAdaptorPrivate
+{
+public:
+ QString xml;
+
+ static QString retrieveIntrospectionXml(QDBusAbstractAdaptor *adaptor);
+ static void saveIntrospectionXml(QDBusAbstractAdaptor *adaptor, const QString &xml);
+};
+
+class QDBusAdaptorConnector: public QObject
+{
+ Q_OBJECT
+public: // typedefs
+ struct AdaptorData
+ {
+ QString interface;
+ QDBusAbstractAdaptor *adaptor;
+ const QMetaObject *metaObject;
+
+ inline bool operator<(const AdaptorData &other) const
+ { return interface < other.interface; }
+ inline bool operator<(const QString &other) const
+ { return interface < other; }
+ };
+ typedef QVector<AdaptorData> AdaptorMap;
+
+public: // methods
+ explicit QDBusAdaptorConnector(QObject *parent);
+ ~QDBusAdaptorConnector();
+
+ void addAdaptor(QDBusAbstractAdaptor *adaptor);
+ void relay(QObject *sender);
+
+public slots:
+ void relaySlot();
+ void polish();
+
+signals:
+ void relaySignal(QObject *obj, const char *interface, const char *name, const QVariantList &args);
+
+public: // member variables
+ AdaptorMap adaptors;
+ bool waitingForPolish : 1;
+
+ int lastSignalIdx;
+ void **argv;
+ const QMetaObject *senderMetaObject;
+
+public: // static members
+ static void signalBeginCallback(QObject *caller, int method_index, void **argv);
+ static void signalEndCallback(QObject *caller, int method_index);
+ //static int id;
+};
+
+extern QDBusAdaptorConnector *qDBusFindAdaptorConnector(QObject *object);
+extern QDBusAdaptorConnector *qDBusCreateAdaptorConnector(QObject *object);
+
+#endif // QDBUSABSTRACTADAPTORPRIVATE_H