/* * xmpp_xdata.h - a class for jabber:x:data forms * Copyright (C) 2003-2004 Michail Pishchagin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef XMPPXDATA_H #define XMPPXDATA_H #include #include #include #include #include class QDomElement; class QDomDocument; namespace XMPP { class XData { public: XData(); QString title() const; void setTitle(const QString &); QString instructions() const; void setInstructions(const QString &); enum Type { Data_Form, Data_Result, Data_Submit, Data_Cancel }; Type type() const; void setType(Type); struct ReportField { ReportField() { } ReportField( QString _label, QString _name ) { label = _label; name = _name; } QString label; QString name; }; const QList &report() const; typedef QMap ReportItem; const QList &reportItems() const; void fromXml(const QDomElement &); QDomElement toXml(QDomDocument *, bool submitForm = true) const; bool isValid() const; public: class Field { public: Field(); ~Field(); QString desc() const; void setDesc(const QString &); struct Option { QString label; QString value; }; typedef QList