24 #ifndef PROFILEMANAGER_H
25 #define PROFILEMANAGER_H
27 #include "SyncProfile.h"
35 class ProfileManagerPrivate;
114 const QString &aSecondaryPath = QString());
172 const QString &aSubProfileType,
173 const QString &aKey =
"",
const QString &aValue =
"");
197 const QString &aStorageName,
bool aStorageMustBeEnabled =
false);
208 const QString &aStorageName);
294 bool rename(
const QString &aName,
const QString &aNewName);
352 #ifdef SYNCFW_UNIT_TESTS
353 friend class ProfileManagerTest;
373 ProfileManagerPrivate *d_ptr;
375 QHash<QString, QList<quint32> > iSyncRetriesInfo;
ProfileManager is responsible for storing and retrieving the profiles.
Definition: ProfileManager.h:46
QList< SyncProfile * > allVisibleSyncProfiles()
Gets all visible sync profiles.
Definition: ProfileManager.cpp:399
void enableStorages(Profile &aProfile, QMap< QString, bool > &aStorageMap, bool *aModified=NULL)
Enables sync'd storages in profile.
Definition: ProfileManager.cpp:739
void expand(Profile &aProfile)
Expands the given profile.
Definition: ProfileManager.cpp:840
bool saveLog(const SyncLog &aLog)
Saves the given synchronization log.
Definition: ProfileManager.cpp:879
QList< SyncProfile * > getSOCProfilesForStorage(const QString &aStorageName)
Gets profiles interested in sync on change for a storage.
Definition: ProfileManager.cpp:500
Profile * profileFromXml(const QString &aProfileAsXml)
Gets a profile object from an xml document.
Definition: ProfileManager.cpp:644
QList< SyncProfile * > allSyncProfiles()
Gets all sync profiles.
Definition: ProfileManager.cpp:382
QList< SyncProfile * > getSyncProfilesByStorage(const QString &aStorageName, bool aStorageMustBeEnabled=false)
Gets profiles based on supported storages.
Definition: ProfileManager.cpp:553
bool saveSyncResults(QString aProfileName, const SyncResults &aResults)
Saves the results of a sync session to the log.
Definition: ProfileManager.cpp:958
QString updateProfile(const Profile &aProfile)
Updates the existing profile with the profile given as parameter and emits profileChanged() Signal wi...
Definition: ProfileManager.cpp:662
~ProfileManager()
Destructor.
Definition: ProfileManager.cpp:304
SyncProfile * syncProfile(const QString &aName)
Gets a sync profile.
Definition: ProfileManager.cpp:317
Profile * profile(const QString &aName, const QString &aType)
Gets a profile.
Definition: ProfileManager.cpp:311
bool rename(const QString &aName, const QString &aNewName)
Renames a profile, and the associated log too.
Definition: ProfileManager.cpp:929
void setStoragesVisible(Profile &aProfile, QMap< QString, bool > &aStorageMap, bool *aModified=NULL)
Sets storage subprofiles hidden status for the given profile.
Definition: ProfileManager.cpp:764
SyncProfile * createTempSyncProfile(const QString &btAddress, bool &saveNewProfile)
Gets a temporary profile (saved if sync is sucessfull).
Definition: ProfileManager.cpp:695
bool removeProfile(const QString &aProfileId)
Deletes a profile from the persistent storage.
Definition: ProfileManager.cpp:791
QStringList profileNames(const QString &aType)
Gets the names of all available profiles with the given type.
Definition: ProfileManager.cpp:350
QList< SyncProfile * > getSyncProfilesByData(const QString &aSubProfileName, const QString &aSubProfileType, const QString &aKey="", const QString &aValue="")
Gets profiles with matching data.
Definition: ProfileManager.cpp:416
ProfileManager(const QString &aPrimaryPath=QString(), const QString &aSecondaryPath=QString())
Constructor.
Definition: ProfileManager.cpp:296
QDateTime getNextRetryInterval(const SyncProfile *aProfile)
gets the next retry after time for a sync profile
Definition: ProfileManager.cpp:1138
void retriesDone(const QString &aProfileName)
call this to indicate that retries have to stop for a certain sync for a profile - either the no....
Definition: ProfileManager.cpp:1153
bool setSyncSchedule(QString aProfileId, QString aScheduleAsXml)
Sets/Overwrites the schedule to a profile.
Definition: ProfileManager.cpp:982
void addRetriesInfo(const SyncProfile *aProfile)
checks if a profile has retries info and stores the same
Definition: ProfileManager.cpp:1127
void saveRemoteTargetId(Profile &aProfile, const QString &aId)
Sets remote target in profile.
Definition: ProfileManager.cpp:918
ProfileChangeType
Enum to indicate the change type of the Profile Operation.
Definition: ProfileManager.h:94
@ PROFILE_LOGS_MODIFIED
Profile log file Modified.
Definition: ProfileManager.h:102
@ PROFILE_MODIFIED
a Existing Profile has been modified
Definition: ProfileManager.h:98
@ PROFILE_ADDED
a New Profile has been added
Definition: ProfileManager.h:96
@ PROFILE_REMOVED
Profile has been Removed.
Definition: ProfileManager.h:100
void signalProfileChanged(QString aProfileName, int aChangeType, QString aProfileAsXml)
Notifies about a change in profile.
Definition: moc_ProfileManager.cpp:132
This class represents a single profile, a collection of settings or data releated to some entity.
Definition: Profile.h:53
History of completed synchronization sessions and their results.
Definition: SyncLog.h:45
A top level synchronization profile.
Definition: SyncProfile.h:49
Contains information about a completed synchronization session.
Definition: SyncResults.h:59
Definition: SyncBackupAdaptor.h:40
Search criteria for finding profiles.
Definition: ProfileManager.h:50
QString iValue
Key value. This must be given if criteria type is EQUAL or NOT_EQUAL.
Definition: ProfileManager.h:90
QString iKey
Key name. If this is empty, key comparison is not made.
Definition: ProfileManager.h:87
Type
Enum to identify if a member type exists or not.
Definition: ProfileManager.h:52
@ EXISTS
Sub-profile (and key) exists.
Definition: ProfileManager.h:54
@ EQUAL
Key value is equal.
Definition: ProfileManager.h:60
@ NOT_EXISTS
Sub-profile (or key) does not exist.
Definition: ProfileManager.h:57
@ NOT_EQUAL
Key value is not equal.
Definition: ProfileManager.h:63
QString iSubProfileName
Definition: ProfileManager.h:79
SearchCriteria()
Constructor.
Definition: ProfileManager.cpp:282
Type iType
Search criteria type.
Definition: ProfileManager.h:73
QString iSubProfileType
Definition: ProfileManager.h:84