ClientPluginRunner.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 CLIENTPLUGINRUNNER_H
#define CLIENTPLUGINRUNNER_H
#include "PluginRunner.h"
#include <QProcess>
namespace Buteo {
class ClientPlugin;
class ClientThread;
class SyncProfile;
class ClientPluginRunner : public PluginRunner
{
Q_OBJECT
public:
ClientPluginRunner(const QString &aPluginName, SyncProfile *aProfile,
PluginManager *aPluginMgr, PluginCbInterface *aPluginCbIf,
QObject *aParent = 0);
virtual ~ClientPluginRunner();
virtual bool init();
virtual bool start();
virtual void stop();
virtual void abort(Sync::SyncStatus aStatus = Sync::SYNC_ABORTED);
virtual SyncResults syncResults();
virtual SyncPluginBase *plugin();
virtual bool cleanUp();
private slots:
// Slots for catching plug-in signals.
void onTransferProgress(const QString &aProfileName,
Sync::TransferDatabase aDatabase, Sync::TransferType aType,
const QString &aMimeType, int aCommittedItems);
void onError(const QString &aProfileName, const QString &aMessage, SyncResults::MinorCode aErrorCode);
void onSuccess(const QString &aProfileName, const QString &aMessage);
void onStorageAccquired(const QString &aMimeType);
void onSyncProgressDetail(const QString &aProfileName, int aProgressDetail);
// Slot for observing thread exit
void onThreadExit();
void pluginTimeout();
private:
SyncProfile *iProfile;
ClientPlugin *iPlugin;
ClientThread *iThread;
#ifdef SYNCFW_UNIT_TESTS
friend class ClientPluginRunnerTest;
#endif
};
}
#endif // CLIENTPLUGINRUNNER_H
Buteo::ClientPluginRunner::ClientPluginRunner
ClientPluginRunner(const QString &aPluginName, SyncProfile *aProfile, PluginManager *aPluginMgr, PluginCbInterface *aPluginCbIf, QObject *aParent=0)
Constructor.
Definition ClientPluginRunner.cpp:35
Buteo::ClientPluginRunner::stop
virtual void stop()
Definition ClientPluginRunner.cpp:128
Buteo::ClientPluginRunner::abort
virtual void abort(Sync::SyncStatus aStatus=Sync::SYNC_ABORTED)
Definition ClientPluginRunner.cpp:138
Buteo::ClientPluginRunner::plugin
virtual SyncPluginBase * plugin()
Definition ClientPluginRunner.cpp:147
Buteo::ClientPluginRunner::~ClientPluginRunner
virtual ~ClientPluginRunner()
Destructor.
Definition ClientPluginRunner.cpp:46
Buteo::ClientPluginRunner::syncResults
virtual SyncResults syncResults()
Definition ClientPluginRunner.cpp:154
Buteo::ClientPluginRunner::cleanUp
virtual bool cleanUp()
Definition ClientPluginRunner.cpp:165
Buteo::ClientPluginRunner::init
virtual bool init()
Definition ClientPluginRunner.cpp:62
Buteo::ClientPluginRunner::start
virtual bool start()
Definition ClientPluginRunner.cpp:112
Buteo::ClientPlugin
Base class for client plugins.
Definition ClientPlugin.h:38
Buteo::ClientThread
Thread for client plugins.
Definition ClientThread.h:41
Buteo::PluginCbInterface
Interface which client and server plugins can use to communicate with synchronization daemon.
Definition PluginCbInterface.h:39
Buteo::PluginManager
Manages plugins.
Definition PluginManager.h:56
Buteo::PluginRunner::PluginRunner
PluginRunner(PluginType aPluginType, const QString &aPluginName, PluginManager *aPluginMgr, PluginCbInterface *aPluginCbIf, QObject *aParent=0)
Constructor.
Definition PluginRunner.cpp:30
Buteo::SyncPluginBase
Base class for client and server plugins.
Definition SyncPluginBase.h:46
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::SyncResults::MinorCode
MinorCode
enum value
Definition SyncResults.h:93