Buteo Synchronization Framework
OOPClientPlugin.h
1/*
2* This file is part of buteo-sync-plugins package
3*
4* Copyright (C) 2013 Jolla Ltd.
5*
6* Author: Sateesh Kavuri <sateesh.kavuri@gmail.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#ifndef OOPCLIENTPLUGIN_H
23#define OOPCLIENTPLUGIN_H
24
25#include <ClientPlugin.h>
26#include <QProcess>
27
28namespace Buteo {
29
31{
32 Q_OBJECT
33
34public:
35 OOPClientPlugin(const QString &aPluginName,
36 const Buteo::SyncProfile &aProfile,
37 Buteo::PluginCbInterface *aCbInterface,
38 QProcess &aProcess);
39
40 virtual ~OOPClientPlugin();
41
42 virtual bool init();
43 virtual bool uninit();
44 virtual bool startSync();
45 virtual void abortSync(Sync::SyncStatus aStatus = Sync::SYNC_ABORTED);
46 virtual Buteo::SyncResults getSyncResults() const;
47 virtual bool cleanUp();
48
49public slots:
50
51 virtual void connectivityStateChanged(Sync::ConnectivityType aType,
52 bool aState);
53
54 void onProcessError(QProcess::ProcessError error);
55
56 void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
57
58 void onError(QString aProfileName, QString aMessage, int aErrorCode);
59
60 void onSuccess(QString aProfileName, QString aMessage);
61
62private:
63 bool iDone;
64};
65
66}
67
68#endif // OOPCLIENTPLUGIN_H
Base class for client plugins.
Definition ClientPlugin.h:38
Definition OOPClientPlugin.h:31
virtual bool cleanUp()
Cleans up any sync related stuff (e.g sync anchors etc) when the profile is deleted.
Definition OOPClientPlugin.cpp:141
virtual bool startSync()
Starts synchronization.
Definition OOPClientPlugin.cpp:117
virtual bool uninit()
Uninitializes the plugin.
Definition OOPClientPlugin.cpp:103
virtual void abortSync(Sync::SyncStatus aStatus=Sync::SYNC_ABORTED)
Aborts synchronization.
Definition OOPClientPlugin.cpp:131
virtual bool init()
Initializes the plugin.
Definition OOPClientPlugin.cpp:90
virtual Buteo::SyncResults getSyncResults() const
Gets the results of the last completed sync session.
Definition OOPClientPlugin.cpp:155
Interface which client and server plugins can use to communicate with synchronization daemon.
Definition PluginCbInterface.h:39
void error(const QString &aProfileName, const QString &aMessage, SyncResults::MinorCode aErrorCode)
Emitted when error has occurred in synchronization and it cannot be continued.
Definition moc_SyncPluginBase.cpp:228
A top level synchronization profile.
Definition SyncProfile.h:49
Contains information about a completed synchronization session.
Definition SyncResults.h:62