aboutsummaryrefslogtreecommitdiff
path: root/src/base/QXmppDataForm.h
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2020-03-29 00:39:44 +0100
committerLNJ <lnj@kaidan.im>2020-03-29 18:50:01 +0200
commit1476fa153260487a6ddbc742ca6fdc4054ffd88a (patch)
tree6a6e881cfb2d6a9bc12543910768241e7fea30a8 /src/base/QXmppDataForm.h
parent380eb5cfe23daecc0d1dcd871dbecbc2bbe62aec (diff)
downloadqxmpp-1476fa153260487a6ddbc742ca6fdc4054ffd88a.tar.gz
QXmppDataForm: Add ctor with all attributes
This makes creating forms manually a lot easier.
Diffstat (limited to 'src/base/QXmppDataForm.h')
-rw-r--r--src/base/QXmppDataForm.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/base/QXmppDataForm.h b/src/base/QXmppDataForm.h
index b58cb680..dd5a6030 100644
--- a/src/base/QXmppDataForm.h
+++ b/src/base/QXmppDataForm.h
@@ -41,18 +41,20 @@ class QXmppDataFormFieldPrivate;
class QXmppDataFormMediaPrivate;
class QXmppDataFormMediaSourcePrivate;
+///
/// \brief The QXmppDataForm class represents a data form as defined by
/// \xep{0004}: Data Forms.
-
+///
class QXMPP_EXPORT QXmppDataForm
{
public:
+ ///
/// \brief The \c QXmppDataForm::MediaSource class represents a link to one
/// of possibly multiple sources for a media element from \xep{0221}: Data
/// Forms Media Element consisting of a MIME type and a QUrl.
///
/// \since QXmpp 1.1
-
+ ///
class QXMPP_EXPORT MediaSource
{
public:
@@ -76,11 +78,12 @@ public:
};
#if QXMPP_DEPRECATED_SINCE(1, 1)
+ ///
/// \brief The QXmppDataForm::Media class represents a media field as
/// defined by \xep{0221}: Data Forms Media Element.
///
/// \deprecated This class is deprecated since QXmpp 1.1.
-
+ ///
class QXMPP_EXPORT Media
{
public:
@@ -115,9 +118,10 @@ public:
};
#endif
+ ///
/// \brief The QXmppDataForm::Field class represents a data form field
/// as defined by \xep{0004}: Data Forms.
-
+ ///
class QXMPP_EXPORT Field
{
public:
@@ -135,7 +139,15 @@ public:
TextSingleField
};
+ // ### QXmpp2: merge ctors
Field(QXmppDataForm::Field::Type type = QXmppDataForm::Field::TextSingleField);
+ Field(QXmppDataForm::Field::Type type,
+ const QString &key,
+ const QVariant &value = {},
+ bool isRequired = false,
+ const QString &label = {},
+ const QString &description = {},
+ const QList<QPair<QString, QString>> &options = {});
Field(const QXmppDataForm::Field &other);
~Field();
@@ -198,7 +210,12 @@ public:
///< or the data is a generic data set.
};
+ // ### QXmpp2: merge ctors
QXmppDataForm(QXmppDataForm::Type type = QXmppDataForm::None);
+ QXmppDataForm(QXmppDataForm::Type type,
+ const QList<Field> &fields,
+ const QString &title = {},
+ const QString &instructions = {});
QXmppDataForm(const QXmppDataForm &other);
~QXmppDataForm();