squawk/qomemo/variant/omemo_base.h

46 lines
1.3 KiB
C
Raw Normal View History

2021-05-12 21:32:13 +00:00
/*
* Created by victoria on 2021-05-13.
*/
#pragma once
2021-07-22 17:45:39 +00:00
#include <optional>
2021-05-13 14:54:37 +00:00
2021-07-22 17:45:39 +00:00
class QString;
class QXmppElement;
2021-05-12 21:32:13 +00:00
class QXmppIq;
namespace QXmpp::Omemo {
2021-07-22 17:45:39 +00:00
class PreKey;
class Bundle;
2021-05-13 14:54:37 +00:00
class Device;
class DeviceList;
2021-05-12 21:32:13 +00:00
2021-05-13 14:54:37 +00:00
namespace Variant {
2021-05-12 21:32:13 +00:00
2021-05-13 14:54:37 +00:00
class Base {
public:
virtual ~Base() = default;
2021-05-12 21:32:13 +00:00
2021-05-13 14:54:37 +00:00
virtual QXmppElement deviceToXml(const Device &device) = 0;
virtual Device deviceFromXml(const QXmppElement &xml) = 0;
2021-05-12 21:32:13 +00:00
2021-07-22 17:45:39 +00:00
[[nodiscard]] virtual QString getDeviceListNode() const = 0;
2021-05-13 14:54:37 +00:00
virtual QXmppElement deviceListToXml(const DeviceList &deviceList) = 0;
2021-07-22 17:45:39 +00:00
virtual std::optional<DeviceList> latestDeviceListFromPubSubNode(const QXmppElement &xml) = 0;
2021-05-13 14:54:37 +00:00
virtual QXmppIq deviceListSetIq(const DeviceList &deviceList) = 0;
2021-07-22 17:45:39 +00:00
virtual QXmppElement preKeyToXml(const PreKey &pk) = 0;
virtual std::optional<PreKey> preKeyFromXml(const QXmppElement &xml) = 0;
virtual QXmppElement bundleToXml(const Bundle& bundle) = 0;
virtual std::optional<Bundle> bundleFromXml(const QXmppElement& xml) = 0;
virtual QXmppIq bundleSetIq(int deviceId, const Bundle& bundle) = 0;
2021-05-13 14:54:37 +00:00
};
2021-05-12 21:32:13 +00:00
2021-05-13 14:54:37 +00:00
} // namespace Variant
2021-05-12 21:32:13 +00:00
} // namespace QXmpp::Omemo