QXmpp: QXmppFallback.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppFallback.h
1// SPDX-FileCopyrightText: 2024 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPFALLBACK_H
6#define QXMPPFALLBACK_H
7
8#include "QXmppGlobal.h"
9
10#include <optional>
11
12#include <QSharedDataPointer>
13
14class QDomElement;
15class QXmlStreamWriter;
16
17struct QXmppFallbackPrivate;
18
19 class QXMPP_EXPORT QXmppFallback
20{
21public:
22 enum Element {
23 Body,
24 Subject,
25 };
26
27 struct Range {
29 uint32_t start;
31 uint32_t end;
32 };
33
34 struct Reference {
36 Element element;
38 std::optional<Range> range;
39 };
40
41 QXmppFallback(const QString &forNamespace, const QVector<Reference> &references);
42 QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppFallback)
43
44 const QString &forNamespace() const;
45 void setForNamespace(const QString &);
46
47 const QVector<Reference> &references() const;
48 void setReferences(const QVector<Reference> &);
49
50 static std::optional<QXmppFallback> fromDom(const QDomElement &);
51 void toXml(QXmlStreamWriter *) const;
52
53private:
54 QSharedDataPointer<QXmppFallbackPrivate> d;
55};
56
57#endif // QXMPPFALLBACK_H
QXmppFallback::setForNamespace
void setForNamespace(const QString &)
Definition QXmppMessage.cpp:2208
QXmppFallback::references
const QVector< Reference > & references() const
Definition QXmppMessage.cpp:2216
QXmppFallback::toXml
void toXml(QXmlStreamWriter *) const
Definition QXmppMessage.cpp:2265
QXmppFallback::QXmppFallback
QXmppFallback(const QString &forNamespace, const QVector< Reference > &references)
Creates a fallback marker.
Definition QXmppMessage.cpp:2192
QXmppFallback::setReferences
void setReferences(const QVector< Reference > &)
Definition QXmppMessage.cpp:2224
QXmppFallback::Element
Element
Definition QXmppFallback.h:22
QXmppFallback::fromDom
static std::optional< QXmppFallback > fromDom(const QDomElement &)
Definition QXmppMessage.cpp:2234
QXmppFallback::forNamespace
const QString & forNamespace() const
Definition QXmppMessage.cpp:2200
QXmppFallback::Range
Definition QXmppFallback.h:27
QXmppFallback::Range::start
uint32_t start
Start index of the range.
Definition QXmppFallback.h:29
QXmppFallback::Range::end
uint32_t end
End index of the range.
Definition QXmppFallback.h:31
QXmppFallback::Reference
Definition QXmppFallback.h:34
QXmppFallback::Reference::element
Element element
Element of the message stanza this refers to.
Definition QXmppFallback.h:36
QXmppFallback::Reference::range
std::optional< Range > range
Optional character range in the text.
Definition QXmppFallback.h:38