Ring Daemon
Loading...
Searching...
No Matches
webviewhandler.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 <string>
20
21namespace jami {
22
28{
29public:
30 virtual ~WebViewHandler() {}
31
35 std::string id() const { return id_; }
36
40 virtual void setId(const std::string& id) final { id_ = id; }
41
42 // these functions are called by the client and must be implemented by the plugin
43
47 virtual void pluginWebViewMessage(const std::string& webViewId,
48 const std::string& messageId,
49 const std::string& payload)
50 = 0;
51
56 virtual std::string pluginWebViewAttach(const std::string& accountId,
57 const std::string& webViewId,
58 const std::string& action)
59 = 0;
60
64 virtual void pluginWebViewDetach(const std::string& webViewId) = 0;
65
66private:
67 // the dataPath of the plugin that created this WebViewHandler
68 std::string id_;
69};
70} // 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 jami_signal.h:64