2
* xmpp_xdata.h - a class for jabber:x:data forms
3
* Copyright (C) 2003-2004 Michail Pishchagin
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
#include <QSharedDataPointer>
28
#include <QStringList>
40
QString title() const;
41
void setTitle(const QString &);
43
QString instructions() const;
44
void setInstructions(const QString &);
58
ReportField( QString _label, QString _name ) { label = _label; name = _name; }
62
const QList<ReportField> &report() const;
64
typedef QMap<QString, QString> ReportItem;
65
const QList<ReportItem> &reportItems() const;
67
void fromXml(const QDomElement &);
68
QDomElement toXml(QDomDocument *, bool submitForm = true) const;
78
void setDesc(const QString &);
85
typedef QList<Option> OptionList;
86
OptionList options() const;
87
void setOptions(OptionList);
89
bool required() const;
90
void setRequired(bool);
92
QString label() const;
93
void setLabel(const QString &);
96
void setVar(const QString &);
98
// generic value variable, because every possible Type
99
// can be converted to QStringList. Field_Single will
100
// use just one string in QStringList. Field_Boolean will
101
// use just one string, and that string will equal 0 or 1.
103
QStringList value() const;
104
void setValue(const QStringList &);
122
bool isValid() const;
124
void fromXml(const QDomElement &);
125
QDomElement toXml(QDomDocument *, bool submitForm = true) const;
128
QString _desc, _label, _var;
129
QList<Option> _options;
135
typedef QList<Field> FieldList;
137
FieldList fields() const;
138
void setFields(const FieldList &);
141
class Private : public QSharedData {
143
QString title, instructions;
146
QList<ReportField> report;
147
QList<ReportItem> reportItems;
149
QSharedDataPointer<Private> d;