ServerPluginRunner.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 SERVERPLUGINRUNNER_H
#define SERVERPLUGINRUNNER_H
#include "PluginRunner.h"
namespace Buteo {
class ServerActivator;
class ServerPlugin;
class ServerThread;
class Profile;
class ServerPluginRunner : public PluginRunner
{
Q_OBJECT
public:
ServerPluginRunner(const QString &aPluginName, Profile *aProfile,
PluginManager *aPluginMgr, PluginCbInterface *aPluginCbIf,
ServerActivator *aServerActivator, QObject *aParent = 0);
virtual ~ServerPluginRunner();
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();
// Suspend a server plug-in
void suspend();
// Resume a suspended server plug-in
void resume();
private slots:
// Slots for catching plug-in signals.
void onNewSession(const QString &aDestination);
void onTransferProgress(const QString &aProfileName,
Sync::TransferDatabase aDatabase, Sync::TransferType aType,
const QString &aMimeType, int aCommittedItems);
void onStorageAccquired(const QString &aMimeType );
void onError(const QString &aProfileName, const QString &aMessage, SyncResults::MinorCode aErrorCode);
void onSuccess(const QString &aProfileName, const QString &aMessage);
// Slot for observing thread exit
void onThreadExit();
private:
void onSessionDone();
Profile *iProfile;
ServerPlugin *iPlugin;
ServerThread *iThread;
ServerActivator *iServerActivator;
#ifdef SYNCFW_UNIT_TESTS
friend class ServerPluginRunnerTest;
#endif
};
}
#endif // SERVERPLUGINRUNNER_H
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::Profile
This class represents a single profile, a collection of settings or data releated to some entity.
Definition Profile.h:53
Buteo::ServerActivator
Keeps track of which server plug-ins should be enabled.
Definition ServerActivator.h:48
Buteo::ServerPluginRunner::stop
virtual void stop()
Definition ServerPluginRunner.cpp:134
Buteo::ServerPluginRunner::cleanUp
virtual bool cleanUp()
Definition ServerPluginRunner.cpp:192
Buteo::ServerPluginRunner::plugin
virtual SyncPluginBase * plugin()
Definition ServerPluginRunner.cpp:174
Buteo::ServerPluginRunner::~ServerPluginRunner
virtual ~ServerPluginRunner()
Destructor.
Definition ServerPluginRunner.cpp:45
Buteo::ServerPluginRunner::start
virtual bool start()
Definition ServerPluginRunner.cpp:120
Buteo::ServerPluginRunner::abort
virtual void abort(Sync::SyncStatus aStatus=Sync::SYNC_ABORTED)
Definition ServerPluginRunner.cpp:147
Buteo::ServerPluginRunner::init
virtual bool init()
Definition ServerPluginRunner.cpp:64
Buteo::ServerPluginRunner::ServerPluginRunner
ServerPluginRunner(const QString &aPluginName, Profile *aProfile, PluginManager *aPluginMgr, PluginCbInterface *aPluginCbIf, ServerActivator *aServerActivator, QObject *aParent=0)
Constructor.
Definition ServerPluginRunner.cpp:33
Buteo::ServerPluginRunner::syncResults
virtual SyncResults syncResults()
Definition ServerPluginRunner.cpp:181
Buteo::ServerPlugin
Base class for server plugins.
Definition ServerPlugin.h:37
Buteo::ServerThread
Thread for server plugin.
Definition ServerThread.h:39
Buteo::SyncPluginBase
Base class for client and server plugins.
Definition SyncPluginBase.h:46
Buteo::SyncResults
Contains information about a completed synchronization session.
Definition SyncResults.h:67
Buteo::SyncResults::MinorCode
MinorCode
enum value
Definition SyncResults.h:93