QXmppDataForm::Field Class Reference

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

`#include <QXmppDataForm.h>`

## Public Types

enum | Type { BooleanField , FixedField , HiddenField , JidMultiField , JidSingleField , ListMultiField , ListSingleField , TextMultiField , TextPrivateField , TextSingleField }
| This enum is used to describe a field's type.

## Public Member Functions

| Field (QXmppDataForm::Field::Type type=QXmppDataForm::Field::TextSingleField)
| Constructs a QXmppDataForm::Field of the specified type.
| 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)
| Constructs a copy of other.
| ~Field ()
| Destroys the form field.
QXmppDataForm::Field & | operator= (const QXmppDataForm::Field &other)
| Assigns other to this field.
QString | description () const
| Returns the field's description.
void | setDescription (const QString &description)
QString | key () const
| Returns the field's key.
void | setKey (const QString &key)
QString | label () const
| Returns the field's label.
void | setLabel (const QString &label)
Media | media () const
void | setMedia (const Media &media)
QList< QPair< QString, QString > > | options () const
| Returns the field's options.
void | setOptions (const QList< QPair< QString, QString >> &options)
bool | isRequired () const
| Returns true if the field is required, false otherwise.
void | setRequired (bool required)
QXmppDataForm::Field::Type | type () const
| Returns the field's type.
void | setType (QXmppDataForm::Field::Type type)
QVariant | value () const
| Returns the field's value.
void | setValue (const QVariant &value)
QVector< QXmppDataForm::MediaSource > & | mediaSources ()
QVector< QXmppDataForm::MediaSource > | mediaSources () const
void | setMediaSources (const QVector< QXmppDataForm::MediaSource > &mediaSources)
QSize | mediaSize () const
QSize & | mediaSize ()
void | setMediaSize (const QSize &size)
bool | operator== (const Field &other) const

## Detailed Description

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

## Constructor & Destructor Documentation

## Field()

QXmppDataForm::Field::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 = `{}`
| ) |  |

Constructs a QXmppDataForm::Field with the specified attributes.

Since
  QXmpp 1.3

## Member Function Documentation

## media()

QXmppDataForm::Media QXmppDataForm::Field::media | ( |  | ) | const

Returns the field's media.

Deprecated:
  This method is deprecated since QXmpp 1.1. Use `QXmppDataForm::Field::mediaSources()` or `QXmppDataForm::Field::mediaSize()` instead.

## mediaSize() [1/2]

QSize & QXmppDataForm::Field::mediaSize | ( |  | ) |

Returns the size of the attached media according to XEP-0221: Data Forms Media Element.

Since
  QXmpp 1.1

## mediaSize() [2/2]

QSize QXmppDataForm::Field::mediaSize | ( |  | ) | const

Returns the size of the attached media according to XEP-0221: Data Forms Media Element.

Since
  QXmpp 1.1

## mediaSources() [1/2]

QVector< QXmppDataForm::MediaSource > & QXmppDataForm::Field::mediaSources | ( |  | ) |

Returns the sources for the attached media according to XEP-0221: Data Forms Media Element.

Since
  QXmpp 1.1

## mediaSources() [2/2]

QVector< QXmppDataForm::MediaSource > QXmppDataForm::Field::mediaSources | ( |  | ) | const

Returns the sources for the attached media according to XEP-0221: Data Forms Media Element.

Since
  QXmpp 1.1

## operator==()

bool QXmppDataForm::Field::operator== | ( | const Field & | other | ) | const

Returns true if the other field is identical to this one.

Since
  QXmpp 1.1

## setDescription()

void QXmppDataForm::Field::setDescription | ( | const QString & | description | ) |

Sets the field's description.

Parameters

  description |

## setKey()

void QXmppDataForm::Field::setKey | ( | const QString & | key | ) |

Sets the field's key.

Parameters

  key |

## setLabel()

void QXmppDataForm::Field::setLabel | ( | const QString & | label | ) |

Sets the field's label.

Parameters

  label |

## setMedia()

void QXmppDataForm::Field::setMedia | ( | const Media & | media | ) |

Sets the field's media.

Deprecated:
  This method is deprecated since QXmpp 1.1. Use `QXmppDataForm::Field::setMediaSources()` or `QXmppDataForm::Field::setMediaSize()` instead.

## setMediaSize()

void QXmppDataForm::Field::setMediaSize | ( | const QSize & | size | ) |

Sets the size of the attached media according to XEP-0221: Data Forms Media Element.

Since
  QXmpp 1.1

## setMediaSources()

void QXmppDataForm::Field::setMediaSources | ( | const QVector< QXmppDataForm::MediaSource > & | mediaSources | ) |

Sets the sources to the attached media of the field according to XEP-0221: Data Forms Media Element.

Since
  QXmpp 1.1

## setOptions()

void QXmppDataForm::Field::setOptions | ( | const QList< QPair< QString, QString >> & | options | ) |

Sets the field's options.

Parameters

  options |

## setRequired()

void QXmppDataForm::Field::setRequired | ( | bool | required | ) |

Set to true if the field is required, false otherwise.

Parameters

  required |

## setType()

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

Sets the field's type.

Parameters

  type |

## setValue()

void QXmppDataForm::Field::setValue | ( | const QVariant & | value | ) |

Sets the field's value.

Parameters

  value |

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

- QXmppDataForm.h
- QXmppDataForm.cpp