aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2020-01-28 17:54:49 +0100
committerLNJ <lnj@kaidan.im>2020-01-29 11:25:43 +0100
commitc7b6ebd872339c4225ed9ddbe4d875def17b7dd6 (patch)
tree6a49594750e7bb0db53d2f4e266362b25a1ea37f /src/client
parent2c98c242f4b9bea1bd20863be590f122300de2a2 (diff)
downloadqxmpp-c7b6ebd872339c4225ed9ddbe4d875def17b7dd6.tar.gz
Introduce QXmppInternalClientExtensions
The new internal client extensions can be used to access private parts of the QXmppClient since QXmppInternalClientExtensions are a friend of the QXmppClient. The internal client extensions are not part of the public API, so you can't access them in an application using QXmpp. However, this was also the case before. If there is the need to access the internal extensions in the future, we'll still have all options open to change everything, because the classes are not part of the public API.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/QXmppClient.h3
-rw-r--r--src/client/QXmppInternalClientExtension.cpp39
-rw-r--r--src/client/QXmppInternalClientExtension_p.h61
3 files changed, 103 insertions, 0 deletions
diff --git a/src/client/QXmppClient.h b/src/client/QXmppClient.h
index 7d2dd61b..95baf680 100644
--- a/src/client/QXmppClient.h
+++ b/src/client/QXmppClient.h
@@ -39,6 +39,7 @@ class QXmppPresence;
class QXmppMessage;
class QXmppIq;
class QXmppStream;
+class QXmppInternalClientExtension;
// managers
class QXmppDiscoveryIq;
@@ -276,6 +277,8 @@ private slots:
private:
QXmppClientPrivate *const d;
+
+ friend class QXmppInternalClientExtension;
};
#endif // QXMPPCLIENT_H
diff --git a/src/client/QXmppInternalClientExtension.cpp b/src/client/QXmppInternalClientExtension.cpp
new file mode 100644
index 00000000..c36666fb
--- /dev/null
+++ b/src/client/QXmppInternalClientExtension.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2008-2020 The QXmpp developers
+ *
+ * Author:
+ * Linus Jahn
+ *
+ * Source:
+ * https://github.com/qxmpp-project/qxmpp
+ *
+ * This file is a part of QXmpp library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ */
+
+#include "QXmppInternalClientExtension_p.h"
+
+#include "QXmppClient.h"
+#include "QXmppClient_p.h"
+
+/// \cond
+QXmppInternalClientExtension::QXmppInternalClientExtension()
+ : QXmppClientExtension()
+{
+}
+
+QXmppOutgoingClient *QXmppInternalClientExtension::clientStream()
+{
+ return client()->d->stream;
+}
+/// \endcond
diff --git a/src/client/QXmppInternalClientExtension_p.h b/src/client/QXmppInternalClientExtension_p.h
new file mode 100644
index 00000000..5692a21a
--- /dev/null
+++ b/src/client/QXmppInternalClientExtension_p.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2008-2020 The QXmpp developers
+ *
+ * Author:
+ * Linus Jahn
+ *
+ * Source:
+ * https://github.com/qxmpp-project/qxmpp
+ *
+ * This file is a part of QXmpp library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ */
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the QXmpp API.
+//
+// This header file may change from version to version without notice,
+// or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QXMPPINTERNALCLIENTEXTENSION_H
+#define QXMPPINTERNALCLIENTEXTENSION_H
+
+#include "QXmppClientExtension.h"
+
+class QXmppOutgoingClient;
+
+///
+/// \brief The QXmppInternalClientExtension class is used to access private
+/// components of the QXmppClient.
+///
+/// It is not exposed to the public API and is only used to split up internal
+/// parts of the QXmppClient, like TLS negotiation.
+///
+class QXmppInternalClientExtension : public QXmppClientExtension
+{
+ Q_OBJECT
+
+public:
+ QXmppInternalClientExtension();
+
+protected:
+ QXmppOutgoingClient *clientStream();
+};
+
+#endif // QXMPPINTERNALCLIENTEXTENSION_H