diff options
| author | Linus Jahn <lnj@kaidan.im> | 2020-08-09 11:19:54 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2021-06-27 20:12:26 +0200 |
| commit | 41e00fd8a82cae585a797c2f9d24ca1463a2f53f (patch) | |
| tree | 1e61cbb0764b4b2966d99cc855c16811dfc790bd /src/base/QXmppPacket_p.h | |
| parent | 953d8588b94fec779bdf667c024150c9690470c4 (diff) | |
| download | qxmpp-41e00fd8a82cae585a797c2f9d24ca1463a2f53f.tar.gz | |
QXmppStream: Report packet sending result using QFutures
Diffstat (limited to 'src/base/QXmppPacket_p.h')
| -rw-r--r-- | src/base/QXmppPacket_p.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/base/QXmppPacket_p.h b/src/base/QXmppPacket_p.h new file mode 100644 index 00000000..1ec2f592 --- /dev/null +++ b/src/base/QXmppPacket_p.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2008-2021 The QXmpp developers + * + * Authors: + * Linus Jahn + * + * 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 QXMPPPACKET_H +#define QXMPPPACKET_H + +#include "QXmppGlobal.h" + +#include <QFutureInterface> +#include <QSharedPointer> + +class QXmppStanza; + +class QXmppPacket +{ +public: + QXmppPacket(const QXmppStanza &stanza); + + QByteArray data() const; + bool isXmppStanza() const; + + QFuture<QXmpp::PacketState> future(); + + void reportFinished(); + void reportResult(QXmpp::PacketState); + +private: + QSharedPointer<QFutureInterface<QXmpp::PacketState>> m_interface; + QByteArray m_data; + bool m_isXmppStanza; +}; + +#endif // QXMPPPACKET_H |
