ButeoSynchronizationFramework
OOPClientPlugin.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 OOPCLIENTPLUGIN_H
23 #define OOPCLIENTPLUGIN_H
24 
25 #include <ClientPlugin.h>
26 #include <QProcess>
27 
28 namespace Buteo {
29 
31 {
32  Q_OBJECT
33 
34 public:
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 
44  virtual bool uninit();
45 
46  virtual bool startSync();
47 
48  virtual void abortSync(Sync::SyncStatus aStatus = Sync::SYNC_ABORTED);
49 
50  virtual Buteo::SyncResults getSyncResults() const;
51 
52  virtual bool cleanUp();
53 
54 public slots:
55 
56  virtual void connectivityStateChanged(Sync::ConnectivityType aType,
57  bool aState);
58 
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 
73 #endif // OOPCLIENTPLUGIN_H
virtual bool startSync()
Starts synchronization.
Definition: OOPClientPlugin.cpp:120
virtual Buteo::SyncResults getSyncResults() const
Gets the results of the last completed sync session.
Definition: OOPClientPlugin.cpp:158
virtual void abortSync(Sync::SyncStatus aStatus=Sync::SYNC_ABORTED)
Aborts synchronization.
Definition: OOPClientPlugin.cpp:134
Contains information about a completed synchronization session.
Definition: SyncResults.h:58
Definition: AccountsHelper.h:31
virtual bool init()
Initializes the plugin.
Definition: OOPClientPlugin.cpp:93
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: OOPClientPlugin.cpp:106
A top level synchronization profile.
Definition: SyncProfile.h:47
virtual bool cleanUp()
Cleans up any sync related stuff (e.g sync anchors etc) when the profile is deleted.
Definition: OOPClientPlugin.cpp:144
Base class for client plugins.
Definition: ClientPlugin.h:37
Definition: OOPClientPlugin.h:30