QXmpp Version: 0.9.3
Loading...
Searching...
No Matches
QXmppOutgoingClient.h
1/*
2 * Copyright (C) 2008-2014 The QXmpp developers
3 *
4 * Authors:
5 * Manjeet Dahiya
6 * Jeremy Lainé
7 *
8 * Source:
9 * https://github.com/qxmpp-project/qxmpp
10 *
11 * This file is a part of QXmpp library.
12 *
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 of the License, or (at your option) any later version.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 */
24
25
26#ifndef QXMPPOUTGOINGCLIENT_H
27#define QXMPPOUTGOINGCLIENT_H
28
29#include "QXmppClient.h"
30#include "QXmppStanza.h"
31#include "QXmppStream.h"
32
33class QDomElement;
34class QSslError;
35
37class QXmppPresence;
38class QXmppIq;
39class QXmppMessage;
40
41class QXmppOutgoingClientPrivate;
42
46
47class QXMPP_EXPORT QXmppOutgoingClient : public QXmppStream
48{
49 Q_OBJECT
50
51public:
52 QXmppOutgoingClient(QObject *parent);
54
55 void connectToHost();
56 bool isAuthenticated() const;
57 bool isConnected() const;
58
59 QSslSocket *socket() const { return QXmppStream::socket(); };
60 QXmppStanza::Error::Condition xmppStreamError();
61
62 QXmppConfiguration& configuration();
63
64signals:
67
69 void elementReceived(const QDomElement &element, bool &handled);
70
73
76
78 void iqReceived(const QXmppIq&);
79
81 void sslErrors(const QList<QSslError> &errors);
82
83protected:
85 // Overridable methods
86 virtual void handleStart();
87 virtual void handleStanza(const QDomElement &element);
88 virtual void handleStream(const QDomElement &element);
90
91private slots:
92 void _q_dnsLookupFinished();
93 void _q_socketDisconnected();
94 void socketError(QAbstractSocket::SocketError);
95 void socketSslErrors(const QList<QSslError>&);
96
97 void pingStart();
98 void pingStop();
99 void pingSend();
100 void pingTimeout();
101
102private:
103 void sendNonSASLAuth(bool plaintext);
104 void sendNonSASLAuthQuery();
105
106 friend class QXmppOutgoingClientPrivate;
107 QXmppOutgoingClientPrivate * const d;
108};
109
110#endif // QXMPPOUTGOINGCLIENT_H
Error
Definition: QXmppClient.h:91
The QXmppConfiguration class holds configuration options.
Definition: QXmppConfiguration.h:49
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:43
The QXmppMessage class represents an XMPP message.
Definition: QXmppMessage.h:39
The QXmppOutgoingClient class represents an outgoing XMPP stream to an XMPP server.
Definition: QXmppOutgoingClient.h:48
void error(QXmppClient::Error)
This signal is emitted when an error is encountered.
void presenceReceived(const QXmppPresence &)
This signal is emitted when a presence is received.
void messageReceived(const QXmppMessage &)
This signal is emitted when a message is received.
void sslErrors(const QList< QSslError > &errors)
This signal is emitted when SSL errors are encountered.
void elementReceived(const QDomElement &element, bool &handled)
This signal is emitted when an element is received.
void iqReceived(const QXmppIq &)
This signal is emitted when an IQ is received.
The QXmppPresence class represents an XMPP presence stanza.
Definition: QXmppPresence.h:37
The QXmppStream class is the base class for all XMPP streams.
Definition: QXmppStream.h:42
QSslSocket * socket() const
Definition: QXmppStream.cpp:150
virtual void handleStart()
Definition: QXmppStream.cpp:105
virtual bool isConnected() const
Definition: QXmppStream.cpp:114
virtual void handleStream(const QDomElement &element)=0
virtual void handleStanza(const QDomElement &element)=0