Buteo Synchronization Framework
ProfileField.h
1/*
2 * This file is part of buteo-syncfw package
3 *
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 *
6 * Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * version 2.1 as published by the Free Software Foundation.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23
24#ifndef PROFILEFIELD_H
25#define PROFILEFIELD_H
26
27#include <QString>
28#include <QStringList>
29
30class QDomDocument;
31class QDomElement;
32
33namespace Buteo {
34
35class ProfileFieldPrivate;
36
49{
50public:
52 static const QString VISIBLE_ALWAYS;
53
55 static const QString VISIBLE_NEVER;
56
58 // been pre-defined in the sub-profiles loaded by the main profile.
59 static const QString VISIBLE_USER;
60
62 static const QString TYPE_BOOLEAN;
63
68 explicit ProfileField(const QDomElement &aRoot);
69
74 ProfileField(const ProfileField &aSource);
75
79
84 QString name() const;
85
90 QString type() const;
91
96 QString defaultValue() const;
97
102 QStringList options() const;
103
110 QString label() const;
111
118 bool validate(const QString &aValue) const;
119
127 QDomElement toXml(QDomDocument &aDoc) const;
128
134 QString visible() const;
135
141 bool isReadOnly() const;
142
143private:
144 ProfileField &operator=(const ProfileField &aRhs);
145 ProfileFieldPrivate *d_ptr;
146};
147
148}
149
150#endif // PROFILEFIELD_H
QString visible() const
Gets the visibility of the field.
Definition ProfileField.cpp:195
QStringList options() const
Gets the allowed values for the field.
Definition ProfileField.cpp:151
ProfileField(const QDomElement &aRoot)
Constructs a ProfileField from XML.
Definition ProfileField.cpp:95
QString name() const
Gets the field name.
Definition ProfileField.cpp:136
bool isReadOnly() const
Checks if the field is read only.
Definition ProfileField.cpp:204
QDomElement toXml(QDomDocument &aDoc) const
Exports the field to XML.
Definition ProfileField.cpp:168
static const QString VISIBLE_NEVER
Field should never be visible in UI.
Definition ProfileField.h:55
static const QString VISIBLE_ALWAYS
Field should be always visible in UI.
Definition ProfileField.h:52
static const QString VISIBLE_USER
Field should be visible in UI if a value for the field has not.
Definition ProfileField.h:59
QString type() const
Get the field type.
Definition ProfileField.cpp:141
bool validate(const QString &aValue) const
Checks if the given value is in the list of allowed values.
Definition ProfileField.cpp:161
~ProfileField()
Destructor.
Definition ProfileField.cpp:130
QString defaultValue() const
Gets the field default value.
Definition ProfileField.cpp:146
QString label() const
Gets the field label.
Definition ProfileField.cpp:156
static const QString TYPE_BOOLEAN
Field type for boolean fields.
Definition ProfileField.h:62