Buteo Synchronization Framework: SyncDBusInterface.h Source File

Buteo Synchronization Framework

libbuteosyncfw/pluginmgr/SyncDBusInterface.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 #ifndef SYNCDBUSINTERFACE_H
24 #define SYNCDBUSINTERFACE_H
25
26 #include <QtDBus>
27 #include <QObject>
28 #include <QString>
29 #include <QList>
30
31 namespace Buteo {
32
40 class SyncDBusInterface : public QObject
41 {
42 Q_OBJECT
43 Q_CLASSINFO("D-Bus Interface", "com.meego.msyncd")
44
45 public:
46
47 signals:
48
71 void syncStatus(QString aProfileName, int aStatus,
72 QString aMessage, int aMoreDetails);
73
89 void transferProgress(QString aProfileName, int aTransferDatabase,
90 int aTransferType, QString aMimeType, int aCommittedItems);
91
104 void signalProfileChanged(QString aProfileName, int aChangeType, QString aProfileAsXml);
105
106
112 void backupInProgress ();
113
119 void backupDone();
120
126 void restoreInProgress();
127
133 void restoreDone();
134
142 void resultsAvailable(QString aProfileName, QString aResultsAsXml);
143
161 void statusChanged(unsigned int aAccountId, int aNewStatus, int aFailedReason, qlonglong aPrevSyncTime,
162 qlonglong aNextSyncTime);
163
164 public slots:
165
180 virtual bool startSync(QString aProfileId) = 0;
181
190 virtual Q_NOREPLY void abortSync(QString aProfileId) = 0;
191
198 virtual bool removeProfile(QString aProfileId) = 0;
199
208 virtual bool updateProfile(QString aProfileAsXml) = 0;
209
226 virtual bool requestStorages(QStringList aStorageNames) = 0;
227
235 virtual Q_NOREPLY void releaseStorages(QStringList aStorageNames) = 0;
236
242 virtual QStringList runningSyncs() = 0;
243
244
249 virtual bool getBackUpRestoreState() = 0;
250
251
265 virtual bool setSyncSchedule(QString aProfileId, QString aScheduleAsXml) = 0;
266
273 virtual bool saveSyncResults(QString aProfileId, QString aSyncResults) = 0;
274
279 virtual QString getLastSyncResult(const QString &aProfileId) = 0;
280
287 virtual QStringList allVisibleSyncProfiles() = 0;
288
297 virtual QString syncProfile(const QString &aProfileId) = 0;
298
308 virtual QStringList syncProfilesByKey(const QString &aKey, const QString &aValue) = 0;
309
315 virtual QStringList syncProfilesByType(const QString &aType) = 0;
316
321 virtual Q_NOREPLY void start(unsigned int aAccountId) = 0;
322
327 virtual Q_NOREPLY void stop(unsigned int aAccountId) = 0;
328
333 virtual QList<unsigned int> syncingAccounts() = 0;
334
348 virtual int status(unsigned int aAccountId, int &aFailedReason, qlonglong &aPrevSyncTime, qlonglong &aNextSyncTime) = 0;
349 };
350
351 }
352
353 #endif // SYNCDBUSINTERFACE_H
Buteo::SyncDBusInterface::backupDone
void backupDone()
Notifies about Backup done.
Definition: moc_SyncDBusInterface.cpp:430
Buteo::SyncDBusInterface::startSync
virtual bool startSync(QString aProfileId)=0
Requests to starts synchronizing using a profile with the given name.
Buteo::SyncDBusInterface::signalProfileChanged
void signalProfileChanged(QString aProfileName, int aChangeType, QString aProfileAsXml)
Notifies about a change in profile.
Definition: moc_SyncDBusInterface.cpp:417
Buteo::SyncDBusInterface::syncingAccounts
virtual QList< unsigned int > syncingAccounts()=0
Returns the list of account IDs for which sync is ongoing.
Buteo::SyncDBusInterface::allVisibleSyncProfiles
virtual QStringList allVisibleSyncProfiles()=0
Gets all visible sync profiles.
Buteo::SyncDBusInterface::abortSync
virtual Q_NOREPLY void abortSync(QString aProfileId)=0
Stops synchronizing the profile with the given name.
Buteo::SyncDBusInterface::statusChanged
void statusChanged(unsigned int aAccountId, int aNewStatus, int aFailedReason, qlonglong aPrevSyncTime, qlonglong aNextSyncTime)
Notifies sync status change for a set of account Ids.
Definition: moc_SyncDBusInterface.cpp:455
Buteo::SyncDBusInterface::saveSyncResults
virtual bool saveSyncResults(QString aProfileId, QString aSyncResults)=0
Save SyncResults to log.xml file.
Buteo::SyncDBusInterface::getBackUpRestoreState
virtual bool getBackUpRestoreState()=0
This function returns true if backup/restore in progress else false.
Buteo::SyncDBusInterface::syncProfilesByKey
virtual QStringList syncProfilesByKey(const QString &aKey, const QString &aValue)=0
Gets a sync profiles matching the key-value.
Buteo::SyncDBusInterface::releaseStorages
virtual Q_NOREPLY void releaseStorages(QStringList aStorageNames)=0
Releases the given storages so that sync daemon can again use them freely.
Buteo::SyncDBusInterface::backupInProgress
void backupInProgress()
Notifies about Backup start.
Definition: moc_SyncDBusInterface.cpp:424
Buteo::SyncDBusInterface::requestStorages
virtual bool requestStorages(QStringList aStorageNames)=0
Requests sync daemon to reserve storages for the caller.
Buteo::SyncDBusInterface::getLastSyncResult
virtual QString getLastSyncResult(const QString &aProfileId)=0
To get lastSyncResult.
Buteo::SyncDBusInterface::syncProfilesByType
virtual QStringList syncProfilesByType(const QString &aType)=0
Gets a profiles matching the profile type.
Buteo::SyncDBusInterface::updateProfile
virtual bool updateProfile(QString aProfileAsXml)=0
This function should be called when sync profile information has been changed by someone else than th...
Buteo::SyncDBusInterface::syncStatus
void syncStatus(QString aProfileName, int aStatus, QString aMessage, int aMoreDetails)
Notifies about a change in synchronization status.
Definition: moc_SyncDBusInterface.cpp:403
Buteo::SyncDBusInterface::runningSyncs
virtual QStringList runningSyncs()=0
Gets the list of profile names of currently running syncs.
Buteo::SyncDBusInterface::restoreInProgress
void restoreInProgress()
Notifies about Restore start.
Definition: moc_SyncDBusInterface.cpp:436
Buteo::SyncDBusInterface::syncProfile
virtual QString syncProfile(const QString &aProfileId)=0
Gets a sync profile.
Buteo::SyncDBusInterface::removeProfile
virtual bool removeProfile(QString aProfileId)=0
This function should be called when sync profile has to be deleted.
Buteo::SyncDBusInterface::start
virtual Q_NOREPLY void start(unsigned int aAccountId)=0
Starts sync for all profiles matching the given account ID.
Buteo::SyncDBusInterface::stop
virtual Q_NOREPLY void stop(unsigned int aAccountId)=0
Stops sync for all profiles matching the given account ID.
Buteo::SyncDBusInterface::setSyncSchedule
virtual bool setSyncSchedule(QString aProfileId, QString aScheduleAsXml)=0
sets the schedule for a profile
Buteo::SyncDBusInterface::transferProgress
void transferProgress(QString aProfileName, int aTransferDatabase, int aTransferType, QString aMimeType, int aCommittedItems)
Notifies about progress in transferring items.
Definition: moc_SyncDBusInterface.cpp:410
Buteo::SyncDBusInterface::restoreDone
void restoreDone()
Notifies about Restore Done.
Definition: moc_SyncDBusInterface.cpp:442
Buteo::SyncDBusInterface::resultsAvailable
void resultsAvailable(QString aProfileName, QString aResultsAsXml)
Notifies about the availability of Results for a recent sync.
Definition: moc_SyncDBusInterface.cpp:448
Buteo::SyncDBusInterface::status
virtual int status(unsigned int aAccountId, int &aFailedReason, qlonglong &aPrevSyncTime, qlonglong &aNextSyncTime)=0
Returns the status of the sync for the given account Id.
QList
Definition: SyncBackupAdaptor.h:40