diff --git a/bin/dbus/Makefile.am b/bin/dbus/Makefile.am index 014d9b4d4d587365a3d40339cdf68526535a9344..d03846bb11845dcf5301ca392cc4f92ff3f56314 100644 --- a/bin/dbus/Makefile.am +++ b/bin/dbus/Makefile.am @@ -29,6 +29,11 @@ dbusconfigurationmanager.adaptor.h: cx.ring.Ring.ConfigurationManager.xml Makefi dbusinstance.adaptor.h: cx.ring.Ring.Instance.xml Makefile.am dbusxx-xml2cpp $< --adaptor=$@ +BUILT_SOURCES+=dbuspluginmanagerinterface.adaptor.h +# Rule to generate the binding headers +dbuspluginmanagerinterface.adaptor.h: cx.ring.Ring.PluginManagerInterface.xml Makefile.am + dbusxx-xml2cpp $< --adaptor=$@ + libclient_dbus_la_SOURCES = \ dbuscallmanager.cpp \ dbuscallmanager.h \ @@ -41,6 +46,8 @@ libclient_dbus_la_SOURCES = \ dbus_cpp.h \ dbuspresencemanager.cpp \ dbuspresencemanager.h \ + dbuspluginmanagerinterface.cpp \ + dbuspluginmanagerinterface.h \ $(BUILT_SOURCES) if ENABLE_VIDEO @@ -64,7 +71,8 @@ interfacedir = $(datadir)/dbus-1/interfaces interface_DATA = cx.ring.Ring.CallManager.xml \ cx.ring.Ring.ConfigurationManager.xml \ cx.ring.Ring.Instance.xml \ - cx.ring.Ring.PresenceManager.xml + cx.ring.Ring.PresenceManager.xml \ + cx.ring.Ring.PluginManagerInterface.xml if ENABLE_VIDEO interface_DATA += cx.ring.Ring.VideoManager.xml diff --git a/bin/dbus/cx.ring.Ring.PluginManagerInterface.xml b/bin/dbus/cx.ring.Ring.PluginManagerInterface.xml new file mode 100644 index 0000000000000000000000000000000000000000..c331f8be19bb1c8d2285e33ed437cd30f984bcef --- /dev/null +++ b/bin/dbus/cx.ring.Ring.PluginManagerInterface.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<node name="/cx.ring.Ring.PluginManagerInterface" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + <interface name="cx.ring.Ring.PluginManagerInterface"> + <!-- METHODS !--> + <method name="loadPlugin" tp:name-for-bindings="loadPlugin"> + <tp:added version="0.0.0"/> + <arg type="s" name="path" direction="in"> + </arg> + <arg type="b" name="loaded" direction="out"> + </arg> + </method> + + <method name="unloadPlugin" tp:name-for-bindings="unloadPlugin"> + <tp:added version="0.0.0"/> + <arg type="s" name="path" direction="in"> + </arg> + <arg type="b" name="unloaded" direction="out"> + </arg> + </method> + + <method name="togglePlugin" tp:name-for-bindings="togglePlugin"> + <tp:added version="0.0.0"/> + <arg type="s" name="path" direction="in"> + </arg> + <arg type="b" name="toggle" direction="in"> + </arg> + </method> + + <method name="getPluginDetails" tp:name-for-bindings="getPluginDetails"> + <tp:added version="0.0.0"/> + <arg type="s" name="path" direction="in"> + </arg> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="out" tp:type="String_String_Map"> + </arg> + </method> + + <method name="getPluginPreferences" tp:name-for-bindings="getPluginPreferences"> + <tp:added version="0.0.0"/> + <arg type="s" name="path" direction="in"> + </arg> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="VectorMapStringString"/> + <arg type="aa{ss}" name="PluginPreferences" direction="out" tp:type="String_String_Map"> + </arg> + </method> + + <method name="setPluginPreference" tp:name-for-bindings="setPluginPreference"> + <tp:added version="0.0.0"/> + <arg type="s" name="path" direction="in"> + </arg> + <arg type="s" name="key" direction="in"> + </arg> + <arg type="s" name="value" direction="in"> + </arg> + <arg type="b" name="pluginPreferencesSet" direction="out"> + </arg> + </method> + + <method name="getPluginPreferencesValues" tp:name-for-bindings="getPluginPreferencesValues"> + <tp:added version="0.0.0"/> + <arg type="s" name="path" direction="in"> + </arg> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="preferencesValues" direction="out" tp:type="String_String_Map"> + </arg> + </method> + + <method name="resetPluginPreferencesValues" tp:name-for-bindings="resetPluginPreferencesValues"> + <tp:added version="0.0.0"/> + <arg type="s" name="path" direction="in"> + </arg> + <arg type="b" name="reset" direction="out"> + </arg> + </method> + + <method name="listAvailablePlugins" tp:name-for-bindings="listAvailablePlugins"> + <tp:added version="0.0.0"/> + <arg type="as" name="availablePlugins" direction="out"> + </arg> + </method> + + <method name="listLoadedPlugins" tp:name-for-bindings="listLoadedPlugins"> + <tp:added version="0.0.0"/> + <arg type="as" name="LoadedPlugins" direction="out"> + </arg> + </method> + + <method name="installPlugin" tp:name-for-bindings="installPlugin"> + <tp:added version="0.0.0"/> + <arg type="s" name="jplPath" direction="in"> + </arg> + <arg type="b" name="force" direction="in"> + </arg> + <arg type="i" name="instaled" direction="out"> + </arg> + </method> + + <method name="uninstallPlugin" tp:name-for-bindings="uninstallPlugin"> + <tp:added version="0.0.0"/> + <arg type="s" name="pluginRootPath" direction="in"> + </arg> + <arg type="i" name="uninstaled" direction="out"> + </arg> + </method> + + <method name="listCallMediaHandlers" tp:name-for-bindings="listCallMediaHandlers"> + <tp:added version="0.0.0"/> + <arg type="as" name="listCallMediaHandlers" direction="out"> + </arg> + </method> + + <method name="toggleCallMediaHandler" tp:name-for-bindings="toggleCallMediaHandler"> + <tp:added version="0.0.0"/> + <arg type="s" name="id" direction="in"> + </arg> + <arg type="b" name="toggle" direction="in"> + </arg> + </method> + + <method name="getCallMediaHandlerDetails" tp:name-for-bindings="getCallMediaHandlerDetails"> + <tp:added version="0.0.0"/> + <arg type="s" name="id" direction="in"> + </arg> + <arg type="a{ss}" name="CallMediaHandlerDetails" direction="out"> + </arg> + </method> + </interface> +</node> diff --git a/bin/dbus/dbusclient.cpp b/bin/dbus/dbusclient.cpp index 183fde330cefd027c23598051813c3025793ba8e..7b5a0fdd706204323f0620b3078598369e282394 100644 --- a/bin/dbus/dbusclient.cpp +++ b/bin/dbus/dbusclient.cpp @@ -38,6 +38,9 @@ #include "dbuspresencemanager.h" #include "presencemanager_interface.h" +#include "dbuspluginmanagerinterface.h" +#include "plugin_manager_interface.h" + #include "datatransfer_interface.h" #ifdef ENABLE_VIDEO @@ -84,6 +87,7 @@ DBusClient::DBusClient(int flags, bool persistent) callManager_.reset(new DBusCallManager {sessionConnection}); configurationManager_.reset(new DBusConfigurationManager {sessionConnection}); presenceManager_.reset(new DBusPresenceManager {sessionConnection}); + pluginManagerInterface_.reset(new DBusPluginManagerInterface{sessionConnection}); DBusInstance::OnNoMoreClientFunc onNoMoreClientFunc; if (!persistent) @@ -116,6 +120,7 @@ DBusClient::~DBusClient() presenceManager_.reset(); configurationManager_.reset(); callManager_.reset(); + pluginManagerInterface_.reset(); } int @@ -136,6 +141,7 @@ DBusClient::initLibrary(int flags) auto callM = callManager_.get(); auto confM = configurationManager_.get(); auto presM = presenceManager_.get(); + auto plugM = pluginManagerInterface_.get(); #ifdef ENABLE_VIDEO using DRing::VideoSignal; diff --git a/bin/dbus/dbusclient.h b/bin/dbus/dbusclient.h index b63447bf2625949322f005051dab3f4761e8e176..638cc91a04c7fe0ceb55023e769544c51946a8d8 100644 --- a/bin/dbus/dbusclient.h +++ b/bin/dbus/dbusclient.h @@ -33,6 +33,7 @@ class DBusCallManager; class DBusNetworkManager; class DBusInstance; class DBusPresenceManager; +class DBusPluginManagerInterface; #ifdef ENABLE_VIDEO class DBusVideoManager; @@ -55,13 +56,14 @@ class DRING_PUBLIC DBusClient { int initLibrary(int flags); void finiLibrary() noexcept; - std::unique_ptr<DBus::BusDispatcher> dispatcher_; - std::unique_ptr<DBus::DefaultTimeout> timeout_; + std::unique_ptr<DBus::BusDispatcher> dispatcher_; + std::unique_ptr<DBus::DefaultTimeout> timeout_; - std::unique_ptr<DBusCallManager> callManager_; - std::unique_ptr<DBusConfigurationManager> configurationManager_; - std::unique_ptr<DBusPresenceManager> presenceManager_; - std::unique_ptr<DBusInstance> instanceManager_; + std::unique_ptr<DBusCallManager> callManager_; + std::unique_ptr<DBusConfigurationManager> configurationManager_; + std::unique_ptr<DBusPresenceManager> presenceManager_; + std::unique_ptr<DBusInstance> instanceManager_; + std::unique_ptr<DBusPluginManagerInterface> pluginManagerInterface_; #ifdef ENABLE_VIDEO std::unique_ptr<DBusVideoManager> videoManager_; diff --git a/bin/dbus/dbuspluginmanagerinterface.cpp b/bin/dbus/dbuspluginmanagerinterface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2caa4ea3fe5e54b5b83a60b503143d1bd85eb758 --- /dev/null +++ b/bin/dbus/dbuspluginmanagerinterface.cpp @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2004-2020 Savoir-faire Linux Inc. + * + * Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "dbuspluginmanagerinterface.h" +#include "dring/plugin_manager_interface.h" + +DBusPluginManagerInterface::DBusPluginManagerInterface(DBus::Connection& connection) + : DBus::ObjectAdaptor(connection, "/cx/ring/Ring/PluginManagerInterface") +{} + +bool +DBusPluginManagerInterface::loadPlugin(const std::string& path) +{ + return DRing::loadPlugin(path); +} + +bool +DBusPluginManagerInterface::unloadPlugin(const std::string& path) +{ + return DRing::unloadPlugin(path); +} + +void +DBusPluginManagerInterface::togglePlugin(const std::string& path, const bool& toggle) +{ + DRing::togglePlugin(path, toggle); +} + +std::map<std::string,std::string> +DBusPluginManagerInterface::getPluginDetails(const std::string& path) +{ + return DRing::getPluginDetails(path); +} + +std::vector<std::map<std::string,std::string>> +DBusPluginManagerInterface::getPluginPreferences(const std::string& path) +{ + return DRing::getPluginPreferences(path); +} + +bool +DBusPluginManagerInterface::setPluginPreference(const std::string& path, const std::string& key, const std::string& value) +{ + return DRing::setPluginPreference(path, key, value); +} + +std::map<std::string,std::string> +DBusPluginManagerInterface::getPluginPreferencesValues(const std::string& path) +{ + return DRing::getPluginPreferencesValues(path); +} + +bool +DBusPluginManagerInterface::resetPluginPreferencesValues(const std::string& path) +{ + return DRing::resetPluginPreferencesValues(path); +} + +auto +DBusPluginManagerInterface::listAvailablePlugins() -> decltype(DRing::listAvailablePlugins()) +{ + return DRing::listAvailablePlugins(); +} + +auto +DBusPluginManagerInterface::listLoadedPlugins() -> decltype(DRing::listLoadedPlugins()) +{ + return DRing::listLoadedPlugins(); +} + +int +DBusPluginManagerInterface::installPlugin(const std::string& jplPath, const bool& force) +{ + return DRing::installPlugin(jplPath, force); +} + +int +DBusPluginManagerInterface::uninstallPlugin(const std::string& pluginRootPath) +{ + return DRing::uninstallPlugin(pluginRootPath); +} + +std::vector<std::string> +DBusPluginManagerInterface::listCallMediaHandlers( ) +{ + return DRing::listCallMediaHandlers(); +} + +void +DBusPluginManagerInterface::toggleCallMediaHandler(const std::string& id, const bool& toggle) +{ + DRing::toggleCallMediaHandler(id, toggle); +} + +std::map<std::string,std::string> +DBusPluginManagerInterface::getCallMediaHandlerDetails(const std::string& id) +{ + return DRing::getCallMediaHandlerDetails(id); +} diff --git a/bin/dbus/dbuspluginmanagerinterface.h b/bin/dbus/dbuspluginmanagerinterface.h new file mode 100644 index 0000000000000000000000000000000000000000..38ee599fcf66ae9578e2fc8ec6fef128a620200e --- /dev/null +++ b/bin/dbus/dbuspluginmanagerinterface.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2004-2020 Savoir-faire Linux Inc. + * + * Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include <vector> +#include <map> +#include <string> + +#include "dring/def.h" +#include "dbus_cpp.h" + +#if __GNUC__ >= 5 || (__GNUC__ >=4 && __GNUC_MINOR__ >= 6) +/* This warning option only exists for gcc 4.6.0 and greater. */ +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif + +#pragma GCC diagnostic ignored "-Wignored-qualifiers" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#include "dbuspluginmanagerinterface.adaptor.h" +#pragma GCC diagnostic warning "-Wignored-qualifiers" +#pragma GCC diagnostic warning "-Wunused-parameter" + +#if __GNUC__ >= 5 || (__GNUC__ >=4 && __GNUC_MINOR__ >= 6) +/* This warning option only exists for gcc 4.6.0 and greater. */ +#pragma GCC diagnostic warning "-Wunused-but-set-variable" +#endif + +class DRING_PUBLIC DBusPluginManagerInterface : + public cx::ring::Ring::PluginManagerInterface_adaptor, + public DBus::IntrospectableAdaptor, + public DBus::ObjectAdaptor +{ + public: + DBusPluginManagerInterface(DBus::Connection& connection); + + // Methods + bool loadPlugin(const std::string& path); + bool unloadPlugin(const std::string& path); + void togglePlugin(const std::string& path, const bool& toggle); + std::map<std::string,std::string> getPluginDetails(const std::string& path); + std::vector<std::map<std::string,std::string>> getPluginPreferences(const std::string& path); + bool setPluginPreference(const std::string& path, const std::string& key, const std::string& value); + std::map<std::string,std::string> getPluginPreferencesValues(const std::string& path); + bool resetPluginPreferencesValues(const std::string& path); + std::vector<std::string> listAvailablePlugins(); + std::vector<std::string> listLoadedPlugins(); + int installPlugin(const std::string& jplPath, const bool& force); + int uninstallPlugin(const std::string& pluginRootPath); + std::vector<std::string> listCallMediaHandlers(); + void toggleCallMediaHandler(const std::string& id, const bool& toggle); + std::map<std::string,std::string> getCallMediaHandlerDetails(const std::string& id); +}; diff --git a/bin/jni/plugin_manager_interface.i b/bin/jni/plugin_manager_interface.i index 172d2e87389d966ef7bcb981d3915b0b2c57244c..c9501b8708756864d5c6b318c1ddeff465e92bcd 100644 --- a/bin/jni/plugin_manager_interface.i +++ b/bin/jni/plugin_manager_interface.i @@ -18,6 +18,6 @@ std::vector<std::string> listLoadedPlugins(); int installPlugin(const std::string& jplPath, bool force); int uninstallPlugin(const std::string& pluginRootPath); std::vector<std::string> listCallMediaHandlers(); -void toggleCallMediaHandler(const std::string& id, const bool toggle); +void toggleCallMediaHandler(const std::string& id, bool toggle); std::map<std::string,std::string> getCallMediaHandlerDetails(const std::string& id); } diff --git a/configure.ac b/configure.ac index 10287bc0f3c5053ded95cb1cc4e32c68cf803237..8c8fa89550763c3cfe66861a8cc3c589a7ac351f 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Jami - configure.ac for automake 1.9 and autoconf 2.59 dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.65]) -AC_INIT([Jami Daemon],[9.1.0],[ring@gnu.org],[jami]) +AC_INIT([Jami Daemon],[9.2.0],[ring@gnu.org],[jami]) AC_COPYRIGHT([[Copyright (c) Savoir-faire Linux 2004-2019]]) AC_REVISION([$Revision$]) diff --git a/src/Makefile.am b/src/Makefile.am index 7d6e601f79bd5a1cd7798242611e36d28f851f28..f34394a69367d6ea705b04d9eac1b3e5a6b6af83 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -181,6 +181,7 @@ nobase_include_HEADERS= dring/dring.h \ dring/security_const.h \ dring/callmanager_interface.h \ dring/configurationmanager_interface.h \ + dring/plugin_manager_interface.h \ dring/presencemanager_interface.h \ dring/datatransfer_interface.h \ dring/account_const.h \ diff --git a/src/client/plugin_manager_interface.cpp b/src/client/plugin_manager_interface.cpp index 0f968746a8a7fa6c4b3027141886215dd2b557f6..e9dc053faf2729c266ae6c446e1be30abfd2e117 100644 --- a/src/client/plugin_manager_interface.cpp +++ b/src/client/plugin_manager_interface.cpp @@ -22,74 +22,74 @@ #include "logger.h" #include <iostream> -namespace DRing { -// -bool -loadPlugin(const std::string& path){ - return jami::Manager::instance().getJamiPluginManager().loadPlugin(path); -} +namespace DRing +{ + bool + loadPlugin(const std::string& path){ + return jami::Manager::instance().getJamiPluginManager().loadPlugin(path); + } -bool -unloadPlugin(const std::string& path){ - return jami::Manager::instance().getJamiPluginManager().unloadPlugin(path); -} + bool + unloadPlugin(const std::string& path){ + return jami::Manager::instance().getJamiPluginManager().unloadPlugin(path); + } -void -togglePlugin(const std::string& path, bool toggle){ - jami::Manager::instance().getJamiPluginManager().togglePlugin(path,toggle); -} + void + togglePlugin(const std::string& path, bool toggle){ + jami::Manager::instance().getJamiPluginManager().togglePlugin(path,toggle); + } -std::map<std::string,std::string> -getPluginDetails(const std::string& path){ - return jami::Manager::instance().getJamiPluginManager().getPluginDetails(path); -} + std::map<std::string,std::string> + getPluginDetails(const std::string& path){ + return jami::Manager::instance().getJamiPluginManager().getPluginDetails(path); + } -std::vector<std::map<std::string,std::string>> -getPluginPreferences(const std::string& path){ - return jami::Manager::instance().getJamiPluginManager().getPluginPreferences(path); -} + std::vector<std::map<std::string,std::string>> + getPluginPreferences(const std::string& path){ + return jami::Manager::instance().getJamiPluginManager().getPluginPreferences(path); + } -bool -setPluginPreference(const std::string& path, const std::string& key, const std::string& value) { - return jami::Manager::instance().getJamiPluginManager().setPluginPreference(path, key, value); -} + bool + setPluginPreference(const std::string& path, const std::string& key, const std::string& value) { + return jami::Manager::instance().getJamiPluginManager().setPluginPreference(path, key, value); + } -std::map<std::string,std::string> -getPluginPreferencesValues(const std::string& path){ - return jami::Manager::instance().getJamiPluginManager().getPluginPreferencesValuesMap(path); -} -bool -resetPluginPreferencesValues(const std::string& path){ - return jami::Manager::instance().getJamiPluginManager().resetPluginPreferencesValuesMap(path); -} + std::map<std::string,std::string> + getPluginPreferencesValues(const std::string& path){ + return jami::Manager::instance().getJamiPluginManager().getPluginPreferencesValuesMap(path); + } + bool + resetPluginPreferencesValues(const std::string& path){ + return jami::Manager::instance().getJamiPluginManager().resetPluginPreferencesValuesMap(path); + } -std::vector<std::string> -listAvailablePlugins() { - return jami::Manager::instance().getJamiPluginManager().listAvailablePlugins(); -} + std::vector<std::string> + listAvailablePlugins() { + return jami::Manager::instance().getJamiPluginManager().listAvailablePlugins(); + } -std::vector<std::string> -listLoadedPlugins() { - return jami::Manager::instance().getJamiPluginManager().listLoadedPlugins(); -} + std::vector<std::string> + listLoadedPlugins() { + return jami::Manager::instance().getJamiPluginManager().listLoadedPlugins(); + } -int installPlugin(const std::string& jplPath, bool force) { - return jami::Manager::instance().getJamiPluginManager().installPlugin(jplPath, force); -} + int installPlugin(const std::string& jplPath, bool force) { + return jami::Manager::instance().getJamiPluginManager().installPlugin(jplPath, force); + } -int uninstallPlugin(const std::string& pluginRootPath) { - return jami::Manager::instance().getJamiPluginManager().uninstallPlugin(pluginRootPath); -} + int uninstallPlugin(const std::string& pluginRootPath) { + return jami::Manager::instance().getJamiPluginManager().uninstallPlugin(pluginRootPath); + } -std::vector<std::string> listCallMediaHandlers() { - return jami::Manager::instance().getJamiPluginManager().getCallServicesManager().listCallMediaHandlers(); -} + std::vector<std::string> listCallMediaHandlers() { + return jami::Manager::instance().getJamiPluginManager().getCallServicesManager().listCallMediaHandlers(); + } -void toggleCallMediaHandler(const std::string& id, const bool toggle) { - return jami::Manager::instance().getJamiPluginManager().getCallServicesManager().toggleCallMediaHandler(id, toggle); -} + void toggleCallMediaHandler(const std::string& id, bool toggle) { + return jami::Manager::instance().getJamiPluginManager().getCallServicesManager().toggleCallMediaHandler(id, toggle); + } -std::map<std::string,std::string> getCallMediaHandlerDetails(const std::string& id) { - return jami::Manager::instance().getJamiPluginManager().getCallServicesManager().getCallMediaHandlerDetails(id); -} + std::map<std::string,std::string> getCallMediaHandlerDetails(const std::string& id) { + return jami::Manager::instance().getJamiPluginManager().getCallServicesManager().getCallMediaHandlerDetails(id); + } } diff --git a/src/dring/CMakeLists.txt b/src/dring/CMakeLists.txt index 6576632fc9f99154869c03659090e9dbc5875426..d0badbe31cbd3c4d767728cc3a209e83f05c1e0c 100644 --- a/src/dring/CMakeLists.txt +++ b/src/dring/CMakeLists.txt @@ -5,6 +5,7 @@ list (APPEND Source_Files__dring "${CMAKE_CURRENT_SOURCE_DIR}/account_const.h" "${CMAKE_CURRENT_SOURCE_DIR}/call_const.h" "${CMAKE_CURRENT_SOURCE_DIR}/callmanager_interface.h" + "${CMAKE_CURRENT_SOURCE_DIR}/plugin_manager_interface.h" "${CMAKE_CURRENT_SOURCE_DIR}/configurationmanager_interface.h" "${CMAKE_CURRENT_SOURCE_DIR}/datatransfer_interface.h" "${CMAKE_CURRENT_SOURCE_DIR}/dring.h" diff --git a/src/dring/plugin_manager_interface.h b/src/dring/plugin_manager_interface.h index 7f3779a805a67af7063e3cec8239da777e740598..07283c9905a5cc0a4edaff5493f33dbd1affc5bb 100644 --- a/src/dring/plugin_manager_interface.h +++ b/src/dring/plugin_manager_interface.h @@ -18,27 +18,34 @@ #pragma once +#include "dring.h" + #include "def.h" #include <string> #include <vector> #include <map> -namespace DRing { -DRING_PUBLIC bool loadPlugin(const std::string& path); -DRING_PUBLIC bool unloadPlugin(const std::string& path); -DRING_PUBLIC void togglePlugin(const std::string& path, bool toggle); -DRING_PUBLIC std::map<std::string,std::string> getPluginDetails(const std::string& path); -DRING_PUBLIC std::vector<std::map<std::string,std::string>> getPluginPreferences(const std::string& path); -DRING_PUBLIC bool setPluginPreference(const std::string& path, const std::string& key, const std::string& value); -DRING_PUBLIC std::map<std::string,std::string> getPluginPreferencesValues(const std::string& path); -DRING_PUBLIC bool resetPluginPreferencesValues(const std::string& path); -DRING_PUBLIC std::vector<std::string> listAvailablePlugins(); -DRING_PUBLIC std::vector<std::string> listLoadedPlugins(); -DRING_PUBLIC int installPlugin(const std::string& jplPath, bool force); -DRING_PUBLIC int uninstallPlugin(const std::string& pluginRootPath); -DRING_PUBLIC std::vector<std::string> listCallMediaHandlers(); -DRING_PUBLIC void toggleCallMediaHandler(const std::string& id, const bool toggle); -DRING_PUBLIC std::map<std::string,std::string> getCallMediaHandlerDetails(const std::string& id); +#if __APPLE__ +#import "TargetConditionals.h" +#endif + +namespace DRing +{ + DRING_PUBLIC bool loadPlugin(const std::string& path); + DRING_PUBLIC bool unloadPlugin(const std::string& path); + DRING_PUBLIC void togglePlugin(const std::string& path, bool toggle); + DRING_PUBLIC std::map<std::string,std::string> getPluginDetails(const std::string& path); + DRING_PUBLIC std::vector<std::map<std::string,std::string>> getPluginPreferences(const std::string& path); + DRING_PUBLIC bool setPluginPreference(const std::string& path, const std::string& key, const std::string& value); + DRING_PUBLIC std::map<std::string,std::string> getPluginPreferencesValues(const std::string& path); + DRING_PUBLIC bool resetPluginPreferencesValues(const std::string& path); + DRING_PUBLIC std::vector<std::string> listAvailablePlugins(); + DRING_PUBLIC std::vector<std::string> listLoadedPlugins(); + DRING_PUBLIC int installPlugin(const std::string& jplPath, bool force); + DRING_PUBLIC int uninstallPlugin(const std::string& pluginRootPath); + DRING_PUBLIC std::vector<std::string> listCallMediaHandlers(); + DRING_PUBLIC void toggleCallMediaHandler(const std::string& id, bool toggle); + DRING_PUBLIC std::map<std::string,std::string> getCallMediaHandlerDetails(const std::string& id); } diff --git a/src/manager.cpp b/src/manager.cpp index af3da77be0c40a4dc3009b6b10a08b85eaabb69a..056da8ebb4011d53dd02ba703290a41b62487092 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -3108,8 +3108,8 @@ Manager::sipVoIPLink() const return *pimpl_->sipLink_; } - -JamiPluginManager& Manager::getJamiPluginManager() const +JamiPluginManager& +Manager::getJamiPluginManager() const { return pimpl_->jami_plugin_manager; }