Buteo Synchronization Framework
SyncClientInterface.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
24#ifndef SYNCCLIENTINTERFACE_H
25#define SYNCCLIENTINTERFACE_H
26
27#include <QObject>
28#include <QString>
29#include <QSharedPointer>
30#include <Profile.h>
31#include <SyncProfile.h>
32#include <SyncResults.h>
33#include <SyncSchedule.h>
34
35class QDBusPendingCallWatcher;
36
37namespace Buteo {
38
39class SyncClientInterfacePrivate;
40
51class SyncClientInterface: public QObject
52{
53 Q_OBJECT
54
55public:
60
65
79 bool startSync(const QString &aProfileId) const;
80
88 QDBusPendingCallWatcher* requestSync(const QString &aProfileId, QObject *aParent = nullptr) const;
89
98 void abortSync(const QString &aProfileId) const;
99
105 QStringList getRunningSyncList() const;
106
113 QDBusPendingCallWatcher* requestRunningSyncList(QObject *aParent = nullptr) const;
114
115
127 bool setSyncSchedule(const QString &aProfileId, const SyncSchedule &aSchedule);
128
135 bool saveSyncResults(const QString &aProfileId, const Buteo::SyncResults &aSyncResults);
136
143 bool removeProfile(const QString &aProfileId) const;
144
154 bool updateProfile(const Buteo::SyncProfile &aSyncProfile);
155
161
167 bool isValid() const;
168
173 Buteo::SyncResults getLastSyncResult(const QString &aProfileId);
174
181 QList<QString /*profileAsXml*/> allVisibleSyncProfiles();
182
189 QDBusPendingCallWatcher* requestAllVisibleSyncProfiles(QObject *aParent = nullptr) const;
190
199 QString syncProfile(const QString &aProfileId);
200
210 QStringList syncProfilesByKey(const QString &aKey, const QString &aValue);
211
219 QDBusPendingCallWatcher* requestSyncProfilesByKey(const QString &aKey, const QString &aValue, QObject *aParent = nullptr) const;
220
226 QStringList profilesByType(const QString &aType);
227
235 QDBusPendingCallWatcher* requestProfilesByType(const QString &aProfileId, QObject *aParent = nullptr) const;
236
242 QStringList syncProfilesByType(const QString &aType);
243
251 static QSharedPointer<SyncClientInterface> sharedInstance();
252
253signals:
254
259 void isValidChanged();
260
266 void backupInProgress ();
267
273 void backupDone();
274
280 void restoreInProgress();
281
287 void restoreDone();
288
301 void profileChanged(QString aProfileId, int aChangeType, QString aChangedProfile);
302
310 void resultsAvailable(QString aProfileId, Buteo::SyncResults aResults);
311
335 void syncStatus(QString aProfileId, int aStatus,
336 QString aMessage, int aStatusDetails);
337
352 void transferProgress(QString aProfileId, int aTransferDatabase,
353 int aTransferType, QString aMimeType, int aCommittedItems);
354
355private:
356
358};
359
360
361};
362
363
364#endif
Private implementation class for SyncClientInterface.
Definition SyncClientInterfacePrivate.h:42
SyncInterface Class - Main Entry Point for SyncFW Clients.
Definition SyncClientInterface.h:52
QDBusPendingCallWatcher * requestSyncProfilesByKey(const QString &aKey, const QString &aValue, QObject *aParent=nullptr) const
asynchronous version of syncProfilesByKey().
Definition SyncClientInterface.cpp:137
void transferProgress(QString aProfileId, int aTransferDatabase, int aTransferType, QString aMimeType, int aCommittedItems)
Notifies about progress in transferring items.
Definition moc_SyncClientInterface.cpp:298
QDBusPendingCallWatcher * requestAllVisibleSyncProfiles(QObject *aParent=nullptr) const
asynchronous version of allVisibleSyncProfiles()
Definition SyncClientInterface.cpp:121
void profileChanged(QString aProfileId, int aChangeType, QString aChangedProfile)
Notifies about a change in profile.
Definition moc_SyncClientInterface.cpp:277
void syncStatus(QString aProfileId, int aStatus, QString aMessage, int aStatusDetails)
Notifies about a change in synchronization status.
Definition moc_SyncClientInterface.cpp:291
QStringList profilesByType(const QString &aType)
Gets profiles matching the profile type.
Definition SyncClientInterface.cpp:147
QString syncProfile(const QString &aProfileId)
Gets a sync profile.
Definition SyncClientInterface.cpp:127
QStringList syncProfilesByKey(const QString &aKey, const QString &aValue)
Gets a sync profiles which matches the key-value.
Definition SyncClientInterface.cpp:132
bool updateProfile(const Buteo::SyncProfile &aSyncProfile)
This function should be called when sync profile information has been changed by the client.
Definition SyncClientInterface.cpp:85
SyncClientInterface()
Constructor.
Definition SyncClientInterface.cpp:43
bool removeProfile(const QString &aProfileId) const
This function should be called when sync profile has to be deleted.
Definition SyncClientInterface.cpp:80
QList< QString > allVisibleSyncProfiles()
Gets all visible sync profiles.
Definition SyncClientInterface.cpp:116
QDBusPendingCallWatcher * requestSync(const QString &aProfileId, QObject *aParent=nullptr) const
asynchronous version of startSync()
Definition SyncClientInterface.cpp:60
void isValidChanged()
Notifies when the synchronisation service is available or not.
Definition moc_SyncClientInterface.cpp:247
QDBusPendingCallWatcher * requestRunningSyncList(QObject *aParent=nullptr) const
asynchronous version of getRunningSyncList()
Definition SyncClientInterface.cpp:75
Buteo::SyncResults getLastSyncResult(const QString &aProfileId)
To get lastSyncResult.
Definition SyncClientInterface.cpp:110
bool setSyncSchedule(const QString &aProfileId, const SyncSchedule &aSchedule)
Sets Sync Schedule to the profile.
Definition SyncClientInterface.cpp:90
QStringList syncProfilesByType(const QString &aType)
Gets a profiles matching the profile type.
Definition SyncClientInterface.cpp:142
QDBusPendingCallWatcher * requestProfilesByType(const QString &aProfileId, QObject *aParent=nullptr) const
asynchronous version of profilesByType()
Definition SyncClientInterface.cpp:152
bool getBackUpRestoreState()
This function returns true if backup/restore in progress else false.
Definition SyncClientInterface.cpp:100
~SyncClientInterface()
Destructor.
Definition SyncClientInterface.cpp:49
void restoreDone()
Notifies about Restore Done.
Definition moc_SyncClientInterface.cpp:271
void abortSync(const QString &aProfileId) const
Stops synchronizing the profile with the given Id.
Definition SyncClientInterface.cpp:65
void backupDone()
Notifies about Backup done.
Definition moc_SyncClientInterface.cpp:259
static QSharedPointer< SyncClientInterface > sharedInstance()
creates a process singleton
Definition SyncClientInterface.cpp:31
bool isValid() const
Use this function to understand if the dbus connection to msyncd is working or not.
Definition SyncClientInterface.cpp:105
void backupInProgress()
Notifies about Backup start.
Definition moc_SyncClientInterface.cpp:253
bool saveSyncResults(const QString &aProfileId, const Buteo::SyncResults &aSyncResults)
Save SyncResults to log.xml file.
Definition SyncClientInterface.cpp:95
QStringList getRunningSyncList() const
Gets the list of profile names of currently running syncs.
Definition SyncClientInterface.cpp:70
void restoreInProgress()
Notifies about Restore start.
Definition moc_SyncClientInterface.cpp:265
bool startSync(const QString &aProfileId) const
Requests to starts synchronizing using a profile Id.
Definition SyncClientInterface.cpp:55
void resultsAvailable(QString aProfileId, Buteo::SyncResults aResults)
Notifies about the results of a recent sync for a profile.
Definition moc_SyncClientInterface.cpp:284
A top level synchronization profile.
Definition SyncProfile.h:49
Contains information about a completed synchronization session.
Definition SyncResults.h:62
Class for handling sync schedule settings.
Definition SyncSchedule.h:53
Definition SyncBackupAdaptor.h:40