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 <Profile.h>
30#include <SyncProfile.h>
31#include <SyncResults.h>
32#include <SyncSchedule.h>
33
34
35namespace Buteo {
36
37class SyncClientInterfacePrivate;
38
49class SyncClientInterface: public QObject
50{
51 Q_OBJECT
52
53public:
58
63
77 bool startSync(const QString &aProfileId) const;
78
87 void abortSync(const QString &aProfileId) const;
88
94 QStringList getRunningSyncList();
95
96
108 bool setSyncSchedule(QString &aProfileId, SyncSchedule &aSchedule);
109
116 bool saveSyncResults(const QString &aProfileId, const Buteo::SyncResults &aSyncResults);
117
124 bool removeProfile(QString &aProfileId);
125
135 bool updateProfile(Buteo::SyncProfile &aSyncProfile);
136
142
148 bool isValid();
149
154 Buteo::SyncResults getLastSyncResult(const QString &aProfileId);
155
162 QList<QString /*profileAsXml*/> allVisibleSyncProfiles();
163
172 QString syncProfile(const QString &aProfileId);
173
183 QStringList syncProfilesByKey(const QString &aKey, const QString &aValue);
184
190 QStringList syncProfilesByType(const QString &aType);
191signals:
192
198 void backupInProgress ();
199
205 void backupDone();
206
212 void restoreInProgress();
213
219 void restoreDone();
220
233 void profileChanged(QString aProfileId, int aChangeType, QString aChangedProfile);
234
242 void resultsAvailable(QString aProfileId, Buteo::SyncResults aResults);
243
267 void syncStatus(QString aProfileId, int aStatus,
268 QString aMessage, int aStatusDetails);
269
284 void transferProgress(QString aProfileId, int aTransferDatabase,
285 int aTransferType, QString aMimeType, int aCommittedItems);
286
287private:
288
290};
291
292
293};
294
295
296#endif
Private implementation class for SyncClientInterface.
Definition SyncClientInterfacePrivate.h:40
SyncInterface Class - Main Entry Point for SyncFW Clients.
Definition SyncClientInterface.h:50
bool isValid()
Use this function to understand if the creation of dbus connection to msyncd succeeded or not.
Definition SyncClientInterface.cpp:81
void transferProgress(QString aProfileId, int aTransferDatabase, int aTransferType, QString aMimeType, int aCommittedItems)
Notifies about progress in transferring items.
Definition moc_SyncClientInterface.cpp:280
bool setSyncSchedule(QString &aProfileId, SyncSchedule &aSchedule)
Sets Sync Schedule to the profile.
Definition SyncClientInterface.cpp:66
void profileChanged(QString aProfileId, int aChangeType, QString aChangedProfile)
Notifies about a change in profile.
Definition moc_SyncClientInterface.cpp:259
void syncStatus(QString aProfileId, int aStatus, QString aMessage, int aStatusDetails)
Notifies about a change in synchronization status.
Definition moc_SyncClientInterface.cpp:273
QString syncProfile(const QString &aProfileId)
Gets a sync profile.
Definition SyncClientInterface.cpp:98
QStringList syncProfilesByKey(const QString &aKey, const QString &aValue)
Gets a sync profiles which matches the key-value.
Definition SyncClientInterface.cpp:103
SyncClientInterface()
Constructor.
Definition SyncClientInterface.cpp:29
QList< QString > allVisibleSyncProfiles()
Gets all visible sync profiles.
Definition SyncClientInterface.cpp:92
QStringList getRunningSyncList()
Gets the list of profile names of currently running syncs.
Definition SyncClientInterface.cpp:51
bool removeProfile(QString &aProfileId)
This function should be called when sync profile has to be deleted.
Definition SyncClientInterface.cpp:56
Buteo::SyncResults getLastSyncResult(const QString &aProfileId)
To get lastSyncResult.
Definition SyncClientInterface.cpp:86
QStringList syncProfilesByType(const QString &aType)
Gets a profiles matching the profile type.
Definition SyncClientInterface.cpp:108
bool getBackUpRestoreState()
This function returns true if backup/restore in progress else false.
Definition SyncClientInterface.cpp:76
~SyncClientInterface()
Destructor.
Definition SyncClientInterface.cpp:35
void restoreDone()
Notifies about Restore Done.
Definition moc_SyncClientInterface.cpp:253
void abortSync(const QString &aProfileId) const
Stops synchronizing the profile with the given Id.
Definition SyncClientInterface.cpp:46
bool updateProfile(Buteo::SyncProfile &aSyncProfile)
This function should be called when sync profile information has been changed by the client.
Definition SyncClientInterface.cpp:61
void backupDone()
Notifies about Backup done.
Definition moc_SyncClientInterface.cpp:241
void backupInProgress()
Notifies about Backup start.
Definition moc_SyncClientInterface.cpp:235
bool saveSyncResults(const QString &aProfileId, const Buteo::SyncResults &aSyncResults)
Save SyncResults to log.xml file.
Definition SyncClientInterface.cpp:71
void restoreInProgress()
Notifies about Restore start.
Definition moc_SyncClientInterface.cpp:247
bool startSync(const QString &aProfileId) const
Requests to starts synchronizing using a profile Id.
Definition SyncClientInterface.cpp:41
void resultsAvailable(QString aProfileId, Buteo::SyncResults aResults)
Notifies about the results of a recent sync for a profile.
Definition moc_SyncClientInterface.cpp:266
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