Buteo Synchronization Framework
OOPServerPlugin.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 OOPSERVERPLUGIN_H
23#define OOPSERVERPLUGIN_H
24
25#include <ServerPlugin.h>
26#include <QProcess>
27
28namespace Buteo {
30{
31 Q_OBJECT
32
33public:
34 OOPServerPlugin(const QString &aPluginName,
35 const Profile &aProfile,
36 PluginCbInterface *aCbInterface,
37 QProcess &process);
38
39 virtual ~OOPServerPlugin();
40
41 virtual bool init();
42 virtual bool uninit();
43 virtual bool startListen();
44 virtual void stopListen();
45 virtual void suspend();
46 virtual void resume();
47 virtual bool cleanUp();
48
49public slots:
50 virtual void connectivityStateChanged(Sync::ConnectivityType aType, bool aState);
51
52 void onProcessError(QProcess::ProcessError error);
53
54 void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
55
56 void onError(QString aProfileName, QString aMessage, int aErrorCode);
57
58 void onSuccess(QString aProfileName, QString aMessage);
59
60private:
61 bool iDone;
62};
63
64}
65#endif // OOPSERVERPLUGIN_H
Definition OOPServerPlugin.h:30
virtual bool uninit()
Uninitializes the plugin.
Definition OOPServerPlugin.cpp:102
virtual void resume()
Resume suspended activity.
Definition OOPServerPlugin.cpp:150
virtual void suspend()
Suspend activity.
Definition OOPServerPlugin.cpp:140
virtual bool cleanUp()
Cleans up any sync related stuff (e.g sync anchors etc) when the profile is deleted.
Definition OOPServerPlugin.cpp:160
virtual void stopListen()
Stop listening for sync requests.
Definition OOPServerPlugin.cpp:130
virtual bool startListen()
Start listening for sync requests.
Definition OOPServerPlugin.cpp:116
virtual bool init()
Initializes the plugin.
Definition OOPServerPlugin.cpp:88
Interface which client and server plugins can use to communicate with synchronization daemon.
Definition PluginCbInterface.h:39
This class represents a single profile, a collection of settings or data releated to some entity.
Definition Profile.h:53
Base class for server plugins.
Definition ServerPlugin.h:37
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