ButeoSynchronizationFramework
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 
35 namespace Buteo {
36 
37 class SyncClientInterfacePrivate;
38 
49 class SyncClientInterface: public QObject
50 {
51  Q_OBJECT
52 
53 public:
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 
141  bool getBackUpRestoreState();
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);
191 signals:
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 
287 private:
288 
290 };
291 
292 
293 };
294 
295 
296 #endif
SyncInterface Class - Main Entry Point for SyncFW Clients.
Definition: SyncClientInterface.h:49
QString syncProfile(const QString &aProfileId)
Gets a sync profile.
Definition: SyncClientInterface.cpp:98
QStringList syncProfilesByType(const QString &aType)
Gets a profiles matching the profile type.
Definition: SyncClientInterface.cpp:108
void resultsAvailable(QString aProfileId, Buteo::SyncResults aResults)
Notifies about the results of a recent sync for a profile.
Definition: moc_SyncClientInterface.cpp:241
Class for handling sync schedule settings.
Definition: SyncSchedule.h:52
void backupInProgress()
Notifies about Backup start.
Definition: moc_SyncClientInterface.cpp:210
bool getBackUpRestoreState()
This function returns true if backup/restore in progress else false.
Definition: SyncClientInterface.cpp:76
~SyncClientInterface()
Destructor.
Definition: SyncClientInterface.cpp:35
QStringList getRunningSyncList()
Gets the list of profile names of currently running syncs.
Definition: SyncClientInterface.cpp:51
Private implementation class for SyncClientInterface.
Definition: SyncClientInterfacePrivate.h:39
Contains information about a completed synchronization session.
Definition: SyncResults.h:58
Definition: AccountsHelper.h:31
Buteo::SyncResults getLastSyncResult(const QString &aProfileId)
To get lastSyncResult.
Definition: SyncClientInterface.cpp:86
void restoreInProgress()
Notifies about Restore start.
Definition: moc_SyncClientInterface.cpp:222
bool startSync(const QString &aProfileId) const
Requests to starts synchronizing using a profile Id.
Definition: SyncClientInterface.cpp:41
void backupDone()
Notifies about Backup done.
Definition: moc_SyncClientInterface.cpp:216
QList< QString > allVisibleSyncProfiles()
Gets all visible sync profiles.
Definition: SyncClientInterface.cpp:92
SyncClientInterface()
Constructor.
Definition: SyncClientInterface.cpp:29
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 syncStatus(QString aProfileId, int aStatus, QString aMessage, int aStatusDetails)
Notifies about a change in synchronization status.
Definition: moc_SyncClientInterface.cpp:248
void restoreDone()
Notifies about Restore Done.
Definition: moc_SyncClientInterface.cpp:228
bool setSyncSchedule(QString &aProfileId, SyncSchedule &aSchedule)
Sets Sync Schedule to the profile.
Definition: SyncClientInterface.cpp:66
bool saveSyncResults(const QString &aProfileId, const Buteo::SyncResults &aSyncResults)
Save SyncResults to log.xml file.
Definition: SyncClientInterface.cpp:71
bool isValid()
Use this function to understand if the creation of dbus connection to msyncd succeeded or not...
Definition: SyncClientInterface.cpp:81
A top level synchronization profile.
Definition: SyncProfile.h:47
bool removeProfile(QString &aProfileId)
This function should be called when sync profile has to be deleted.
Definition: SyncClientInterface.cpp:56
void transferProgress(QString aProfileId, int aTransferDatabase, int aTransferType, QString aMimeType, int aCommittedItems)
Notifies about progress in transferring items.
Definition: moc_SyncClientInterface.cpp:255
QStringList syncProfilesByKey(const QString &aKey, const QString &aValue)
Gets a sync profiles which matches the key-value.
Definition: SyncClientInterface.cpp:103
void profileChanged(QString aProfileId, int aChangeType, QString aChangedProfile)
Notifies about a change in profile.
Definition: moc_SyncClientInterface.cpp:234
Definition: SyncBackupAdaptor.h:40