SyncClientInterfacePrivate.h
/*
* This file is part of buteo-syncfw package
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef SYNCCLIENTINTERFACEPRIVATE_H
#define SYNCCLIENTINTERFACEPRIVATE_H
#include <QObject>
#include <QDBusPendingCallWatcher>
#include <QDBusServiceWatcher>
#include "SyncDaemonProxy.h"
#include <SyncProfile.h>
namespace Buteo {
class SyncProfile;
class SyncSchedule;
class SyncResults;
class SyncClientInterface;
class SyncClientInterfacePrivate: public QObject
{
Q_OBJECT
public:
SyncClientInterfacePrivate(SyncClientInterface *aParent);
~SyncClientInterfacePrivate();
bool startSync(const QString &aProfileId) const;
QDBusPendingCallWatcher* requestSync(const QString &aProfileId, QObject *aParent);
void abortSync(const QString &aProfileId) const;
QStringList getRunningSyncList();
QDBusPendingCallWatcher* requestRunningSyncList(QObject *aParent);
bool removeProfile(const QString &aProfileId);
bool updateProfile(const Buteo::SyncProfile &aProfile);
bool getBackUpRestoreState();
bool isValid();
bool setSyncSchedule(const QString &aProfileId, const SyncSchedule &aSchedule);
bool saveSyncResults(const QString &aProfileId, const Buteo::SyncResults &aSyncResults);
Buteo::SyncResults getLastSyncResult(const QString &aProfileId);
QList<QString /*profileAsXml*/> allVisibleSyncProfiles();
QDBusPendingCallWatcher* requestAllVisibleSyncProfiles(QObject *aParent);
QString syncProfile(const QString &aProfileId);
QStringList syncProfilesByKey(const QString &aKey, const QString &aValue);
QDBusPendingCallWatcher* requestSyncProfilesByKey(const QString &aKey, const QString &aValue, QObject *aParent);
QStringList profilesByType(const QString &aType);
QDBusPendingCallWatcher* requestProfilesByType(const QString &aType, QObject *aParent);
QStringList syncProfilesByType(const QString &aType);
public slots:
void slotProfileChanged(QString aProfileId, int aChangeType, QString aChangedProfileAsXml);
void resultsAvailable(QString aProfileId, QString aLastSyncResultAsXml);
signals:
void profileChanged(QString aProfileId, int aChangeType, QString aChangedProfile);
void resultsAvailable(QString aProfileId, Buteo::SyncResults aLastResults);
private:
void onServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner);
SyncDaemonProxy *iSyncDaemon;
QDBusServiceWatcher iServiceWatcher;
Buteo::SyncClientInterface *iParent;
};
};
#endif
Buteo::SyncClientInterfacePrivate::getRunningSyncList
QStringList getRunningSyncList()
function to get Running sync list
Definition SyncClientInterfacePrivate.cpp:128
Buteo::SyncClientInterfacePrivate::profilesByType
QStringList profilesByType(const QString &aType)
Gets profiles matching the profile type.
Definition SyncClientInterfacePrivate.cpp:316
Buteo::SyncClientInterfacePrivate::removeProfile
bool removeProfile(const QString &aProfileId)
function to remove a profile
Definition SyncClientInterfacePrivate.cpp:145
Buteo::SyncClientInterfacePrivate::resultsAvailable
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
Buteo::SyncClientInterfacePrivate::getBackUpRestoreState
bool getBackUpRestoreState()
function to add a profile
Definition SyncClientInterfacePrivate.cpp:215
Buteo::SyncClientInterfacePrivate::SyncClientInterfacePrivate
SyncClientInterfacePrivate(SyncClientInterface *aParent)
Constructor.
Definition SyncClientInterfacePrivate.cpp:39
Buteo::SyncClientInterfacePrivate::profileChanged
void profileChanged(QString aProfileId, int aChangeType, QString aChangedProfile)
Signal that gets emitted on receiving profileChanged from msyncd.
Buteo::SyncClientInterfacePrivate::setSyncSchedule
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
Buteo::SyncClientInterfacePrivate::slotProfileChanged
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
Buteo::SyncClientInterfacePrivate::allVisibleSyncProfiles
QList< QString > allVisibleSyncProfiles()
Gets all visible sync profiles.
Definition SyncClientInterfacePrivate.cpp:249
Buteo::SyncClientInterfacePrivate::startSync
bool startSync(const QString &aProfileId) const
function to start the sync
Definition SyncClientInterfacePrivate.cpp:101
Buteo::SyncClientInterfacePrivate::isValid
bool isValid()
function to check if the interface is valid
Definition SyncClientInterfacePrivate.cpp:225
Buteo::SyncClientInterfacePrivate::saveSyncResults
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
Buteo::SyncClientInterfacePrivate::updateProfile
bool updateProfile(const Buteo::SyncProfile &aProfile)
function to update an existing profile
Definition SyncClientInterfacePrivate.cpp:155
Buteo::SyncClientInterfacePrivate::syncProfilesByKey
QStringList syncProfilesByKey(const QString &aKey, const QString &aValue)
Gets a sync profiles which matches the key-value.
Definition SyncClientInterfacePrivate.cpp:285
Buteo::SyncClientInterfacePrivate::syncProfile
QString syncProfile(const QString &aProfileId)
Gets a sync profile.
Definition SyncClientInterfacePrivate.cpp:272
Buteo::SyncClientInterfacePrivate::syncProfilesByType
QStringList syncProfilesByType(const QString &aType)
Gets a profiles matching the profile type.
Definition SyncClientInterfacePrivate.cpp:304
Buteo::SyncClientInterfacePrivate::getLastSyncResult
Buteo::SyncResults getLastSyncResult(const QString &aProfileId)
To get lastSyncResult.
Definition SyncClientInterfacePrivate.cpp:230
Buteo::SyncClientInterfacePrivate::abortSync
void abortSync(const QString &aProfileId) const
function to abort the sync
Definition SyncClientInterfacePrivate.cpp:120
Buteo::SyncClientInterfacePrivate::~SyncClientInterfacePrivate
~SyncClientInterfacePrivate()
Destructor.
Definition SyncClientInterfacePrivate.cpp:85
Buteo::SyncClientInterfacePrivate::resultsAvailable
void resultsAvailable(QString aProfileId, Buteo::SyncResults aLastResults)
Signal that gets emitted on receiving resultsAvailable from msyncd.
Buteo::SyncClientInterface
SyncInterface Class - Main Entry Point for SyncFW Clients.
Definition SyncClientInterface.h:52
Buteo::SyncProfile
A top level synchronization profile.
Definition SyncProfile.h:49
Buteo::SyncResults
Contains information about a completed synchronization session.
Definition SyncResults.h:67
Buteo::SyncSchedule
Class for handling sync schedule settings.
Definition SyncSchedule.h:53
QList
Definition SyncBackupAdaptor.h:40
SyncDaemonProxy
Proxy class for interface com.meego.msyncd.
Definition SyncDaemonProxy.h:49