QXmpp Version: 1.5.6
Loading...
Searching...
No Matches
QXmppE2eeExtension.h
1// SPDX-FileCopyrightText: 2021 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPE2EEEXTENSION_H
6#define QXMPPE2EEEXTENSION_H
7
8#include "QXmppError.h"
9#include "QXmppExtension.h"
10#include "QXmppSendResult.h"
11#include "QXmppSendStanzaParams.h"
12
13#include <memory>
14#include <optional>
15
16class QDomElement;
17class QXmppMessage;
18class QXmppIq;
19template<typename T>
20class QXmppTask;
21
22class QXmppE2eeExtension : public QXmppExtension
23{
24public:
26 {
27 };
28
29 using MessageEncryptResult = std::variant<std::unique_ptr<QXmppMessage>, QXmppError>;
30 using MessageDecryptResult = std::variant<QXmppMessage, NotEncrypted, QXmppError>;
31 using IqEncryptResult = std::variant<std::unique_ptr<QXmppIq>, QXmppError>;
32 using IqDecryptResult = std::variant<QDomElement, NotEncrypted, QXmppError>;
33
34 virtual QXmppTask<MessageEncryptResult> encryptMessage(QXmppMessage &&, const std::optional<QXmppSendStanzaParams> &) = 0;
36 virtual QXmppTask<IqEncryptResult> encryptIq(QXmppIq &&, const std::optional<QXmppSendStanzaParams> &) = 0;
37 virtual QXmppTask<IqDecryptResult> decryptIq(const QDomElement &) = 0;
38 virtual bool isEncrypted(const QDomElement &) = 0;
39 virtual bool isEncrypted(const QXmppMessage &) = 0;
40};
41
42#endif // QXMPPE2EEEXTENSION_H
Definition QXmppE2eeExtension.h:23
virtual bool isEncrypted(const QXmppMessage &)=0
virtual QXmppTask< IqEncryptResult > encryptIq(QXmppIq &&, const std::optional< QXmppSendStanzaParams > &)=0
std::variant< QXmppMessage, NotEncrypted, QXmppError > MessageDecryptResult
Definition QXmppE2eeExtension.h:30
virtual bool isEncrypted(const QDomElement &)=0
virtual QXmppTask< IqDecryptResult > decryptIq(const QDomElement &)=0
std::variant< std::unique_ptr< QXmppIq >, QXmppError > IqEncryptResult
Definition QXmppE2eeExtension.h:31
virtual QXmppTask< MessageDecryptResult > decryptMessage(QXmppMessage &&)=0
std::variant< std::unique_ptr< QXmppMessage >, QXmppError > MessageEncryptResult
Definition QXmppE2eeExtension.h:29
virtual QXmppTask< MessageEncryptResult > encryptMessage(QXmppMessage &&, const std::optional< QXmppSendStanzaParams > &)=0
std::variant< QDomElement, NotEncrypted, QXmppError > IqDecryptResult
Definition QXmppE2eeExtension.h:32
The QXmppIq class is the base class for all IQs.
Definition QXmppIq.h:23
The QXmppMessage class represents an XMPP message.
Definition QXmppMessage.h:35
Definition QXmppTask.h:62
Definition QXmppE2eeExtension.h:26
Definition QXmppError.h:18