dataform.cpp | dataform.cpp | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
** See the GNU General Public License for more details. | ** See the GNU General Public License for more details. | |||
** | ** | |||
** You should have received a copy of the GNU General Public License | ** You should have received a copy of the GNU General Public License | |||
** along with this program. If not, see http://www.gnu.org/licenses/. | ** along with this program. If not, see http://www.gnu.org/licenses/. | |||
** $JREEN_END_LICENSE$ | ** $JREEN_END_LICENSE$ | |||
** | ** | |||
*************************************************************************** */ | *************************************************************************** */ | |||
#include "dataform_p.h" | #include "dataform_p.h" | |||
#include "jstrings.h" | #include "jstrings.h" | |||
#include "stanza.h" | ||||
#include "bitsofbinary.h" | ||||
#include <QStringList> | #include <QStringList> | |||
#include <QSize> | ||||
#include <QUrl> | ||||
namespace Jreen | namespace Jreen | |||
{ | { | |||
class DataFormMedia::UriPrivate : public QSharedData | ||||
{ | ||||
public: | ||||
UriPrivate() {} | ||||
UriPrivate(const UriPrivate &o) : QSharedData(o), url(o.url), type(o | ||||
.type) {} | ||||
QUrl url; | ||||
QString type; | ||||
}; | ||||
DataFormMedia::Uri::Uri() : d(new UriPrivate) | ||||
{ | ||||
} | ||||
DataFormMedia::Uri::Uri(const QUrl &url, const QString &type) : d(new UriPr | ||||
ivate) | ||||
{ | ||||
d->url = url; | ||||
d->type = type; | ||||
} | ||||
DataFormMedia::Uri::Uri(const DataFormMedia::Uri &o) : d(o.d) | ||||
{ | ||||
} | ||||
DataFormMedia::Uri &DataFormMedia::Uri::operator =(const DataFormMedia::Uri | ||||
&o) | ||||
{ | ||||
d = o.d; | ||||
return *this; | ||||
} | ||||
DataFormMedia::Uri::~Uri() | ||||
{ | ||||
} | ||||
bool DataFormMedia::Uri::operator ==(const DataFormMedia::Uri &o) const | ||||
{ | ||||
return d->type == o.d->type && d->url == o.d->url; | ||||
} | ||||
QUrl DataFormMedia::Uri::url() const | ||||
{ | ||||
return d->url; | ||||
} | ||||
void DataFormMedia::Uri::setUrl(const QUrl &url) | ||||
{ | ||||
d->url = url; | ||||
} | ||||
QString DataFormMedia::Uri::type() const | ||||
{ | ||||
return d->type; | ||||
} | ||||
void DataFormMedia::Uri::setType(const QString &type) | ||||
{ | ||||
d->type = type; | ||||
} | ||||
class DataFormMediaPrivate | ||||
{ | ||||
public: | ||||
QSize size; | ||||
QList<DataFormMedia::Uri> uries; | ||||
}; | ||||
DataFormMedia::DataFormMedia() : d_ptr(new DataFormMediaPrivate) | ||||
{ | ||||
} | ||||
DataFormMedia::~DataFormMedia() | ||||
{ | ||||
} | ||||
void DataFormMedia::appendUri(const DataFormMedia::Uri &uri) | ||||
{ | ||||
d_func()->uries.append(uri); | ||||
} | ||||
void DataFormMedia::appendUri(const QUrl &url, const QString &type) | ||||
{ | ||||
d_func()->uries.append(Uri(url, type)); | ||||
} | ||||
void DataFormMedia::setUries(const QList<DataFormMedia::Uri> &uries) | ||||
{ | ||||
d_func()->uries = uries; | ||||
} | ||||
QList<DataFormMedia::Uri> DataFormMedia::uries() const | ||||
{ | ||||
return d_func()->uries; | ||||
} | ||||
QSize DataFormMedia::size() const | ||||
{ | ||||
return d_func()->size; | ||||
} | ||||
void DataFormMedia::setSize(const QSize &size) | ||||
{ | ||||
d_func()->size = size; | ||||
} | ||||
int DataFormMedia::width() const | ||||
{ | ||||
return d_func()->size.width(); | ||||
} | ||||
void DataFormMedia::setWidth(int width) | ||||
{ | ||||
d_func()->size.setWidth(width); | ||||
} | ||||
int DataFormMedia::height() const | ||||
{ | ||||
return d_func()->size.height(); | ||||
} | ||||
void DataFormMedia::setHeight(int height) | ||||
{ | ||||
d_func()->size.setHeight(height); | ||||
} | ||||
DataFormField::DataFormField(Type type, const QString &var, const QString & label) : d_ptr(new DataFormFieldPrivate) | DataFormField::DataFormField(Type type, const QString &var, const QString & label) : d_ptr(new DataFormFieldPrivate) | |||
{ | { | |||
d_ptr->type = type; | d_ptr->type = type; | |||
d_ptr->var = var; | d_ptr->var = var; | |||
d_ptr->label = label; | d_ptr->label = label; | |||
} | } | |||
DataFormField::DataFormField(const DataFormField &o) : d_ptr(o.d_ptr) | DataFormField::DataFormField(const DataFormField &o) : d_ptr(o.d_ptr) | |||
{ | { | |||
} | } | |||
skipping to change at line 100 | skipping to change at line 228 | |||
QString DataFormField::description() const | QString DataFormField::description() const | |||
{ | { | |||
return d_ptr->desc; | return d_ptr->desc; | |||
} | } | |||
void DataFormField::setDescription(const QString &desc) | void DataFormField::setDescription(const QString &desc) | |||
{ | { | |||
d_ptr->desc = desc; | d_ptr->desc = desc; | |||
} | } | |||
DataFormMedia::Ptr DataFormField::media() const | ||||
{ | ||||
return d_ptr->media; | ||||
} | ||||
void DataFormField::setMedia(const DataFormMedia::Ptr &media) | ||||
{ | ||||
d_ptr->media = media; | ||||
} | ||||
void DataFormField::setValues(const QStringList &values) | void DataFormField::setValues(const QStringList &values) | |||
{ | { | |||
d_ptr->values = values; | d_ptr->values = values; | |||
} | } | |||
QStringList DataFormField::values() const | QStringList DataFormField::values() const | |||
{ | { | |||
return d_ptr->values; | return d_ptr->values; | |||
} | } | |||
skipping to change at line 468 | skipping to change at line 606 | |||
d_func()->fields = fields; | d_func()->fields = fields; | |||
} | } | |||
DataForm::DataForm(Type type, const QString &title) : DataFormFieldContaine r(*new DataFormPrivate) | DataForm::DataForm(Type type, const QString &title) : DataFormFieldContaine r(*new DataFormPrivate) | |||
{ | { | |||
Q_D(DataForm); | Q_D(DataForm); | |||
d->type = type; | d->type = type; | |||
d->title = title; | d->title = title; | |||
} | } | |||
DataForm::DataForm(DataForm::Type type, const QString &title, const QString | ||||
&instructions) : DataFormFieldContainer(*new DataFormPrivate) | ||||
{ | ||||
Q_D(DataForm); | ||||
d->type = type; | ||||
d->title = title; | ||||
d->instructions = instructions; | ||||
} | ||||
DataForm::~DataForm() | DataForm::~DataForm() | |||
{ | { | |||
} | } | |||
DataForm::Type DataForm::type() const | DataForm::Type DataForm::type() const | |||
{ | { | |||
return d_func()->type; | return d_func()->type; | |||
} | } | |||
void DataForm::setType(Type type) | void DataForm::setType(Type type) | |||
skipping to change at line 504 | skipping to change at line 650 | |||
} else { | } else { | |||
f.setValue(type); | f.setValue(type); | |||
} | } | |||
} | } | |||
QString DataForm::title() const | QString DataForm::title() const | |||
{ | { | |||
return d_func()->title; | return d_func()->title; | |||
} | } | |||
QString DataForm::instructions() const | ||||
{ | ||||
return d_func()->instructions; | ||||
} | ||||
QList<DataFormItem::Ptr> DataForm::items() const | QList<DataFormItem::Ptr> DataForm::items() const | |||
{ | { | |||
return d_func()->items; | return d_func()->items; | |||
} | } | |||
DataFormReported::Ptr DataForm::reported() const | DataFormReported::Ptr DataForm::reported() const | |||
{ | { | |||
return d_func()->reported; | return d_func()->reported; | |||
} | } | |||
End of changes. 6 change blocks. | ||||
0 lines changed or deleted | 155 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |