QXmpp Version: 1.13.0
Loading...
Searching...
No Matches
QXmppDataForm Class Reference

Classes

class  MediaSource
class  Media
class  Field

Public Types

enum  Type {
  None , Form , Submit , Cancel ,
  Result
}
 This enum is used to describe a form's type. More...

Public Member Functions

 QXmppDataForm (Type type=None, const QList< Field > &fields={}, const QString &title={}, const QString &instructions={})
 QXmppDataForm (const QXmppDataFormBase &based)
 QXmppDataForm (const QXmppDataForm &other)
 Constructs a copy of other.
 QXmppDataForm (QXmppDataForm &&)
 Default move constructor.
 ~QXmppDataForm ()
 Destroys the form.
QXmppDataFormoperator= (const QXmppDataForm &other)
 Assigns other to this form.
QXmppDataFormoperator= (QXmppDataForm &&)
 Default move-assignment operator.
QString instructions () const
void setInstructions (const QString &instructions)
QList< Fieldfields () const
 Returns all fields.
const QList< Field > & constFields () const
void setFields (const QList< QXmppDataForm::Field > &fields)
 Sets the form's fields.
void appendField (QXmppDataForm::Field &&field)
std::optional< QXmppDataForm::Fieldfield (QStringView fieldName) const
std::optional< QVariant > fieldValue (QStringView fieldName) const
QString title () const
void setTitle (const QString &title)
QXmppDataForm::Type type () const
void setType (QXmppDataForm::Type type)
QString formType () const
bool isNull () const

Detailed Description

The QXmppDataForm class represents a data form as defined by XEP-0004: Data Forms.

Member Enumeration Documentation

◆ Type

This enum is used to describe a form's type.

Enumerator
None 

Unknown form type.

Form 

The form-processing entity is asking the form-submitting entity to complete a form.

Submit 

The form-submitting entity is submitting data to the form-processing entity.

Cancel 

The form-submitting entity has cancelled submission of data to the form-processing entity.

Result 

The form-processing entity is returning data (e.g., search results) to the form-submitting entity, or the data is a generic data set.

Constructor & Destructor Documentation

◆ QXmppDataForm() [1/2]

QXmppDataForm::QXmppDataForm ( Type type = None,
const QList< Field > & fields = {},
const QString & title = {},
const QString & instructions = {} )

Constructs a QXmppDataForm with the specified attributes.

Since
QXmpp 1.3

◆ QXmppDataForm() [2/2]

QXmppDataForm::QXmppDataForm ( const QXmppDataFormBase & based)

Constructs a data form from any type based on QXmppDataFormBase.

Since
QXmpp 1.5

Member Function Documentation

◆ appendField()

void QXmppDataForm::appendField ( QXmppDataForm::Field && field)

Appends a field.

Since
QXmpp 1.12

◆ constFields()

const QList< QXmppDataForm::Field > & QXmppDataForm::constFields ( ) const

Returns all fields.

Since
QXmpp 1.12

◆ field()

std::optional< QXmppDataForm::Field > QXmppDataForm::field ( QStringView fieldName) const

Look up field by name.

Since
QXmpp 1.12

◆ fieldValue()

std::optional< QVariant > QXmppDataForm::fieldValue ( QStringView fieldName) const

Look up field by name and return value if found.

Since
QXmpp 1.12

◆ formType()

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.
Since
QXmpp 1.5

◆ instructions()

QString QXmppDataForm::instructions ( ) const

Returns the form's instructions.

◆ isNull()

bool QXmppDataForm::isNull ( ) const

Returns true if the form has an unknown type.

◆ setInstructions()

void QXmppDataForm::setInstructions ( const QString & instructions)

Sets the form's instructions.

Parameters
instructions

◆ setTitle()

void QXmppDataForm::setTitle ( const QString & title)

Sets the form's title.

Parameters
title

◆ setType()

void QXmppDataForm::setType ( QXmppDataForm::Type type)

Sets the form's type.

Parameters
type

◆ title()

QString QXmppDataForm::title ( ) const

Returns the form's title.

◆ type()

QXmppDataForm::Type QXmppDataForm::type ( ) const

Returns the form's type.


The documentation for this class was generated from the following files: