From daa3385a3d0b14202cb6cdadaaca72c93614ecc6 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Mon, 7 Sep 2020 16:53:36 +0200 Subject: Add PubSubMetadata form --- src/base/QXmppPubSubMetadata.h | 97 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 src/base/QXmppPubSubMetadata.h (limited to 'src/base/QXmppPubSubMetadata.h') diff --git a/src/base/QXmppPubSubMetadata.h b/src/base/QXmppPubSubMetadata.h new file mode 100644 index 00000000..fb0590ec --- /dev/null +++ b/src/base/QXmppPubSubMetadata.h @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2008-2021 The QXmpp developers + * + * Author: + * Linus Jahn + * + * 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 QXMPPPUBSUBMETADATA_H +#define QXMPPPUBSUBMETADATA_H + +#include "QXmppDataFormBase.h" +#include "QXmppPubSubNodeConfig.h" + +#include + +class QXmppPubSubMetadataPrivate; + +class QXMPP_EXPORT QXmppPubSubMetadata : public QXmppExtensibleDataFormBase +{ +public: + struct Unset { + }; + struct Max { + }; + using ItemLimit = std::variant; + + QXmppPubSubMetadata(); + QXmppPubSubMetadata(const QXmppPubSubMetadata &); + ~QXmppPubSubMetadata(); + + QXmppPubSubMetadata &operator=(const QXmppPubSubMetadata &); + + QStringList contactJids() const; + void setContactJids(const QStringList &contactJids); + + QDateTime creationDate() const; + void setCreationDate(const QDateTime &creationDate); + + QString creatorJid() const; + void setCreatorJid(const QString &creatorJid); + + QString description() const; + void setDescription(const QString &description); + + QString language() const; + void setLanguage(const QString &language); + + std::optional accessModel() const; + void setAccessModel(std::optional accessModel); + + std::optional publishModel() const; + void setPublishModel(std::optional publishModel); + + std::optional numberOfSubscribers() const; + void setNumberOfSubscribers(const std::optional &numberOfSubscribers); + + QStringList ownerJids() const; + void setOwnerJids(const QStringList &ownerJids); + + QStringList publisherJids() const; + void setPublisherJids(const QStringList &publisherJids); + + QString title() const; + void setTitle(const QString &title); + + QString type() const; + void setType(const QString &type); + + ItemLimit maxItems() const; + void setMaxItems(ItemLimit maxItems); + +protected: + QString formType() const override; + bool parseField(const QXmppDataForm::Field &) override; + void serializeForm(QXmppDataForm &) const override; + +private: + QSharedDataPointer d; +}; + +#endif // QXMPPPUBSUBMETADATA_H -- cgit v1.2.3