2
* xmpp_xdata.h - a class for jabber:x:data forms
3
* Copyright (C) 2003-2004 Michail Pishchagin
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28
#include <QSharedDataPointer>
29
#include <QStringList>
43
QString title() const;
44
void setTitle(const QString &);
46
QString instructions() const;
47
void setInstructions(const QString &);
58
QString registrarType() const;
62
ReportField( QString _label, QString _name ) { label = _label; name = _name; }
66
const QList<ReportField> &report() const;
68
typedef QMap<QString, QString> ReportItem;
69
const QList<ReportItem> &reportItems() const;
71
void fromXml(const QDomElement &);
72
QDomElement toXml(QDomDocument *, bool submitForm = true) const;
82
void setDesc(const QString &);
92
QHash<QString,QString> params;
95
class MediaElement : public QList<MediaUri>
98
void append(const QString &type, const QString &uri, QHash<QString,QString> params);
99
void setMediaSize(const QSize &size);
100
QSize mediaSize() const;
101
bool checkSupport(const QStringList &wildcards);
107
typedef QList<Option> OptionList;
108
OptionList options() const;
109
void setOptions(OptionList);
111
MediaElement mediaElement() const;
112
void setMediaElement(const MediaElement &);
114
bool required() const;
115
void setRequired(bool);
117
QString label() const;
118
void setLabel(const QString &);
121
void setVar(const QString &);
123
// generic value variable, because every possible Type
124
// can be converted to QStringList. Field_Single will
125
// use just one string in QStringList. Field_Boolean will
126
// use just one string, and that string will equal 0 or 1.
128
QStringList value() const;
129
void setValue(const QStringList &);
147
bool isValid() const;
149
void fromXml(const QDomElement &);
150
QDomElement toXml(QDomDocument *, bool submitForm = true) const;
153
QString _desc, _label, _var;
154
QList<Option> _options;
155
MediaElement _mediaElement;
161
typedef QList<Field> FieldList;
163
FieldList fields() const;
164
void setFields(const FieldList &);
167
class Private : public QSharedData {
169
QString title, instructions;
171
QString registrarType;
173
QList<ReportField> report;
174
QList<ReportItem> reportItems;
176
QSharedDataPointer<Private> d;