Ring Daemon 16.0.0
Loading...
Searching...
No Matches
webviewhandler.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 <map>
20#include <string>
21
22namespace jami {
23
29{
30public:
31 virtual ~WebViewHandler() {}
32
36 std::string id() const { return id_; }
37
41 virtual void setId(const std::string& id) final { id_ = id; }
42
43 // these functions are called by the client and must be implemented by the plugin
44
48 virtual void pluginWebViewMessage(const std::string& webViewId,
49 const std::string& messageId,
50 const std::string& payload)
51 = 0;
52
57 virtual std::string pluginWebViewAttach(const std::string& accountId,
58 const std::string& webViewId,
59 const std::string& action)
60 = 0;
61
65 virtual void pluginWebViewDetach(const std::string& webViewId) = 0;
66
67private:
68 // the dataPath of the plugin that created this WebViewHandler
69 std::string id_;
70};
71} // namespace jami
This is an abstract class (API) that needs to be implemented by a plugin.
virtual void setId(const std::string &id) final
Should be called by the WebViewHandler creator to set the plugin's id_ variable.
virtual void pluginWebViewMessage(const std::string &webViewId, const std::string &messageId, const std::string &payload)=0
Called by the daemon whenever the client webview sends a message to the plugin.
virtual void pluginWebViewDetach(const std::string &webViewId)=0
Called by the daemon whenever the client detaches a webview.
std::string id() const
Returns the dataPath of the plugin that created this WebViewHandler.
virtual std::string pluginWebViewAttach(const std::string &accountId, const std::string &webViewId, const std::string &action)=0
Called by the daemon whenever the client attaches a new webview.
void emitSignal(Args... args)
Definition ring_signal.h:64