ProfileField.h
/*
* This file is part of buteo-syncfw package
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef PROFILEFIELD_H
#define PROFILEFIELD_H
#include <QString>
#include <QStringList>
class QDomDocument;
class QDomElement;
namespace Buteo {
class ProfileFieldPrivate;
class ProfileField
{
public:
static const QString VISIBLE_ALWAYS;
static const QString VISIBLE_NEVER;
// been pre-defined in the sub-profiles loaded by the main profile.
static const QString VISIBLE_USER;
static const QString TYPE_BOOLEAN;
explicit ProfileField(const QDomElement &aRoot);
ProfileField(const ProfileField &aSource);
~ProfileField();
QString name() const;
QString type() const;
QString defaultValue() const;
QStringList options() const;
QString label() const;
bool validate(const QString &aValue) const;
QDomElement toXml(QDomDocument &aDoc) const;
QString visible() const;
bool isReadOnly() const;
private:
ProfileField &operator=(const ProfileField &aRhs);
ProfileFieldPrivate *d_ptr;
};
}
#endif // PROFILEFIELD_H
Buteo::ProfileField::visible
QString visible() const
Gets the visibility of the field.
Definition ProfileField.cpp:195
Buteo::ProfileField::options
QStringList options() const
Gets the allowed values for the field.
Definition ProfileField.cpp:151
Buteo::ProfileField::ProfileField
ProfileField(const QDomElement &aRoot)
Constructs a ProfileField from XML.
Definition ProfileField.cpp:95
Buteo::ProfileField::name
QString name() const
Gets the field name.
Definition ProfileField.cpp:136
Buteo::ProfileField::isReadOnly
bool isReadOnly() const
Checks if the field is read only.
Definition ProfileField.cpp:204
Buteo::ProfileField::toXml
QDomElement toXml(QDomDocument &aDoc) const
Exports the field to XML.
Definition ProfileField.cpp:168
Buteo::ProfileField::VISIBLE_NEVER
static const QString VISIBLE_NEVER
Field should never be visible in UI.
Definition ProfileField.h:55
Buteo::ProfileField::VISIBLE_ALWAYS
static const QString VISIBLE_ALWAYS
Field should be always visible in UI.
Definition ProfileField.h:52
Buteo::ProfileField::VISIBLE_USER
static const QString VISIBLE_USER
Field should be visible in UI if a value for the field has not.
Definition ProfileField.h:59
Buteo::ProfileField::type
QString type() const
Get the field type.
Definition ProfileField.cpp:141
Buteo::ProfileField::validate
bool validate(const QString &aValue) const
Checks if the given value is in the list of allowed values.
Definition ProfileField.cpp:161
Buteo::ProfileField::~ProfileField
~ProfileField()
Destructor.
Definition ProfileField.cpp:130
Buteo::ProfileField::defaultValue
QString defaultValue() const
Gets the field default value.
Definition ProfileField.cpp:146
Buteo::ProfileField::label
QString label() const
Gets the field label.
Definition ProfileField.cpp:156
Buteo::ProfileField::TYPE_BOOLEAN
static const QString TYPE_BOOLEAN
Field type for boolean fields.
Definition ProfileField.h:62