OOPClientPlugin.h
/*
* This file is part of buteo-sync-plugins package
*
* Copyright (C) 2013 Jolla Ltd.
*
* Author: Sateesh Kavuri <sateesh.kavuri@gmail.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 OOPCLIENTPLUGIN_H
#define OOPCLIENTPLUGIN_H
#include <ClientPlugin.h>
#include <QProcess>
namespace Buteo {
class OOPClientPlugin : public ClientPlugin
{
Q_OBJECT
public:
OOPClientPlugin(const QString &aPluginName,
const Buteo::SyncProfile &aProfile,
Buteo::PluginCbInterface *aCbInterface,
QProcess &aProcess);
virtual ~OOPClientPlugin();
virtual bool init();
virtual bool uninit();
virtual bool startSync();
virtual void abortSync(Sync::SyncStatus aStatus = Sync::SYNC_ABORTED);
virtual Buteo::SyncResults getSyncResults() const;
virtual bool cleanUp();
public slots:
virtual void connectivityStateChanged(Sync::ConnectivityType aType,
bool aState);
void onProcessError(QProcess::ProcessError error);
void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
void onError(QString aProfileName, QString aMessage, int aErrorCode);
void onSuccess(QString aProfileName, QString aMessage);
private:
bool iDone;
};
}
#endif // OOPCLIENTPLUGIN_H
Buteo::ClientPlugin::ClientPlugin
ClientPlugin(const QString &aPluginName, const SyncProfile &aProfile, PluginCbInterface *aCbInterface)
Constructor.
Definition ClientPlugin.cpp:28
Buteo::OOPClientPlugin::cleanUp
virtual bool cleanUp()
Cleans up any sync related stuff (e.g sync anchors etc) when the profile is deleted.
Definition OOPClientPlugin.cpp:139
Buteo::OOPClientPlugin::startSync
virtual bool startSync()
Starts synchronization.
Definition OOPClientPlugin.cpp:115
Buteo::OOPClientPlugin::uninit
virtual bool uninit()
Uninitializes the plugin.
Definition OOPClientPlugin.cpp:101
Buteo::OOPClientPlugin::abortSync
virtual void abortSync(Sync::SyncStatus aStatus=Sync::SYNC_ABORTED)
Aborts synchronization.
Definition OOPClientPlugin.cpp:129
Buteo::OOPClientPlugin::init
virtual bool init()
Initializes the plugin.
Definition OOPClientPlugin.cpp:87
Buteo::OOPClientPlugin::getSyncResults
virtual Buteo::SyncResults getSyncResults() const
Gets the results of the last completed sync session.
Definition OOPClientPlugin.cpp:153
Buteo::PluginCbInterface
Interface which client and server plugins can use to communicate with synchronization daemon.
Definition PluginCbInterface.h:39
Buteo::SyncPluginBase::error
void error(const QString &aProfileName, const QString &aMessage, SyncResults::MinorCode aErrorCode)
Emitted when error has occurred in synchronization and it cannot be continued.
Buteo::SyncProfile
A top level synchronization profile.
Definition SyncProfile.h:49
Buteo::SyncResults
Contains information about a completed synchronization session.
Definition SyncResults.h:67