31#include "ProfileField.h"
77 Profile(
const QString &aName,
const QString &aType);
83 explicit Profile(
const QDomElement &aRoot);
104 QString
name()
const;
116 virtual void setName(
const QString &aName);
122 virtual void setName(
const QStringList &aKeys);
128 QString
type()
const;
140 virtual QDomElement
toXml(QDomDocument &aDoc,
bool aLocalOnly =
true)
const;
157 QString
key(
const QString &aName,
const QString &aDefault = QString())
const;
179 bool boolKey(
const QString &aName,
bool aDefault =
false)
const;
187 QStringList
keyValues(
const QString &aName)
const;
201 void setKey(
const QString &aName,
const QString &aValue);
210 void setKeyValues(
const QString &aName,
const QStringList &aValues);
219 void setBoolKey(
const QString &aName,
bool aValue);
285 const Profile *
subProfile(
const QString &aName,
const QString &aType =
"")
const;
297 const QString &aValue,
298 const QString &aType,
299 bool aEnabledOnly)
const;
382 QString generateProfileId(
const QStringList &aKeys);
384#ifdef SYNCFW_UNIT_TESTS
385 friend class ProfileTest;
This class represents a profile field.
Definition ProfileField.h:49
Private implementation class for Profile class.
Definition Profile_p.h:35
This class represents a single profile, a collection of settings or data releated to some entity.
Definition Profile.h:53
QList< Profile * > allSubProfiles()
Gets all sub-profiles.
Definition Profile.cpp:455
QList< const ProfileField * > allFields() const
Gets all fields.
Definition Profile.cpp:268
QStringList keyValues(const QString &aName) const
Gets the values of all keys with the given name.
Definition Profile.cpp:188
void setEnabled(bool aEnabled)
Set is the profile is enabled.
Definition Profile.cpp:524
static const QString TYPE_SERVER
Server type .
Definition Profile.h:58
bool isHidden() const
Checks if the profile is hidden.
Definition Profile.cpp:529
void setKeyValues(const QString &aName, const QStringList &aValues)
Sets multiple values for a key.
Definition Profile.cpp:227
Profile()
Default Constructor.
Definition Profile.cpp:45
QString name() const
Gets the name of the profile.
Definition Profile.cpp:112
virtual Profile * clone() const
Creates a clone of the profile.
Definition Profile.cpp:101
virtual ~Profile()
Destructor.
Definition Profile.cpp:106
static const QString TYPE_STORAGE
Storage type.
Definition Profile.h:60
void setKey(const QString &aName, const QString &aValue)
Sets the value of a key.
Definition Profile.cpp:210
QString displayname() const
Gets the display name of the profile.
Definition Profile.cpp:539
virtual QDomElement toXml(QDomDocument &aDoc, bool aLocalOnly=true) const
Creates a XML representation of the profile.
Definition Profile.cpp:296
bool isValid() const
Checks if the profile is valid.
Definition Profile.cpp:357
QMap< QString, QString > allNonStorageKeys() const
Gets all keys that are not related to storages.
Definition Profile.cpp:157
void removeKey(const QString &aName)
Removes a key from profile. All instances of the key are removed.
Definition Profile.cpp:251
void setLoaded(bool aLoaded)
Sets if the profile is fully loaded.
Definition Profile.cpp:514
QString key(const QString &aName, const QString &aDefault=QString()) const
Gets the value of the given key.
Definition Profile.cpp:133
bool boolKey(const QString &aName, bool aDefault=false) const
Gets the value of the given boolean key.
Definition Profile.cpp:178
QStringList subProfileNames(const QString &aType="") const
Gets the names of all sub-profiles with the given type.
Definition Profile.cpp:399
bool isLoaded() const
Checks if the profile is fully constructed by loading all sub-profiles from separate profile files.
Definition Profile.cpp:509
const ProfileField * field(const QString &aName) const
Gets the field with the given name.
Definition Profile.cpp:257
virtual bool isEnabled() const
Returns if the profile is enabled.
Definition Profile.cpp:519
static const QString TYPE_CLIENT
String constants for different profile type names.
Definition Profile.h:56
QString type() const
Gets the type of the profile.
Definition Profile.cpp:128
static const QString TYPE_SYNC
Service type.
Definition Profile.h:64
void setBoolKey(const QString &aName, bool aValue)
Sets the value of a boolean key.
Definition Profile.cpp:246
void merge(const Profile &aSource)
Merges a profile to this profile.
Definition Profile.cpp:470
QStringList keyNames() const
Gets the names of all keys.
Definition Profile.cpp:201
QString toString() const
Outputs a XML representation of the profile to a string.
Definition Profile.cpp:344
Profile * subProfile(const QString &aName, const QString &aType="")
Gets a sub-profile with the given name and type.
Definition Profile.cpp:412
virtual void setName(const QString &aName)
Sets the name of the profile.
Definition Profile.cpp:117
QList< const ProfileField * > visibleFields() const
Gets all visible fields of the profile.
Definition Profile.cpp:275
bool isProtected() const
Checks if the profile is protected.
Definition Profile.cpp:534
const Profile * subProfileByKeyValue(const QString &aKey, const QString &aValue, const QString &aType, bool aEnabledOnly) const
Gets a sub-profile by key value.
Definition Profile.cpp:438
QMap< QString, QString > allKeys() const
Gets all keys and their values.
Definition Profile.cpp:146
Definition SyncBackupAdaptor.h:40
Definition SyncBackupAdaptor.h:41