Ring Daemon 16.0.0
Loading...
Searching...
No Matches
plugin_manager_interface.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 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 "jami.h"
20
21#include "def.h"
22
23#include <string>
24#include <vector>
25#include <map>
26#include <list>
27
28#ifdef __APPLE__
29#import "TargetConditionals.h"
30#endif
31
32namespace libjami {
33LIBJAMI_PUBLIC bool loadPlugin(const std::string& path);
34LIBJAMI_PUBLIC bool unloadPlugin(const std::string& path);
35LIBJAMI_PUBLIC std::map<std::string, std::string> getPluginDetails(const std::string& path);
36LIBJAMI_PUBLIC std::vector<std::map<std::string, std::string>> getPluginPreferences(
37 const std::string& path, const std::string& accountId);
38LIBJAMI_PUBLIC bool setPluginPreference(const std::string& path,
39 const std::string& accountId,
40 const std::string& key,
41 const std::string& value);
42LIBJAMI_PUBLIC std::map<std::string, std::string> getPluginPreferencesValues(
43 const std::string& path, const std::string& accountId);
44LIBJAMI_PUBLIC bool resetPluginPreferencesValues(const std::string& path,
45 const std::string& accountId);
46LIBJAMI_PUBLIC std::vector<std::string> getInstalledPlugins();
47LIBJAMI_PUBLIC std::vector<std::string> getLoadedPlugins();
48LIBJAMI_PUBLIC std::map<std::string, std::string> getPlatformInfo();
49LIBJAMI_PUBLIC int installPlugin(const std::string& jplPath, bool force);
50LIBJAMI_PUBLIC int uninstallPlugin(const std::string& pluginRootPath);
51LIBJAMI_PUBLIC std::vector<std::string> getCallMediaHandlers();
52LIBJAMI_PUBLIC std::vector<std::string> getChatHandlers();
53LIBJAMI_PUBLIC void toggleCallMediaHandler(const std::string& mediaHandlerId,
54 const std::string& callId,
55 bool toggle);
56LIBJAMI_PUBLIC void toggleChatHandler(const std::string& chatHandlerId,
57 const std::string& accountId,
58 const std::string& peerId,
59 bool toggle);
60LIBJAMI_PUBLIC std::map<std::string, std::string> getCallMediaHandlerDetails(
61 const std::string& mediaHandlerId);
62LIBJAMI_PUBLIC std::vector<std::string> getCallMediaHandlerStatus(const std::string& callId);
63LIBJAMI_PUBLIC std::map<std::string, std::string> getChatHandlerDetails(
64 const std::string& chatHandlerId);
65LIBJAMI_PUBLIC std::vector<std::string> getChatHandlerStatus(const std::string& accountId,
66 const std::string& peerId);
68LIBJAMI_PUBLIC void setPluginsEnabled(bool state);
69
70LIBJAMI_PUBLIC void sendWebViewMessage(const std::string& pluginId,
71 const std::string& webViewId,
72 const std::string& messageId,
73 const std::string& payload);
74
75LIBJAMI_PUBLIC std::string sendWebViewAttach(const std::string& pluginId,
76 const std::string& accountId,
77 const std::string& webViewId,
78 const std::string& action);
79
80LIBJAMI_PUBLIC void sendWebViewDetach(const std::string& pluginId, const std::string& webViewId);
81
82namespace PluginSignal {
84{
85 constexpr static const char* name = "WebViewMessageReceived";
86 using cb_type = void(const std::string& /*pluginId*/,
87 const std::string& /*webViewId*/,
88 const std::string& /*messageId*/,
89 const std::string& /*payload*/);
90};
91} // namespace PluginSignal
92
93} // 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