Created dbus interfaces for base plugin, client and server

The idea of creating out of process plugins is to create separate
processes for each plugin and use dbus to enable communication between
the plugins and msyncd. For this, the main interface methods for Plugins
are converted into dbus interfaces.

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Created OOPPluginManager and the OOPClientPlugin and OOPServerPlugin

The OOPPluginManager is inherited from PluginManager to ensure the
side-by-side compatibality of in-process and out of process plugins.
Also, since the plugins are going to be out of process, the
OOPClientPlugin and OOPServerPlugin are going to act as d-bus interface
interaction instances to deal with the plugin processes. Next, the
methods in PluginManager have to be implemented to start process plugins

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Modified the design. Removed OOPPluginManager

Realised that the PluginManager can handle both the dll plugins and the
OOP plugins. Added two maps for client and server oop plugins. These
maps can be used to keep track of the started/stopped processes

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Added functionality to start, stop a client process plugin

Added functionality in the PluginManager to start and stop process
plugins. Did not want to modify PluginManager to a QObject unless and
until required. So made use of the waitForStarted() and
waitForFinished() methods to block the process startup, shutdown.

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Created OOPClientPlugin and OOPServerPlugin implementation templates

The OOPClientPlugin and OOPServerPlugin instances using dbus to interact
with the process plugins that have been started by PluginManager. All
the signals/slots that are triggered because of the plugins or the
framework are handled by these classes and they inturn
marshall the messages and send them to the process plugins. Similarly,
for the messages received from the process plugins, these classes
unmarshall them and send the appropriate signals

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Created OOPClient and OOPServer plugin objects in PluginManager

The integration of OOP plugin process is complete with the
PluginManager. Now the ClientPluginRunner and ServerPluginRunner will be
able to issue commands to the oop plugins

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Created a plugin dbus interface file for client and server plugins

Removed the earlier separate client and server dbus plugin interfaces
and combined them into one dbus interface file. Generated the stubs and
skeleton for the same

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Added method setPluginParams to set the initial params of a plugin

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Added plugin_main.cpp that can be used by plugins to create binary

The plugin_main.cpp can be linked by plugins to create the needed
binary. Also modified the signature of the PluginServiceObj to include
the plugin name and profile name. The classname of the plugin has to be
set in the .pro file. The files PluginServiceObj.* and plugin_main.cpp
will be used only by plugins

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Generated the stubs and skeletons for the newly added method in xml file

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Completed plugin_main.cpp and also the outer shell for plugins

The plugin_main.cpp, PluginServiceObj.h and PluginServiceObj.cpp files
form a shell around a plugin to perform the communication between msyncd
and the plugin process. The only change that needs to be done in the
plugin code is to add an extra config for generating the exe and to
include the above files in the make. The syncmlclient plugin code has
been modified to prove this mechanism

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Added plugin name and profile name as arguments for starting oop process

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Added separate dir and method for oop plugins

The plugin directory for oop plugins would be
/usr/lib/buteo-plugins-qt5/oopp/. Added a separate method to load the
maps for the client and server plugins (to ensure clean handling of the
maps)

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Added workaround for QProcess::waitForStarted() by checking for state

Directly using QProcess::waitForStarted() bombs with buffer overflow
(https://codereview.qt-project.org/#change,62897). Added a workaround to
check for the state before calling waitForStarted.

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Implemented the client dbus interface that interfaces with the plugin

The OOPClientPlugin implements the client side part of interfacing with
the client oop plugin.

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Added bool as return for init, uninit and cleanUp methods

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Changed the return value of startSync to bool. Fixed bug in plugin ctor

Fixed a bug in plugin object creation and changed the return value of
startSync to bool. Also added a workaround fix of adding a sleep of
200msec since the process state does not seem to be in
QProcess::Starting until then. If 10msec is used, process state is still
wrong. Fixed it to 100msec for now.

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Patch to create the callback class towards msyncd from plugins

This patch enables the callback mechanism from plugins to msyncd. The
daemon has information related to scheduling, storage providers,
connectivity which can be used by the plugins to perform sync actions.
Also increased the sleep in PluginManager for process state to 1sec,
since 200msec does not seem to work. Also added method
isConnectivityAvailable to the dbus methods in msyncd

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Connected the signals emitted from plugins by relaying them to msyncd

The signals emitted from the plugin processes can be relayed over dbus
by connecting the signals to signals. This needs to be done both on the
skeleton and the stun side. With this patch, the synchronization with
the syncml client works. Tested with memotoo.com Removed not needed
methods

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>
Moved the dbus consts and the plugin obj ref to SyncPluginBase

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>