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
31namespace Buteo {
32
40class SyncDBusInterface : public QObject
41{
42 Q_OBJECT
43 Q_CLASSINFO("D-Bus Interface", "com.meego.msyncd")
44
45public:
46
47signals:
48
71 void syncStatus(QString aProfileName, int aStatus,
72 QString aMessage, int aMoreDetails);
73
88
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
113
120
127
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
164public 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
Defines a D-Bus interface for the sync daemon.
Definition msyncd/SyncDBusInterface.h:42
void backupDone()
Notifies about Backup done.
virtual bool startSync(QString aProfileId)=0
Requests to starts synchronizing using a profile with the given name.
virtual QList< unsigned int > syncingAccounts()=0
Returns the list of account IDs for which sync is ongoing.
void signalProfileChanged(QString aProfileName, int aChangeType, QString aProfileAsXml)
Notifies about a change in profile.
virtual QStringList allVisibleSyncProfiles()=0
Gets all visible sync profiles.
virtual Q_NOREPLY void abortSync(QString aProfileId)=0
Stops synchronizing the profile with the given name.
void statusChanged(unsigned int aAccountId, int aNewStatus, int aFailedReason, qlonglong aPrevSyncTime, qlonglong aNextSyncTime)
Notifies sync status change for a set of account Ids.
virtual bool saveSyncResults(QString aProfileId, QString aSyncResults)=0
Save SyncResults to log.xml file.
virtual bool getBackUpRestoreState()=0
This function returns true if backup/restore in progress else false.
virtual QStringList syncProfilesByKey(const QString &aKey, const QString &aValue)=0
Gets a sync profiles matching the key-value.
virtual Q_NOREPLY void releaseStorages(QStringList aStorageNames)=0
Releases the given storages so that sync daemon can again use them freely.
void backupInProgress()
Notifies about Backup start.
virtual bool requestStorages(QStringList aStorageNames)=0
Requests sync daemon to reserve storages for the caller.
virtual QString getLastSyncResult(const QString &aProfileId)=0
To get lastSyncResult.
virtual QStringList syncProfilesByType(const QString &aType)=0
Gets a profiles matching the profile type.
virtual bool updateProfile(QString aProfileAsXml)=0
This function should be called when sync profile information has been changed by someone else than th...
void syncStatus(QString aProfileName, int aStatus, QString aMessage, int aMoreDetails)
Notifies about a change in synchronization status.
virtual QStringList runningSyncs()=0
Gets the list of profile names of currently running syncs.
void restoreInProgress()
Notifies about Restore start.
virtual QString syncProfile(const QString &aProfileId)=0
Gets a sync profile.
virtual bool removeProfile(QString aProfileId)=0
This function should be called when sync profile has to be deleted.
virtual Q_NOREPLY void start(unsigned int aAccountId)=0
Starts sync for all profiles matching the given account ID.
virtual Q_NOREPLY void stop(unsigned int aAccountId)=0
Stops sync for all profiles matching the given account ID.
virtual bool setSyncSchedule(QString aProfileId, QString aScheduleAsXml)=0
sets the schedule for a profile
void transferProgress(QString aProfileName, int aTransferDatabase, int aTransferType, QString aMimeType, int aCommittedItems)
Notifies about progress in transferring items.
void restoreDone()
Notifies about Restore Done.
void resultsAvailable(QString aProfileName, QString aResultsAsXml)
Notifies about the availability of Results for a recent sync.
virtual int status(unsigned int aAccountId, int &aFailedReason, qlonglong &aPrevSyncTime, qlonglong &aNextSyncTime)=0
Returns the status of the sync for the given account Id.
Definition SyncBackupAdaptor.h:40