30 #include <QStringList>
31 #include "ProfileField.h"
79 Profile(
const QString &aName,
const QString &aType);
85 explicit Profile(
const QDomElement &aRoot);
106 QString
name()
const;
118 virtual void setName(
const QString &aName);
124 virtual void setName(
const QStringList &aKeys);
130 QString
type()
const;
142 virtual QDomElement
toXml(QDomDocument &aDoc,
bool aLocalOnly =
true)
const;
159 QString
key(
const QString &aName,
const QString &aDefault = QString())
const;
181 bool boolKey(
const QString &aName,
bool aDefault =
false)
const;
189 QStringList
keyValues(
const QString &aName)
const;
203 void setKey(
const QString &aName,
const QString &aValue);
212 void setKeyValues(
const QString &aName,
const QStringList &aValues);
221 void setBoolKey(
const QString &aName,
bool aValue);
287 const Profile *
subProfile(
const QString &aName,
const QString &aType =
"")
const;
299 const QString &aValue,
300 const QString &aType,
301 bool aEnabledOnly)
const;
386 QString generateProfileId(
const QStringList &aKeys);
388 #ifdef SYNCFW_UNIT_TESTS
389 friend class ProfileTest;
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:450
const ProfileField * field(const QString &aName) const
Gets the field with the given name.
Definition: Profile.cpp:250
This class represents a single profile, a collection of settings or data releated to some entity...
Definition: Profile.h:52
void setEnabled(bool aEnabled)
Set is the profile is enabled.
Definition: Profile.cpp:540
QStringList subProfileNames(const QString &aType="") const
Gets the names of all sub-profiles with the given type.
Definition: Profile.cpp:405
static const QString TYPE_SERVER
Server type .
Definition: Profile.h:59
void setBoolKey(const QString &aName, bool aValue)
Sets the value of a boolean key.
Definition: Profile.cpp:239
QList< Profile * > allSubProfiles()
Gets all sub-profiles.
Definition: Profile.cpp:469
This class represents a profile field.
Definition: ProfileField.h:48
virtual ~Profile()
Destructor.
Definition: Profile.cpp:109
Definition: AccountsHelper.h:31
bool isLoaded() const
Checks if the profile is fully constructed by loading all sub-profiles from separate profile files...
Definition: Profile.cpp:525
void removeKey(const QString &aName)
Removes a key from profile. All instances of the key are removed.
Definition: Profile.cpp:244
Profile * subProfile(const QString &aName, const QString &aType="")
Gets a sub-profile with the given name and type.
Definition: Profile.cpp:420
bool isProtected() const
Checks if the profile is protected.
Definition: Profile.cpp:550
QList< const ProfileField * > visibleFields() const
Gets all visible fields of the profile.
Definition: Profile.cpp:269
static const QString TYPE_SYNC
Service type.
Definition: Profile.h:65
static const QString TYPE_CLIENT
String constants for different profile type names.
Definition: Profile.h:57
void setKeyValues(const QString &aName, const QStringList &aValues)
Sets multiple values for a key.
Definition: Profile.cpp:223
virtual Profile * clone() const
Creates a clone of the profile.
Definition: Profile.cpp:104
QList< const ProfileField * > allFields() const
Gets all fields.
Definition: Profile.cpp:262
virtual bool isEnabled() const
Returns if the profile is enabled.
Definition: Profile.cpp:535
QMap< QString, QString > allKeys() const
Gets all keys and their values.
Definition: Profile.cpp:154
virtual QDomElement toXml(QDomDocument &aDoc, bool aLocalOnly=true) const
Creates a XML representation of the profile.
Definition: Profile.cpp:292
QStringList keyNames() const
Gets the names of all keys.
Definition: Profile.cpp:198
void merge(const Profile &aSource)
Merges a profile to this profile.
Definition: Profile.cpp:485
QString toString() const
Outputs a XML representation of the profile to a string.
Definition: Profile.cpp:347
QString key(const QString &aName, const QString &aDefault=QString()) const
Gets the value of the given key.
Definition: Profile.cpp:136
bool boolKey(const QString &aName, bool aDefault=false) const
Gets the value of the given boolean key.
Definition: Profile.cpp:179
QString name() const
Gets the name of the profile.
Definition: Profile.cpp:115
bool isValid() const
Checks if the profile is valid.
Definition: Profile.cpp:360
QString displayname() const
Gets the display name of the profile.
Definition: Profile.cpp:555
Profile()
Default Constructor.
Definition: Profile.cpp:45
static const QString TYPE_STORAGE
Storage type.
Definition: Profile.h:61
QString type() const
Gets the type of the profile.
Definition: Profile.cpp:131
QStringList keyValues(const QString &aName) const
Gets the values of all keys with the given name.
Definition: Profile.cpp:192
void setLoaded(bool aLoaded)
Sets if the profile is fully loaded.
Definition: Profile.cpp:530
Private implementation class for Profile class.
Definition: Profile_p.h:34
QMap< QString, QString > allNonStorageKeys() const
Gets all keys that are not related to storages.
Definition: Profile.cpp:162
bool isHidden() const
Checks if the profile is hidden.
Definition: Profile.cpp:545
Definition: SyncBackupAdaptor.h:40
virtual void setName(const QString &aName)
Sets the name of the profile.
Definition: Profile.cpp:120
void setKey(const QString &aName, const QString &aValue)
Sets the value of a key.
Definition: Profile.cpp:203