msyncd/SyncDBusInterface.h
/*
* This file is part of buteo-syncfw package
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
* Copyright (C) 2015 Jolla Ltd.
*
* Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef SYNCDBUSINTERFACE_H
#define SYNCDBUSINTERFACE_H
#include <QtDBus>
#include <QObject>
#include <QString>
#include <QList>
namespace Buteo {
class SyncDBusInterface : public QObject
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "com.meego.msyncd")
public:
signals:
void syncStatus(QString aProfileName, int aStatus,
QString aMessage, int aMoreDetails);
void transferProgress(QString aProfileName, int aTransferDatabase,
int aTransferType, QString aMimeType, int aCommittedItems);
void signalProfileChanged(QString aProfileName, int aChangeType, QString aProfileAsXml);
void backupInProgress ();
void backupDone();
void restoreInProgress();
void restoreDone();
void resultsAvailable(QString aProfileName, QString aResultsAsXml);
void statusChanged(unsigned int aAccountId, int aNewStatus, int aFailedReason, qlonglong aPrevSyncTime,
qlonglong aNextSyncTime);
bool isConnectivityAvailable(int connectivityType);
void syncedExternallyStatus(uint aAccountId, const QString &aClientProfileName, bool aState);
public slots:
virtual bool startSync(QString aProfileId) = 0;
virtual Q_NOREPLY void abortSync(QString aProfileId) = 0;
virtual bool removeProfile(QString aProfileId) = 0;
virtual bool updateProfile(QString aProfileAsXml) = 0;
virtual bool requestStorages(QStringList aStorageNames) = 0;
virtual Q_NOREPLY void releaseStorages(QStringList aStorageNames) = 0;
virtual QStringList runningSyncs() = 0;
virtual bool getBackUpRestoreState() = 0;
virtual bool setSyncSchedule(QString aProfileId, QString aScheduleAsXml) = 0;
virtual bool saveSyncResults(QString aProfileId, QString aSyncResults) = 0;
virtual QString getLastSyncResult(const QString &aProfileId) = 0;
virtual QStringList allVisibleSyncProfiles() = 0;
virtual QString syncProfile(const QString &aProfileId) = 0;
virtual QStringList syncProfilesByKey(const QString &aKey, const QString &aValue) = 0;
virtual QStringList profilesByType(const QString &aType) = 0;
virtual QStringList syncProfilesByType(const QString &aType) = 0;
virtual Q_NOREPLY void start(unsigned int aAccountId) = 0;
virtual Q_NOREPLY void stop(unsigned int aAccountId) = 0;
virtual QList<unsigned int> syncingAccounts() = 0;
virtual int status(unsigned int aAccountId, int &aFailedReason, qlonglong &aPrevSyncTime, qlonglong &aNextSyncTime) = 0;
virtual Q_NOREPLY void isSyncedExternally(unsigned int aAccountId, const QString aClientProfileName) = 0;
virtual QString createSyncProfileForAccount(uint aAccountId) = 0;
};
}
#endif // SYNCDBUSINTERFACE_H
Buteo::SyncDBusInterface
Defines a D-Bus interface for the sync daemon.
Definition msyncd/SyncDBusInterface.h:42
Buteo::SyncDBusInterface::backupDone
void backupDone()
Notifies about Backup done.
Buteo::SyncDBusInterface::startSync
virtual bool startSync(QString aProfileId)=0
Requests to starts synchronizing using a profile with the given name.
Buteo::SyncDBusInterface::syncingAccounts
virtual QList< unsigned int > syncingAccounts()=0
Returns the list of account IDs for which sync is ongoing.
Buteo::SyncDBusInterface::signalProfileChanged
void signalProfileChanged(QString aProfileName, int aChangeType, QString aProfileAsXml)
Notifies about a change in profile.
Buteo::SyncDBusInterface::createSyncProfileForAccount
virtual QString createSyncProfileForAccount(uint aAccountId)=0
Create a sync profile for the account if it does not exists.
Buteo::SyncDBusInterface::allVisibleSyncProfiles
virtual QStringList allVisibleSyncProfiles()=0
Gets all visible sync profiles.
Buteo::SyncDBusInterface::isConnectivityAvailable
bool isConnectivityAvailable(int connectivityType)
Returns the connectivity state of a specific medium like bluetooth, USB or network.
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.
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.
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.
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.
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::syncedExternallyStatus
void syncedExternallyStatus(uint aAccountId, const QString &aClientProfileName, bool aState)
Notifies sync externally status for an account and client profile.
Buteo::SyncDBusInterface::setSyncSchedule
virtual bool setSyncSchedule(QString aProfileId, QString aScheduleAsXml)=0
sets the schedule for a profile
Buteo::SyncDBusInterface::isSyncedExternally
virtual Q_NOREPLY void isSyncedExternally(unsigned int aAccountId, const QString aClientProfileName)=0
Queries the sync externally status of a given account, 'syncedExternallyStatus' signal is emitted wit...
Buteo::SyncDBusInterface::transferProgress
void transferProgress(QString aProfileName, int aTransferDatabase, int aTransferType, QString aMimeType, int aCommittedItems)
Notifies about progress in transferring items.
Buteo::SyncDBusInterface::restoreDone
void restoreDone()
Notifies about Restore Done.
Buteo::SyncDBusInterface::resultsAvailable
void resultsAvailable(QString aProfileName, QString aResultsAsXml)
Notifies about the availability of Results for a recent sync.
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.
Buteo::SyncDBusInterface::profilesByType
virtual QStringList profilesByType(const QString &aType)=0
Gets all profiles matching the profile type.
QList
Definition SyncBackupAdaptor.h:40