Loading...
Searching...
No Matches
QXmppFallback.h
// SPDX-FileCopyrightText: 2024 Linus Jahn <lnj@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPFALLBACK_H
#define QXMPPFALLBACK_H
#include "QXmppGlobal.h"
#include <optional>
#include <QSharedDataPointer>
class QDomElement;
class QXmlStreamWriter;
struct QXmppFallbackPrivate;
class QXMPP_EXPORT QXmppFallback
{
public:
enum Element {
Body,
Subject,
};
struct Range {
uint32_t start;
uint32_t end;
};
struct Reference {
Element element;
std::optional<Range> range;
};
QXmppFallback(const QString &forNamespace, const QVector<Reference> &references);
QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppFallback)
const QString &forNamespace() const;
void setForNamespace(const QString &);
const QVector<Reference> &references() const;
void setReferences(const QVector<Reference> &);
static std::optional<QXmppFallback> fromDom(const QDomElement &);
void toXml(QXmlStreamWriter *) const;
private:
QSharedDataPointer<QXmppFallbackPrivate> d;
};
#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