ButeoSynchronizationFramework
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, qlonglong aNextSyncTime);
162 
163 public slots:
164 
179  virtual bool startSync(QString aProfileId) = 0;
180 
189  virtual Q_NOREPLY void abortSync(QString aProfileId) = 0;
190 
197  virtual bool removeProfile(QString aProfileId) = 0;
198 
207  virtual bool updateProfile(QString aProfileAsXml) = 0;
208 
225  virtual bool requestStorages(QStringList aStorageNames) = 0;
226 
234  virtual Q_NOREPLY void releaseStorages(QStringList aStorageNames) = 0;
235 
241  virtual QStringList runningSyncs() = 0;
242 
243 
248  virtual bool getBackUpRestoreState() = 0;
249 
250 
264  virtual bool setSyncSchedule(QString aProfileId , QString aScheduleAsXml) = 0;
265 
272  virtual bool saveSyncResults(QString aProfileId,QString aSyncResults) = 0;
273 
278  virtual QString getLastSyncResult(const QString &aProfileId) = 0;
279 
286  virtual QStringList allVisibleSyncProfiles() = 0;
287 
296  virtual QString syncProfile(const QString &aProfileId) = 0;
297 
307  virtual QStringList syncProfilesByKey(const QString &aKey, const QString &aValue) = 0;
308 
314  virtual QStringList syncProfilesByType(const QString &aType) = 0;
315 
320  virtual Q_NOREPLY void start(unsigned int aAccountId) = 0;
321 
326  virtual Q_NOREPLY void stop(unsigned int aAccountId) = 0;
327 
332  virtual QList<unsigned int> syncingAccounts() = 0;
333 
347  virtual int status(unsigned int aAccountId, int &aFailedReason, qlonglong &aPrevSyncTime, qlonglong &aNextSyncTime) = 0;
348 };
349 
350 }
351 
352 #endif // SYNCDBUSINTERFACE_H
void transferProgress(QString aProfileName, int aTransferDatabase, int aTransferType, QString aMimeType, int aCommittedItems)
Notifies about progress in transferring items.
Definition: moc_SyncDBusInterface.cpp:404
virtual QList< unsigned int > syncingAccounts()=0
Returns the list of account IDs for which sync is ongoing.
virtual int status(unsigned int aAccountId, int &aFailedReason, qlonglong &aPrevSyncTime, qlonglong &aNextSyncTime)=0
Returns the status of the sync for the given account Id.
virtual bool saveSyncResults(QString aProfileId, QString aSyncResults)=0
Save SyncResults to log.xml file.
virtual Q_NOREPLY void releaseStorages(QStringList aStorageNames)=0
Releases the given storages so that sync daemon can again use them freely.
virtual Q_NOREPLY void start(unsigned int aAccountId)=0
Starts sync for all profiles matching the given account ID.
void backupDone()
Notifies about Backup done.
Definition: moc_SyncDBusInterface.cpp:424
virtual bool removeProfile(QString aProfileId)=0
This function should be called when sync profile has to be deleted.
virtual QString syncProfile(const QString &aProfileId)=0
Gets a sync profile.
Definition: AccountsHelper.h:31
virtual bool requestStorages(QStringList aStorageNames)=0
Requests sync daemon to reserve storages for the caller.
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.
Definition: moc_SyncDBusInterface.cpp:397
virtual QStringList runningSyncs()=0
Gets the list of profile names of currently running syncs.
virtual QString getLastSyncResult(const QString &aProfileId)=0
To get lastSyncResult.
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.
Definition: moc_SyncDBusInterface.cpp:449
void resultsAvailable(QString aProfileName, QString aResultsAsXml)
Notifies about the availability of Results for a recent sync.
Definition: moc_SyncDBusInterface.cpp:442
virtual Q_NOREPLY void stop(unsigned int aAccountId)=0
Stops sync for all profiles matching the given account ID.
void signalProfileChanged(QString aProfileName, int aChangeType, QString aProfileAsXml)
Notifies about a change in profile.
Definition: moc_SyncDBusInterface.cpp:411
void restoreInProgress()
Notifies about Restore start.
Definition: moc_SyncDBusInterface.cpp:430
virtual bool startSync(QString aProfileId)=0
Requests to starts synchronizing using a profile with the given name.
virtual QStringList syncProfilesByKey(const QString &aKey, const QString &aValue)=0
Gets a sync profiles matching the key-value.
virtual QStringList allVisibleSyncProfiles()=0
Gets all visible sync profiles.
void backupInProgress()
Notifies about Backup start.
Definition: moc_SyncDBusInterface.cpp:418
Definition: SyncBackupAdaptor.h:40
void restoreDone()
Notifies about Restore Done.
Definition: moc_SyncDBusInterface.cpp:436
virtual QStringList syncProfilesByType(const QString &aType)=0
Gets a profiles matching the profile type.
virtual bool setSyncSchedule(QString aProfileId, QString aScheduleAsXml)=0
sets the schedule for a profile
virtual bool getBackUpRestoreState()=0
This function returns true if backup/restore in progress else false.