From 36bbeb02497f5f79ddae56857893c2f71bf08ee9 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Wed, 8 Feb 2012 11:53:52 +0000 Subject: move server code to "server" directory --- src/server/QXmppOutgoingServer.h | 82 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 src/server/QXmppOutgoingServer.h (limited to 'src/server/QXmppOutgoingServer.h') diff --git a/src/server/QXmppOutgoingServer.h b/src/server/QXmppOutgoingServer.h new file mode 100644 index 00000000..4e117c0e --- /dev/null +++ b/src/server/QXmppOutgoingServer.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2008-2011 The QXmpp developers + * + * Author: + * Jeremy Lainé + * + * Source: + * http://code.google.com/p/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. + * + */ + +#ifndef QXMPPOUTGOINGSERVER_H +#define QXMPPOUTGOINGSERVER_H + +#include + +#include "QXmppStream.h" + +class QSslError; +class QXmppDialback; +class QXmppOutgoingServer; +class QXmppOutgoingServerPrivate; + +/// \brief The QXmppOutgoingServer class represents an outgoing XMPP stream +/// to another XMPP server. +/// + +class QXmppOutgoingServer : public QXmppStream +{ + Q_OBJECT + +public: + QXmppOutgoingServer(const QString &domain, QObject *parent); + ~QXmppOutgoingServer(); + + bool isConnected() const; + + QString localStreamKey() const; + void setLocalStreamKey(const QString &key); + void setVerify(const QString &id, const QString &key); + + QString remoteDomain() const; + +signals: + /// This signal is emitted when a dialback verify response is received. + void dialbackResponseReceived(const QXmppDialback &response); + +protected: + /// \cond + void handleStart(); + void handleStream(const QDomElement &streamElement); + void handleStanza(const QDomElement &stanzaElement); + /// \endcond + +public slots: + void connectToHost(const QString &domain); + void queueData(const QByteArray &data); + +private slots: + void _q_dnsLookupFinished(); + void sendDialback(); + void slotSslErrors(const QList &errors); + void socketError(QAbstractSocket::SocketError error); + +private: + Q_DISABLE_COPY(QXmppOutgoingServer) + QXmppOutgoingServerPrivate* const d; +}; + +#endif -- cgit v1.2.3