Buteo Synchronization Framework: SyncClientInterface.h Source File

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