25 #ifndef QXMPPDATAFORM_H
26 #define QXMPPDATAFORM_H
28 #include "QXmppStanza.h"
30 #if QXMPP_DEPRECATED_SINCE(1, 1)
39 class QXmppDataFormPrivate;
40 class QXmppDataFormFieldPrivate;
41 class QXmppDataFormMediaPrivate;
42 class QXmppDataFormMediaSourcePrivate;
62 MediaSource(
const QUrl &uri,
const QMimeType &contentType);
69 void setUri(
const QUrl &uri);
71 QMimeType contentType()
const;
72 void setContentType(
const QMimeType &contentType);
77 QSharedDataPointer<QXmppDataFormMediaSourcePrivate> d;
80 #if QXMPP_DEPRECATED_SINCE(1, 1)
81 class QXMPP_EXPORT
Media
90 QT_DEPRECATED_X(
"Use QXmppDataForm::Field() instead")
101 void setHeight(
int height);
106 void setWidth(
int width);
109 QList<QPair<QString, QString>> uris() const;
111 void setUris(const QList<QPair<QString, QString>> &uris);
117 QSharedDataPointer<QXmppDataFormMediaPrivate> d;
146 const QVariant &value = {},
147 bool isRequired =
false,
148 const QString &label = {},
149 const QString &description = {},
150 const QList<QPair<QString, QString>> &options = {});
156 QString description()
const;
157 void setDescription(
const QString &description);
160 void setKey(
const QString &key);
162 QString label()
const;
163 void setLabel(
const QString &label);
165 #if QXMPP_DEPRECATED_SINCE(1, 1)
166 QT_DEPRECATED_X(
"Use QXmppDataForm::Field::mediaSources() or QXmppDataForm::Field::mediaSize() instead")
170 void setMedia(const Media &media);
173 QList<QPair<QString, QString>> options()
const;
174 void setOptions(
const QList<QPair<QString, QString>> &options);
176 bool isRequired()
const;
177 void setRequired(
bool required);
182 QVariant value()
const;
183 void setValue(
const QVariant &value);
185 QVector<QXmppDataForm::MediaSource> &mediaSources();
186 QVector<QXmppDataForm::MediaSource> mediaSources()
const;
187 void setMediaSources(
const QVector<QXmppDataForm::MediaSource> &mediaSources);
189 QSize mediaSize()
const;
191 void setMediaSize(
const QSize &size);
193 bool operator==(
const Field &other)
const;
196 QSharedDataPointer<QXmppDataFormFieldPrivate> d;
216 const QList<Field> &fields,
217 const QString &title = {},
218 const QString &instructions = {});
224 QString instructions()
const;
225 void setInstructions(
const QString &instructions);
227 QList<Field> fields()
const;
228 QList<Field> &fields();
229 void setFields(
const QList<QXmppDataForm::Field> &fields);
231 QString title()
const;
232 void setTitle(
const QString &title);
240 void parse(
const QDomElement &element);
241 void toXml(QXmlStreamWriter *writer)
const;
245 QSharedDataPointer<QXmppDataFormPrivate> d;