diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-02-08 11:53:52 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-02-08 11:53:52 +0000 |
| commit | 36bbeb02497f5f79ddae56857893c2f71bf08ee9 (patch) | |
| tree | 34191bb93ff6cb044d5d28d2f630dc0476cc5659 /src/server/QXmppOutgoingServer.h | |
| parent | aa334abcca63101292c48a72c7b1851b8ecc26c7 (diff) | |
| download | qxmpp-36bbeb02497f5f79ddae56857893c2f71bf08ee9.tar.gz | |
move server code to "server" directory
Diffstat (limited to 'src/server/QXmppOutgoingServer.h')
| -rw-r--r-- | src/server/QXmppOutgoingServer.h | 82 |
1 files changed, 82 insertions, 0 deletions
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 <QAbstractSocket> + +#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<QSslError> &errors); + void socketError(QAbstractSocket::SocketError error); + +private: + Q_DISABLE_COPY(QXmppOutgoingServer) + QXmppOutgoingServerPrivate* const d; +}; + +#endif |
