Buteo Synchronization Framework
SyncClientInterfacePrivate.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 SYNCCLIENTINTERFACEPRIVATE_H
25#define SYNCCLIENTINTERFACEPRIVATE_H
26
27#include <QObject>
28#include <QDBusPendingCallWatcher>
29#include <QDBusServiceWatcher>
30#include "SyncDaemonProxy.h"
31#include <SyncProfile.h>
32
33namespace Buteo {
34
35class SyncProfile;
36class SyncSchedule;
37class SyncResults;
38class SyncClientInterface;
39
41class SyncClientInterfacePrivate: public QObject
42{
43 Q_OBJECT
44public:
50
54
59 bool startSync(const QString &aProfileId) const;
60 QDBusPendingCallWatcher* requestSync(const QString &aProfileId, QObject *aParent);
61
66 void abortSync(const QString &aProfileId) const;
67
72 QStringList getRunningSyncList();
73 QDBusPendingCallWatcher* requestRunningSyncList(QObject *aParent);
74
79 bool removeProfile(const QString &aProfileId);
80
85 bool updateProfile(const Buteo::SyncProfile &aProfile);
86
92
97 bool isValid();
98
110 bool setSyncSchedule(const QString &aProfileId, const SyncSchedule &aSchedule);
111
118 bool saveSyncResults(const QString &aProfileId, const Buteo::SyncResults &aSyncResults);
119
124 Buteo::SyncResults getLastSyncResult(const QString &aProfileId);
125
132 QList<QString /*profileAsXml*/> allVisibleSyncProfiles();
133 QDBusPendingCallWatcher* requestAllVisibleSyncProfiles(QObject *aParent);
134
143 QString syncProfile(const QString &aProfileId);
144
154 QStringList syncProfilesByKey(const QString &aKey, const QString &aValue);
155 QDBusPendingCallWatcher* requestSyncProfilesByKey(const QString &aKey, const QString &aValue, QObject *aParent);
156
162 QStringList profilesByType(const QString &aType);
163 QDBusPendingCallWatcher* requestProfilesByType(const QString &aType, QObject *aParent);
164
170 QStringList syncProfilesByType(const QString &aType);
171
172public slots:
173
198 void slotProfileChanged(QString aProfileId, int aChangeType, QString aChangedProfileAsXml);
199
212 void resultsAvailable(QString aProfileId, QString aLastSyncResultAsXml);
213
214signals:
215
222 void profileChanged(QString aProfileId, int aChangeType, QString aChangedProfile);
223
229 void resultsAvailable(QString aProfileId, Buteo::SyncResults aLastResults);
230
231private:
232 void onServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner);
233
234 SyncDaemonProxy *iSyncDaemon;
235 QDBusServiceWatcher iServiceWatcher;
236
238
239};
240
241
242};
243
244#endif
Private implementation class for SyncClientInterface.
Definition SyncClientInterfacePrivate.h:42
QStringList getRunningSyncList()
function to get Running sync list
Definition SyncClientInterfacePrivate.cpp:128
QStringList profilesByType(const QString &aType)
Gets profiles matching the profile type.
Definition SyncClientInterfacePrivate.cpp:316
bool removeProfile(const QString &aProfileId)
function to remove a profile
Definition SyncClientInterfacePrivate.cpp:145
void resultsAvailable(QString aProfileId, QString aLastSyncResultAsXml)
this is the slot where we will receive the xml data for results from msyncd the xml looks like this
Definition SyncClientInterfacePrivate.cpp:173
bool getBackUpRestoreState()
function to add a profile
Definition SyncClientInterfacePrivate.cpp:215
void profileChanged(QString aProfileId, int aChangeType, QString aChangedProfile)
Signal that gets emitted on receiving profileChanged from msyncd.
Definition moc_SyncClientInterfacePrivate.cpp:173
bool setSyncSchedule(const QString &aProfileId, const SyncSchedule &aSchedule)
this function converts the SyncSchedule object to an xml file of the below format
Definition SyncClientInterfacePrivate.cpp:186
void slotProfileChanged(QString aProfileId, int aChangeType, QString aChangedProfileAsXml)
this is the slot where we will receive the xml data for profile from msyncd. The XML Data received wi...
Definition SyncClientInterfacePrivate.cpp:166
QList< QString > allVisibleSyncProfiles()
Gets all visible sync profiles.
Definition SyncClientInterfacePrivate.cpp:249
bool startSync(const QString &aProfileId) const
function to start the sync
Definition SyncClientInterfacePrivate.cpp:101
bool isValid()
function to check if the interface is valid
Definition SyncClientInterfacePrivate.cpp:225
bool saveSyncResults(const QString &aProfileId, const Buteo::SyncResults &aSyncResults)
this function converts the save the syncResults into log.xml file corresponding to profileName.
Definition SyncClientInterfacePrivate.cpp:201
bool updateProfile(const Buteo::SyncProfile &aProfile)
function to update an existing profile
Definition SyncClientInterfacePrivate.cpp:155
QStringList syncProfilesByKey(const QString &aKey, const QString &aValue)
Gets a sync profiles which matches the key-value.
Definition SyncClientInterfacePrivate.cpp:285
QString syncProfile(const QString &aProfileId)
Gets a sync profile.
Definition SyncClientInterfacePrivate.cpp:272
QStringList syncProfilesByType(const QString &aType)
Gets a profiles matching the profile type.
Definition SyncClientInterfacePrivate.cpp:304
Buteo::SyncResults getLastSyncResult(const QString &aProfileId)
To get lastSyncResult.
Definition SyncClientInterfacePrivate.cpp:230
void abortSync(const QString &aProfileId) const
function to abort the sync
Definition SyncClientInterfacePrivate.cpp:120
~SyncClientInterfacePrivate()
Destructor.
Definition SyncClientInterfacePrivate.cpp:85
SyncInterface Class - Main Entry Point for SyncFW Clients.
Definition SyncClientInterface.h:52
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
Proxy class for interface com.meego.msyncd.
Definition SyncDaemonProxy.h:49