Ring Daemon
Loading...
Searching...
No Matches
plugin_manager_interface.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2026 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include "def.h"
20
21#include <string>
22#include <vector>
23#include <map>
24
25#ifdef __APPLE__
26#import "TargetConditionals.h"
27#endif
28
29namespace libjami {
30LIBJAMI_PUBLIC bool loadPlugin(const std::string& path);
31LIBJAMI_PUBLIC bool unloadPlugin(const std::string& path);
32LIBJAMI_PUBLIC std::map<std::string, std::string> getPluginDetails(const std::string& path);
33LIBJAMI_PUBLIC std::vector<std::map<std::string, std::string>> getPluginPreferences(const std::string& path,
34 const std::string& accountId);
35LIBJAMI_PUBLIC bool setPluginPreference(const std::string& path,
36 const std::string& accountId,
37 const std::string& key,
38 const std::string& value);
39LIBJAMI_PUBLIC std::map<std::string, std::string> getPluginPreferencesValues(const std::string& path,
40 const std::string& accountId);
41LIBJAMI_PUBLIC bool resetPluginPreferencesValues(const std::string& path, const std::string& accountId);
42LIBJAMI_PUBLIC std::vector<std::string> getInstalledPlugins();
43LIBJAMI_PUBLIC std::vector<std::string> getLoadedPlugins();
44LIBJAMI_PUBLIC std::map<std::string, std::string> getPlatformInfo();
45LIBJAMI_PUBLIC int installPlugin(const std::string& jplPath, bool force);
46LIBJAMI_PUBLIC int uninstallPlugin(const std::string& pluginRootPath);
47LIBJAMI_PUBLIC std::vector<std::string> getCallMediaHandlers();
48LIBJAMI_PUBLIC std::vector<std::string> getChatHandlers();
49LIBJAMI_PUBLIC void toggleCallMediaHandler(const std::string& mediaHandlerId, const std::string& callId, bool toggle);
50LIBJAMI_PUBLIC void toggleChatHandler(const std::string& chatHandlerId,
51 const std::string& accountId,
52 const std::string& peerId,
53 bool toggle);
54LIBJAMI_PUBLIC std::map<std::string, std::string> getCallMediaHandlerDetails(const std::string& mediaHandlerId);
55LIBJAMI_PUBLIC std::vector<std::string> getCallMediaHandlerStatus(const std::string& callId);
56LIBJAMI_PUBLIC std::map<std::string, std::string> getChatHandlerDetails(const std::string& chatHandlerId);
57LIBJAMI_PUBLIC std::vector<std::string> getChatHandlerStatus(const std::string& accountId, const std::string& peerId);
59LIBJAMI_PUBLIC void setPluginsEnabled(bool state);
60
61LIBJAMI_PUBLIC void sendWebViewMessage(const std::string& pluginId,
62 const std::string& webViewId,
63 const std::string& messageId,
64 const std::string& payload);
65
66LIBJAMI_PUBLIC std::string sendWebViewAttach(const std::string& pluginId,
67 const std::string& accountId,
68 const std::string& webViewId,
69 const std::string& action);
70
71LIBJAMI_PUBLIC void sendWebViewDetach(const std::string& pluginId, const std::string& webViewId);
72
73namespace PluginSignal {
75{
76 constexpr static const char* name = "WebViewMessageReceived";
77 using cb_type = void(const std::string& /*pluginId*/,
78 const std::string& /*webViewId*/,
79 const std::string& /*messageId*/,
80 const std::string& /*payload*/);
81};
82} // namespace PluginSignal
83
84} // namespace libjami
#define LIBJAMI_PUBLIC
Definition def.h:42
void toggleChatHandler(const std::string &chatHandlerId, const std::string &accountId, const std::string &peerId, bool toggle)
void toggleCallMediaHandler(const std::string &mediaHandlerId, const std::string &callId, bool toggle)
void sendWebViewDetach(const std::string &pluginId, const std::string &webViewId)
std::map< std::string, std::string > getPlatformInfo()
std::vector< std::string > getLoadedPlugins()
std::map< std::string, std::string > getCallMediaHandlerDetails(const std::string &mediaHandlerId)
bool unloadPlugin(const std::string &path)
bool setPluginPreference(const std::string &path, const std::string &accountId, const std::string &key, const std::string &value)
void sendWebViewMessage(const std::string &pluginId, const std::string &webViewId, const std::string &messageId, const std::string &payload)
std::vector< std::map< std::string, std::string > > getPluginPreferences(const std::string &path, const std::string &accountId)
std::map< std::string, std::string > getPluginPreferencesValues(const std::string &path, const std::string &accountId)
std::string sendWebViewAttach(const std::string &pluginId, const std::string &accountId, const std::string &webViewId, const std::string &action)
std::map< std::string, std::string > getChatHandlerDetails(const std::string &chatHandlerId)
std::vector< std::string > getChatHandlers()
bool resetPluginPreferencesValues(const std::string &path, const std::string &accountId)
std::map< std::string, std::string > getPluginDetails(const std::string &path)
std::vector< std::string > getCallMediaHandlerStatus(const std::string &callId)
std::vector< std::string > getChatHandlerStatus(const std::string &accountId, const std::string &peerId)
std::vector< std::string > getCallMediaHandlers()
void setPluginsEnabled(bool state)
int installPlugin(const std::string &jplPath, bool force)
int uninstallPlugin(const std::string &pluginRootPath)
bool loadPlugin(const std::string &path)
std::vector< std::string > getInstalledPlugins()
void(const std::string &, const std::string &, const std::string &, const std::string &) cb_type