QXmpp  Version:1.0.0
QXmppOutgoingServer.h
1 /*
2  * Copyright (C) 2008-2019 The QXmpp developers
3  *
4  * Author:
5  * Jeremy LainĂ©
6  *
7  * Source:
8  * https://github.com/qxmpp-project/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 #ifndef QXMPPOUTGOINGSERVER_H
25 #define QXMPPOUTGOINGSERVER_H
26 
27 #include <QAbstractSocket>
28 
29 #include "QXmppStream.h"
30 
31 class QSslError;
32 class QXmppDialback;
34 class QXmppOutgoingServerPrivate;
35 
39 
40 class QXMPP_EXPORT QXmppOutgoingServer : public QXmppStream
41 {
42  Q_OBJECT
43 
44 public:
45  QXmppOutgoingServer(const QString &domain, QObject *parent);
47 
48  bool isConnected() const;
49 
50  QString localStreamKey() const;
51  void setLocalStreamKey(const QString &key);
52  void setVerify(const QString &id, const QString &key);
53 
54  QString remoteDomain() const;
55 
56 signals:
58  void dialbackResponseReceived(const QXmppDialback &response);
59 
60 protected:
62  void handleStart();
63  void handleStream(const QDomElement &streamElement);
64  void handleStanza(const QDomElement &stanzaElement);
66 
67 public slots:
68  void connectToHost(const QString &domain);
69  void queueData(const QByteArray &data);
70 
71 private slots:
72  void _q_dnsLookupFinished();
73  void _q_socketDisconnected();
74  void sendDialback();
75  void slotSslErrors(const QList<QSslError> &errors);
76  void socketError(QAbstractSocket::SocketError error);
77 
78 private:
79  Q_DISABLE_COPY(QXmppOutgoingServer)
80  QXmppOutgoingServerPrivate* const d;
81 };
82 
83 #endif
QXmppStream::handleStart
virtual void handleStart()
Definition: QXmppStream.cpp:113
QXmppStream::handleStanza
virtual void handleStanza(const QDomElement &element)=0
QXmppStream::isConnected
virtual bool isConnected() const
Definition: QXmppStream.cpp:123
QXmppOutgoingServer
The QXmppOutgoingServer class represents an outgoing XMPP stream to another XMPP server.
Definition: QXmppOutgoingServer.h:40
QXmppDialback
The QXmppDialback class represents a stanza used for the Server Dialback protocol as specified by XEP...
Definition: QXmppDialback.h:34
QXmppStream
The QXmppStream class is the base class for all XMPP streams.
Definition: QXmppStream.h:41
QXmppStream::handleStream
virtual void handleStream(const QDomElement &element)=0