aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2020-01-28 17:36:34 +0100
committerLNJ <lnj@kaidan.im>2020-01-29 11:25:43 +0100
commit2c98c242f4b9bea1bd20863be590f122300de2a2 (patch)
tree0cd82a281cba7d9f24cabf8e143fa12be2fa8ef3 /src
parentc9b301d726396d14d6057b2b8bb92a2e53e21e58 (diff)
downloadqxmpp-2c98c242f4b9bea1bd20863be590f122300de2a2.tar.gz
QXmppClient: Split up QXmppClientPrivate into private header
This is required to access the QXmppClientPrivate from other classes. This way we can split up parts of the client into internal client extensions like the authentication manager, without the need of public methods in the client as with the current approach of the TLS manager.
Diffstat (limited to 'src')
-rw-r--r--src/client/QXmppClient.cpp28
-rw-r--r--src/client/QXmppClient_p.h75
2 files changed, 78 insertions, 25 deletions
diff --git a/src/client/QXmppClient.cpp b/src/client/QXmppClient.cpp
index db56776a..7763676b 100644
--- a/src/client/QXmppClient.cpp
+++ b/src/client/QXmppClient.cpp
@@ -25,6 +25,7 @@
#include <QTimer>
#include "QXmppClient.h"
+#include "QXmppClient_p.h"
#include "QXmppClientExtension.h"
#include "QXmppConstants_p.h"
#include "QXmppLogger.h"
@@ -40,31 +41,7 @@
#include "QXmppDiscoveryManager.h"
#include "QXmppDiscoveryIq.h"
-class QXmppClientPrivate
-{
-public:
- QXmppClientPrivate(QXmppClient *qq);
-
- QXmppPresence clientPresence; ///< Current presence of the client
- QList<QXmppClientExtension*> extensions;
- QXmppLogger *logger;
- QXmppOutgoingClient *stream; ///< Pointer to the XMPP stream
-
- // reconnection
- bool receivedConflict;
- int reconnectionTries;
- QTimer *reconnectionTimer;
-
- // Client state indication
- bool isActive;
-
- void addProperCapability(QXmppPresence& presence);
- int getNextReconnectTime() const;
-
-private:
- QXmppClient *q;
-};
-
+/// \cond
QXmppClientPrivate::QXmppClientPrivate(QXmppClient *qq)
: clientPresence(QXmppPresence::Available)
, logger(nullptr)
@@ -98,6 +75,7 @@ int QXmppClientPrivate::getNextReconnectTime() const
else
return 60 * 1000;
}
+/// \endcond
/// Creates a QXmppClient object.
/// \param parent is passed to the QObject's constructor.
diff --git a/src/client/QXmppClient_p.h b/src/client/QXmppClient_p.h
new file mode 100644
index 00000000..4ae1f637
--- /dev/null
+++ b/src/client/QXmppClient_p.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2008-2020 The QXmpp developers
+ *
+ * Author:
+ * Manjeet Dahiya
+ * 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 QXMPPCLIENT_P_H
+#define QXMPPCLIENT_P_H
+
+#include "QXmppPresence.h"
+
+class QXmppClient;
+class QXmppClientExtension;
+class QXmppLogger;
+class QXmppOutgoingClient;
+class QTimer;
+
+class QXmppClientPrivate
+{
+public:
+ QXmppClientPrivate(QXmppClient *qq);
+
+ /// Current presence of the client
+ QXmppPresence clientPresence;
+ QList<QXmppClientExtension*> extensions;
+ QXmppLogger *logger;
+ /// Pointer to the XMPP stream
+ QXmppOutgoingClient *stream;
+
+ // reconnection
+ bool receivedConflict;
+ int reconnectionTries;
+ QTimer *reconnectionTimer;
+
+ // Client state indication
+ bool isActive;
+
+ void addProperCapability(QXmppPresence &presence);
+ int getNextReconnectTime() const;
+
+private:
+ QXmppClient *q;
+};
+
+#endif // QXMPPCLIENT_P_H