QXmppOutgoingClient.h
/*
* Copyright (C) 2008-2014 The QXmpp developers
*
* Authors:
* Manjeet Dahiya
* Jeremy Lainé
*
* 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.
*
*/
#ifndef QXMPPOUTGOINGCLIENT_H
#define QXMPPOUTGOINGCLIENT_H
#include "QXmppClient.h"
#include "QXmppStanza.h"
#include "QXmppStream.h"
class QDomElement;
class QSslError;
class QXmppConfiguration;
class QXmppPresence;
class QXmppIq;
class QXmppMessage;
class QXmppOutgoingClientPrivate;
class QXMPP_EXPORT QXmppOutgoingClient : public QXmppStream
{
Q_OBJECT
public:
QXmppOutgoingClient(QObject *parent);
~QXmppOutgoingClient();
void connectToHost();
bool isAuthenticated() const;
bool isConnected() const;
QSslSocket *socket() const { return QXmppStream::socket(); };
QXmppStanza::Error::Condition xmppStreamError();
QXmppConfiguration& configuration();
signals:
void error(QXmppClient::Error);
void elementReceived(const QDomElement &element, bool &handled);
void presenceReceived(const QXmppPresence&);
void messageReceived(const QXmppMessage&);
void iqReceived(const QXmppIq&);
void sslErrors(const QList<QSslError> &errors);
protected:
// Overridable methods
virtual void handleStart();
virtual void handleStanza(const QDomElement &element);
virtual void handleStream(const QDomElement &element);
private slots:
void _q_dnsLookupFinished();
void _q_socketDisconnected();
void socketError(QAbstractSocket::SocketError);
void socketSslErrors(const QList<QSslError>&);
void pingStart();
void pingStop();
void pingSend();
void pingTimeout();
private:
void sendNonSASLAuth(bool plaintext);
void sendNonSASLAuthQuery();
friend class QXmppOutgoingClientPrivate;
QXmppOutgoingClientPrivate * const d;
};
#endif // QXMPPOUTGOINGCLIENT_H
QXmppConfiguration
The QXmppConfiguration class holds configuration options.
Definition: QXmppConfiguration.h:48
QXmppStream::socket
QSslSocket * socket() const
Definition: QXmppStream.cpp:150
QXmppStream::handleStanza
virtual void handleStanza(const QDomElement &element)=0
QXmppStream::isConnected
virtual bool isConnected() const
Definition: QXmppStream.cpp:114
QXmppClient::Error
Error
Definition: QXmppClient.h:90
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
QXmppPresence
The QXmppPresence class represents an XMPP presence stanza.
Definition: QXmppPresence.h:36
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:42
QXmppMessage
The QXmppMessage class represents an XMPP message.
Definition: QXmppMessage.h:38
QXmppOutgoingClient
The QXmppOutgoingClient class represents an outgoing XMPP stream to an XMPP server.
Definition: QXmppOutgoingClient.h:47
QXmppStream::handleStart
virtual void handleStart()
Definition: QXmppStream.cpp:105