ButeoSynchronizationFramework
OOPServerPlugin.h
1 /*
2 * This file is part of buteo-sync-plugins package
3 *
4 * Copyright (C) 2013 Jolla Ltd. and/or its subsidiary(-ies).
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 
28 namespace Buteo {
30 {
31  Q_OBJECT
32 
33 public:
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 
43  virtual bool uninit();
44 
45  virtual bool startListen();
46 
47  virtual void stopListen();
48 
49  virtual void suspend();
50 
51  virtual void resume();
52 
53  virtual bool cleanUp();
54 
55 public slots:
56 
57  virtual void connectivityStateChanged( Sync::ConnectivityType aType,
58  bool aState );
59  void onProcessError(QProcess::ProcessError error);
60 
61  void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
62 
63  void onError(QString aProfileName, QString aMessage, int aErrorCode);
64 
65  void onSuccess(QString aProfileName, QString aMessage);
66 
67 private:
68  bool iDone;
69 };
70 
71 }
72 #endif // OOPSERVERPLUGIN_H
This class represents a single profile, a collection of settings or data releated to some entity...
Definition: Profile.h:52
virtual void resume()
Resume suspended activity.
Definition: OOPServerPlugin.cpp:153
Definition: AccountsHelper.h:31
Definition: OOPServerPlugin.h:29
virtual bool startListen()
Start listening for sync requests.
Definition: OOPServerPlugin.cpp:119
virtual bool init()
Initializes the plugin.
Definition: OOPServerPlugin.cpp:91
Base class for server plugins.
Definition: ServerPlugin.h:36
virtual void suspend()
Suspend activity.
Definition: OOPServerPlugin.cpp:143
virtual bool cleanUp()
Cleans up any sync related stuff (e.g sync anchors etc) when the profile is deleted.
Definition: OOPServerPlugin.cpp:163
virtual void stopListen()
Stop listening for sync requests.
Definition: OOPServerPlugin.cpp:133
Interface which client and server plugins can use to communicate with synchronization daemon...
Definition: PluginCbInterface.h:38
void error(const QString &aProfileName, const QString &aMessage, int aErrorCode)
Emitted when error has occurred in synchronization and it cannot be continued.
Definition: moc_SyncPluginBase.cpp:215
virtual bool uninit()
Uninitializes the plugin.
Definition: OOPServerPlugin.cpp:105