aboutsummaryrefslogtreecommitdiff
path: root/src/base/QXmppOmemoEnvelope.h
diff options
context:
space:
mode:
authorMelvin Keskin <melvo@olomono.de>2021-09-02 23:37:24 +0200
committerLinus Jahn <lnj@kaidan.im>2021-09-03 16:16:14 +0200
commit12c63eddded9f02369bd4e569f62acfdd95cc723 (patch)
treede008ca97accd962c5d2ca54ba9302c2f952a0ea /src/base/QXmppOmemoEnvelope.h
parent11db6293ced5c4665630ad3d728aba5751a3f658 (diff)
downloadqxmpp-12c63eddded9f02369bd4e569f62acfdd95cc723.tar.gz
Add QXmppOmemoEnvelope
Co-authored-by: Germán Márquez Mejía <mancho@olomono.de>
Diffstat (limited to 'src/base/QXmppOmemoEnvelope.h')
-rw-r--r--src/base/QXmppOmemoEnvelope.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/base/QXmppOmemoEnvelope.h b/src/base/QXmppOmemoEnvelope.h
new file mode 100644
index 00000000..a8f0a0c1
--- /dev/null
+++ b/src/base/QXmppOmemoEnvelope.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2008-2021 The QXmpp developers
+ *
+ * Author:
+ * Germán Márquez Mejía
+ * Melvin Keskin
+ *
+ * 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 QXMPPOMEMOENVELOPE_H
+#define QXMPPOMEMOENVELOPE_H
+
+#include "QXmppGlobal.h"
+
+#include <QSharedDataPointer>
+
+class QDomElement;
+class QXmppOmemoEnvelopePrivate;
+class QXmlStreamWriter;
+
+class QXMPP_EXPORT QXmppOmemoEnvelope
+{
+public:
+ QXmppOmemoEnvelope();
+ QXmppOmemoEnvelope(const QXmppOmemoEnvelope &other);
+ ~QXmppOmemoEnvelope();
+
+ QXmppOmemoEnvelope &operator=(const QXmppOmemoEnvelope &other);
+
+ uint32_t recipientDeviceId() const;
+ void setRecipientDeviceId(uint32_t id);
+
+ bool isUsedForKeyExchange() const;
+ void setIsUsedForKeyExchange(bool isUsed);
+
+ QByteArray data() const;
+ void setData(const QByteArray &data);
+
+ /// \cond
+ void parse(const QDomElement &element);
+ void toXml(QXmlStreamWriter *writer) const;
+ /// \endcond
+
+ static bool isOmemoEnvelope(const QDomElement &element);
+
+private:
+ QSharedDataPointer<QXmppOmemoEnvelopePrivate> d;
+};
+
+Q_DECLARE_TYPEINFO(QXmppOmemoEnvelope, Q_MOVABLE_TYPE);
+
+#endif // QXMPPOMEMOENVELOPE_H