Buteo Synchronization Framework: ServerPluginRunner.h Source File

Buteo Synchronization Framework

ServerPluginRunner.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 SERVERPLUGINRUNNER_H
25#define SERVERPLUGINRUNNER_H
26
27#include "PluginRunner.h"
28
29namespace Buteo {
30
31
32class ServerActivator;
33class ServerPlugin;
34class ServerThread;
35class Profile;
36
39 class ServerPluginRunner : public PluginRunner
40{
41 Q_OBJECT
42
43public:
44
56 ServerPluginRunner(const QString &aPluginName, Profile *aProfile,
57 PluginManager *aPluginMgr, PluginCbInterface *aPluginCbIf,
58 ServerActivator *aServerActivator, QObject *aParent = 0);
59
61 virtual ~ServerPluginRunner();
62
64 virtual bool init();
65
67 virtual bool start();
68
70 virtual void stop();
71
73 virtual void abort(Sync::SyncStatus aStatus = Sync::SYNC_ABORTED);
74
76 virtual SyncResults syncResults();
77
79 virtual SyncPluginBase *plugin();
80
82 virtual bool cleanUp();
83
84 // Suspend a server plug-in
85 void suspend();
86
87 // Resume a suspended server plug-in
88 void resume();
89
90private slots:
91
92 // Slots for catching plug-in signals.
93
94 void onNewSession(const QString &aDestination);
95
96 void onTransferProgress(const QString &aProfileName,
97 Sync::TransferDatabase aDatabase, Sync::TransferType aType,
98 const QString &aMimeType, int aCommittedItems);
99
100 void onStorageAccquired(const QString &aMimeType );
101 void onError(const QString &aProfileName, const QString &aMessage, SyncResults::MinorCode aErrorCode);
102
103 void onSuccess(const QString &aProfileName, const QString &aMessage);
104
105 // Slot for observing thread exit
106 void onThreadExit();
107
108private:
109
110 void onSessionDone();
111
112 Profile *iProfile;
113 ServerPlugin *iPlugin;
114 ServerThread *iThread;
115 ServerActivator *iServerActivator;
116
117#ifdef SYNCFW_UNIT_TESTS
118 friend class ServerPluginRunnerTest;
119#endif
120
121};
122
123}
124
125#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
Base class for running sync plug-ins.
Definition: PluginRunner.h:45
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
Class for running server sync plug-ins.
Definition: ServerPluginRunner.h:40
Buteo::ServerPluginRunner::stop
virtual void stop()
Definition: ServerPluginRunner.cpp:132
Buteo::ServerPluginRunner::cleanUp
virtual bool cleanUp()
Definition: ServerPluginRunner.cpp:190
Buteo::ServerPluginRunner::plugin
virtual SyncPluginBase * plugin()
Definition: ServerPluginRunner.cpp:172
Buteo::ServerPluginRunner::~ServerPluginRunner
virtual ~ServerPluginRunner()
Destructor.
Definition: ServerPluginRunner.cpp:45
Buteo::ServerPluginRunner::start
virtual bool start()
Definition: ServerPluginRunner.cpp:119
Buteo::ServerPluginRunner::abort
virtual void abort(Sync::SyncStatus aStatus=Sync::SYNC_ABORTED)
Definition: ServerPluginRunner.cpp:145
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:179
Buteo::ServerPlugin
Base class for server plugins.
Definition: ServerPlugin.h:37
Buteo::ServerThread
Thread for server plugin.
Definition: ServerThread.h:38
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:62
Buteo::SyncResults::MinorCode
MinorCode
enum value
Definition: SyncResults.h:89