QXmppDataForm Class
| Header: | #include <QXmppDataForm> |
Public Types
| class | Field |
(since QXmpp 1.1) class | MediaSource |
Public Functions
(since QXmpp 1.5) | QXmppDataForm(const QXmppDataFormBase &based) |
(since QXmpp 1.3) | QXmppDataForm(QXmppDataForm::Type type = None, const QList<QXmppDataForm::Field> &fields = {}, const QString &title = {}, const QString &instructions = {}) |
| QXmppDataForm(const QXmppDataForm &other) | |
| QXmppDataForm(QXmppDataForm &&other) | |
| ~QXmppDataForm() | |
(since QXmpp 1.12) void | appendField(QXmppDataForm::Field &&field) |
(since QXmpp 1.12) const QList<QXmppDataForm::Field> & | constFields() const |
(since QXmpp 1.12) std::optional<QXmppDataForm::Field> | field(QStringView fieldName) const |
(since QXmpp 1.12) std::optional<QVariant> | fieldValue(QStringView fieldName) const |
| QList<QXmppDataForm::Field> | fields() const |
(since QXmpp 1.5) QString | formType() const |
| QString | instructions() const |
| bool | isNull() const |
| void | setFields(const QList<QXmppDataForm::Field> &fields) |
| void | setInstructions(const QString &instructions) |
| void | setTitle(const QString &title) |
| void | setType(QXmppDataForm::Type type) |
| QString | title() const |
| QXmppDataForm::Type | type() const |
| QXmppDataForm & | operator=(QXmppDataForm &&) |
| QXmppDataForm & | operator=(const QXmppDataForm &other) |
Detailed Description
The QXmppDataForm class represents a data form as defined by XEP-0004: Data Forms.
Member Function Documentation
[since QXmpp 1.5] QXmppDataForm::QXmppDataForm(const QXmppDataFormBase &based)
Constructs a data form from any type based on QXmppDataFormBase.
This function was introduced in QXmpp 1.5.
[since QXmpp 1.3] QXmppDataForm::QXmppDataForm(QXmppDataForm::Type type = None, const QList<QXmppDataForm::Field> &fields = {}, const QString &title = {}, const QString &instructions = {})
Constructs a QXmppDataForm with the specified attributes.
This function was introduced in QXmpp 1.3.
QXmppDataForm::QXmppDataForm(const QXmppDataForm &other)
Constructs a copy of other.
QXmppDataForm::QXmppDataForm(QXmppDataForm &&other)
Default move constructor.
[noexcept] QXmppDataForm::~QXmppDataForm()
Destroys the form.
[since QXmpp 1.12] void QXmppDataForm::appendField(QXmppDataForm::Field &&field)
Appends a field.
field.
This function was introduced in QXmpp 1.12.
[since QXmpp 1.12] const QList<QXmppDataForm::Field> &QXmppDataForm::constFields() const
Returns all fields.
This function was introduced in QXmpp 1.12.
[since QXmpp 1.12] std::optional<QXmppDataForm::Field> QXmppDataForm::field(QStringView fieldName) const
Look up field by name.
fieldName.
This function was introduced in QXmpp 1.12.
[since QXmpp 1.12] std::optional<QVariant> QXmppDataForm::fieldValue(QStringView fieldName) const
Look up field by name and return value if found.
fieldName.
This function was introduced in QXmpp 1.12.
QList<QXmppDataForm::Field> QXmppDataForm::fields() const
Returns all fields.
See also setFields().
[since QXmpp 1.5] QString QXmppDataForm::formType() const
Searches for a hidden field called 'FORM_TYPE' and returns its value.
Returns the string value of the field or a null string if the field couldn't be found.
This function was introduced in QXmpp 1.5.
QString QXmppDataForm::instructions() const
Returns the form's instructions.
See also setInstructions().
bool QXmppDataForm::isNull() const
Returns true if the form has an unknown type.
void QXmppDataForm::setFields(const QList<QXmppDataForm::Field> &fields)
Sets the form's fields.
See also fields().
void QXmppDataForm::setInstructions(const QString &instructions)
Sets the form's instructions.
See also instructions().
void QXmppDataForm::setTitle(const QString &title)
Sets the form's title.
See also title().
void QXmppDataForm::setType(QXmppDataForm::Type type)
Sets the form's type.
See also type().
QString QXmppDataForm::title() const
Returns the form's title.
See also setTitle().
QXmppDataForm::Type QXmppDataForm::type() const
Returns the form's type.
See also setType().
QXmppDataForm &QXmppDataForm::operator=(QXmppDataForm &&)
Default move-assignment operator.
QXmppDataForm &QXmppDataForm::operator=(const QXmppDataForm &other)
Assigns other to this form.