QXmpp: QXmppPacket_p.h Source File

QXmpp Version: 1.14.4

Loading...
Searching...
No Matches
QXmppPacket_p.h
1// SPDX-FileCopyrightText: 2020 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPPACKET_H
6#define QXMPPPACKET_H
7
8#include "QXmppGlobal.h"
9#include "QXmppPromise.h"
10#include "QXmppSendResult.h"
11
12#include <memory>
13
14#include <QFutureInterface>
15
16class QXmppNonza;
17
18class QXmppPacket
19{
20public:
21 QXmppPacket(const QXmppNonza &nonza, QXmppPromise<QXmpp::SendResult> = {});
22 QXmppPacket(const QByteArray &data, bool isXmppStanza, QXmppPromise<QXmpp::SendResult> = {});
23
24 QByteArray data() const;
25 bool isXmppStanza() const;
26
27 QXmppTask<QXmpp::SendResult> task();
28
29 void reportFinished(QXmpp::SendResult &&);
30
31private:
32 QXmppPromise<QXmpp::SendResult> m_promise;
33 QByteArray m_data;
34 bool m_isXmppStanza;
35};
36
37#endif // QXMPPPACKET_H
QXmppNonza
Definition QXmppNonza.h:14
QXmpp::SendResult
std::variant< SendSuccess, QXmppError > SendResult
Definition QXmppSendResult.h:43