OOPServerPlugin.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 OOPSERVERPLUGIN_H
#define OOPSERVERPLUGIN_H
#include <ServerPlugin.h>
#include <QProcess>
namespace Buteo {
class OOPServerPlugin : public ServerPlugin
{
Q_OBJECT
public:
OOPServerPlugin(const QString &aPluginName,
const Profile &aProfile,
PluginCbInterface *aCbInterface,
QProcess &process);
virtual ~OOPServerPlugin();
virtual bool init();
virtual bool uninit();
virtual bool startListen();
virtual void stopListen();
virtual void suspend();
virtual void resume();
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 // OOPSERVERPLUGIN_H
Buteo::OOPServerPlugin::uninit
virtual bool uninit()
Uninitializes the plugin.
Definition OOPServerPlugin.cpp:98
Buteo::OOPServerPlugin::resume
virtual void resume()
Resume suspended activity.
Definition OOPServerPlugin.cpp:146
Buteo::OOPServerPlugin::suspend
virtual void suspend()
Suspend activity.
Definition OOPServerPlugin.cpp:136
Buteo::OOPServerPlugin::cleanUp
virtual bool cleanUp()
Cleans up any sync related stuff (e.g sync anchors etc) when the profile is deleted.
Definition OOPServerPlugin.cpp:156
Buteo::OOPServerPlugin::stopListen
virtual void stopListen()
Stop listening for sync requests.
Definition OOPServerPlugin.cpp:126
Buteo::OOPServerPlugin::startListen
virtual bool startListen()
Start listening for sync requests.
Definition OOPServerPlugin.cpp:112
Buteo::OOPServerPlugin::init
virtual bool init()
Initializes the plugin.
Definition OOPServerPlugin.cpp:84
Buteo::PluginCbInterface
Interface which client and server plugins can use to communicate with synchronization daemon.
Definition PluginCbInterface.h:39
Buteo::Profile
This class represents a single profile, a collection of settings or data releated to some entity.
Definition Profile.h:53
Buteo::ServerPlugin::ServerPlugin
ServerPlugin(const QString &aPluginName, const Profile &aProfile, PluginCbInterface *aCbInterface)
Constructor.
Definition ServerPlugin.cpp:28
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.