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
24
#include <qvaluelist.h>
26
#include "xmpp_tasks.h"
37
QString title() const;
38
void setTitle(const QString &);
40
QString instructions() const;
41
void setInstructions(const QString &);
55
ReportField( QString _label, QString _name ) { label = _label; name = _name; }
59
const QValueList<ReportField> &report() const;
61
typedef QMap<QString, QString> ReportItem;
62
const QValueList<ReportItem> &reportItems() const;
64
void fromXml(const QDomElement &);
65
QDomElement toXml(QDomDocument *, bool submitForm = true) const;
74
void setDesc(const QString &);
81
typedef QValueList<Option> OptionList;
82
OptionList options() const;
83
void setOptions(OptionList);
85
bool required() const;
86
void setRequired(bool);
88
QString label() const;
89
void setLabel(const QString &);
92
void setVar(const QString &);
94
// generic value variable, because every possible Type
95
// can be converted to QStringList. Field_Single will
96
// use just one string in QStringList. Field_Boolean will
97
// use just one string, and that string will equal 0 or 1.
99
QStringList value() const;
100
void setValue(const QStringList &);
118
bool isValid() const;
120
void fromXml(const QDomElement &);
121
QDomElement toXml(QDomDocument *, bool submitForm = true) const;
124
QString _desc, _label, _var;
125
QValueList<Option> _options;
131
typedef QValueList<Field> FieldList;
133
FieldList fields() const;
134
void setFields(const FieldList &);
135
XData &operator= (const XData &);