27#include "SyncCommonDefs.h"
28#include "SyncResults.h"
97 void abort(Sync::SyncStatus aStatus = Sync::SYNC_ABORTED);
191 Sync::TransferDatabase aDatabase, Sync::TransferType aType,
192 const QString &aMimeType,
int aCommittedItems);
199 void storageAccquired(
const QString &aProfileName,
const QString &aMimeType);
208 void finished(
const QString &aProfileName, Sync::SyncStatus aStatus,
225 void onSuccess(
const QString &aProfileName,
const QString &aMessage);
229 void onTransferProgress(
const QString &aProfileName,
230 Sync::TransferDatabase aDatabase, Sync::TransferType aType,
231 const QString &aMimeType,
int aCommittedItems);
233 void onStorageAccquired (
const QString &aMimeType);
235 void onSyncProgressDetail(
const QString &aProfileName,
int aProgressDetail);
239 void onDestroyed(QObject *aPluginRunner);
241 void onNetworkSessionOpened();
243 void onNetworkSessionError();
249 Sync::SyncStatus iStatus;
251 bool iPluginRunnerOwned;
261#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
265#ifdef SYNCFW_UNIT_TESTS
266 friend class SyncSessionTest;
Class for managing network sessions.
Definition NetworkManager.h:43
Base class for running sync plug-ins.
Definition PluginRunner.h:45
A helper class for managing storage reservations.
Definition StorageBooker.h:37
A top level synchronization profile.
Definition SyncProfile.h:54
Contains information about a completed synchronization session.
Definition SyncResults.h:62
MajorCode
enum value
Definition SyncResults.h:77
MinorCode
enum value
Definition SyncResults.h:89
Class representing a single sync session.
Definition SyncSession.h:44
void finished(const QString &aProfileName, Sync::SyncStatus aStatus, const QString &aMessage, SyncResults::MinorCode aErrorCode)
Signal sent when the session has finished.
Definition moc_SyncSession.cpp:416
bool isScheduled() const
Checks if the session was started by the scheduler.
Definition SyncSession.cpp:269
void setPluginRunner(PluginRunner *aPluginRunner, bool aTransferOwnership)
Associates a plug-in runner with this session.
Definition SyncSession.cpp:81
bool isAborted()
Returns if the sync session was aborted.
Definition SyncSession.cpp:175
QMap< QString, bool > getStorageMap()
returns the StorageMap used for this session
Definition SyncSession.cpp:200
PluginRunner * pluginRunner()
Gets the plug-in runner associated with this session.
Definition SyncSession.cpp:117
SyncResults results() const
Gets the results of the finished session.
Definition SyncSession.cpp:254
void transferProgress(const QString &aProfileName, Sync::TransferDatabase aDatabase, Sync::TransferType aType, const QString &aMimeType, int aCommittedItems)
Definition moc_SyncSession.cpp:402
void setProfileCreated(bool aProfileCreated)
sets Profile Created flag to true
Definition SyncSession.cpp:218
void storageAccquired(const QString &aProfileName, const QString &aMimeType)
Signal sent when a storage is accquired.
Definition moc_SyncSession.cpp:409
void updateResults(const SyncResults &aResults)
Sets the results for this session.
Definition SyncSession.cpp:380
void stop()
Stops the session. Returns when the session is stopped.
Definition SyncSession.cpp:224
void abort(Sync::SyncStatus aStatus=Sync::SYNC_ABORTED)
Aborts the session. Returns when the abort request is sent.
Definition SyncSession.cpp:180
void syncProgressDetail(const QString &aProfileName, int aProgressDetail)
Signal sent when the sync is in progress to indicate the detail of the progress.
Definition moc_SyncSession.cpp:423
bool start()
Starts the session using the associated plug-in runner.
Definition SyncSession.cpp:124
void setStorageMap(QMap< QString, bool > &aStorageMap)
sets the storage map for this session
Definition SyncSession.cpp:206
bool isFinished()
Returns if the sync session is finished or in process.
Definition SyncSession.cpp:170
bool isProfileCreated()
returns the returns the status of the profile creation for this session
Definition SyncSession.cpp:212
void releaseStorages()
Releases storages that were reserved earlier with reserveStorages.
Definition SyncSession.cpp:411
void setFailureResult(SyncResults::MajorCode aMajorCode, SyncResults::MinorCode aMinorCode)
Sets the results for this session using the provided error code.
Definition SyncSession.cpp:388
bool reserveStorages(StorageBooker *aStorageBooker)
Tries to reserve storages needed by the session.
Definition SyncSession.cpp:396
virtual ~SyncSession()
Destructor.
Definition SyncSession.cpp:55
QString profileName() const
Gets the name of the profile used by this session.
Definition SyncSession.cpp:242
SyncProfile * profile() const
Gets the sync profile used by this session.
Definition SyncSession.cpp:235
void setScheduled(bool aScheduled)
Sets if the session was started by the scheduler.
Definition SyncSession.cpp:261
SyncSession(SyncProfile *aProfile, QObject *aParent=0)
Constructor.
Definition SyncSession.cpp:35
Sync::SyncStatus mapToSyncStatusError(int aErrorCode)
Maps sync failure error code from stack to SyncStatus.
Definition SyncSession.cpp:316
Definition SyncBackupAdaptor.h:41