Buteo Synchronization Framework: ClientPluginRunner.h Source File

Buteo Synchronization Framework

ClientPluginRunner.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 CLIENTPLUGINRUNNER_H
25#define CLIENTPLUGINRUNNER_H
26
27#include "PluginRunner.h"
28#include <QProcess>
29
30namespace Buteo {
31
32class ClientPlugin;
33class ClientThread;
34class SyncProfile;
35
38 class ClientPluginRunner : public PluginRunner
39{
40 Q_OBJECT
41
42public:
43
54 ClientPluginRunner(const QString &aPluginName, SyncProfile *aProfile,
55 PluginManager *aPluginMgr, PluginCbInterface *aPluginCbIf,
56 QObject *aParent = 0);
57
59 virtual ~ClientPluginRunner();
60
62 virtual bool init();
63
65 virtual bool start();
66
68 virtual void stop();
69
71 virtual void abort(Sync::SyncStatus aStatus = Sync::SYNC_ABORTED);
72
74 virtual SyncResults syncResults();
75
77 virtual SyncPluginBase *plugin();
78
80 virtual bool cleanUp();
81
82private slots:
83
84 // Slots for catching plug-in signals.
85
86 void onTransferProgress(const QString &aProfileName,
87 Sync::TransferDatabase aDatabase, Sync::TransferType aType,
88 const QString &aMimeType, int aCommittedItems);
89
90 void onError(const QString &aProfileName, const QString &aMessage, SyncResults::MinorCode aErrorCode);
91
92 void onSuccess(const QString &aProfileName, const QString &aMessage);
93
94 void onStorageAccquired(const QString &aMimeType);
95
96 void onSyncProgressDetail(const QString &aProfileName, int aProgressDetail);
97
98 // Slot for observing thread exit
99 void onThreadExit();
100
101 void pluginTimeout();
102
103private:
104 SyncProfile *iProfile;
105 ClientPlugin *iPlugin;
106 ClientThread *iThread;
107
108#ifdef SYNCFW_UNIT_TESTS
109 friend class ClientPluginRunnerTest;
110#endif
111
112};
113
114}
115
116#endif // CLIENTPLUGINRUNNER_H
Buteo::ClientPluginRunner
Class for running client sync plug-ins.
Definition: ClientPluginRunner.h:39
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:113
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
Base class for running sync plug-ins.
Definition: PluginRunner.h:45
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:62
Buteo::SyncResults::MinorCode
MinorCode
enum value
Definition: SyncResults.h:89