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
40{
41 Q_OBJECT
42
43public:
55 ServerPluginRunner(const QString &aPluginName, Profile *aProfile,
56 PluginManager *aPluginMgr, PluginCbInterface *aPluginCbIf,
57 ServerActivator *aServerActivator, QObject *aParent = 0);
58
60 virtual ~ServerPluginRunner();
61
63 virtual bool init();
64
66 virtual bool start();
67
69 virtual void stop();
70
72 virtual void abort(Sync::SyncStatus aStatus = Sync::SYNC_ABORTED);
73
75 virtual SyncResults syncResults();
76
78 virtual SyncPluginBase *plugin();
79
81 virtual bool cleanUp();
82
83 // Suspend a server plug-in
84 void suspend();
85
86 // Resume a suspended server plug-in
87 void resume();
88
89private slots:
90 // Slots for catching plug-in signals.
91 void onNewSession(const QString &aDestination);
92 void onTransferProgress(const QString &aProfileName,
93 Sync::TransferDatabase aDatabase, Sync::TransferType aType,
94 const QString &aMimeType, int aCommittedItems);
95 void onStorageAccquired(const QString &aMimeType );
96 void onError(const QString &aProfileName, const QString &aMessage, SyncResults::MinorCode aErrorCode);
97 void onSuccess(const QString &aProfileName, const QString &aMessage);
98
99 // Slot for observing thread exit
100 void onThreadExit();
101
102private:
103 void onSessionDone();
104
105 Profile *iProfile;
106 ServerPlugin *iPlugin;
107 ServerThread *iThread;
108 ServerActivator *iServerActivator;
109
110#ifdef SYNCFW_UNIT_TESTS
111 friend class ServerPluginRunnerTest;
112#endif
113
114};
115
116}
117
118#endif // SERVERPLUGINRUNNER_H
Interface which client and server plugins can use to communicate with synchronization daemon.
Definition PluginCbInterface.h:39
Manages plugins.
Definition PluginManager.h:56
Base class for running sync plug-ins.
Definition PluginRunner.h:45
This class represents a single profile, a collection of settings or data releated to some entity.
Definition Profile.h:53
Keeps track of which server plug-ins should be enabled.
Definition ServerActivator.h:48
Class for running server sync plug-ins.
Definition ServerPluginRunner.h:40
virtual void stop()
Definition ServerPluginRunner.cpp:133
virtual bool cleanUp()
Definition ServerPluginRunner.cpp:191
virtual SyncPluginBase * plugin()
Definition ServerPluginRunner.cpp:173
virtual ~ServerPluginRunner()
Destructor.
Definition ServerPluginRunner.cpp:45
virtual bool start()
Definition ServerPluginRunner.cpp:120
virtual void abort(Sync::SyncStatus aStatus=Sync::SYNC_ABORTED)
Definition ServerPluginRunner.cpp:146
virtual bool init()
Definition ServerPluginRunner.cpp:64
virtual SyncResults syncResults()
Definition ServerPluginRunner.cpp:180
Base class for server plugins.
Definition ServerPlugin.h:37
Thread for server plugin.
Definition ServerThread.h:38
Base class for client and server plugins.
Definition SyncPluginBase.h:46
Contains information about a completed synchronization session.
Definition SyncResults.h:62
MinorCode
enum value
Definition SyncResults.h:89