ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
JsonRPCPlugin.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "ecvStdPluginInterface.h"
11 // #include <jcon/json_rpc_tcp_server.h>
12 #include "jsonrpcserver.h"
13 
15 
32 class JsonRPCPlugin : public QObject, public ccStdPluginInterface {
33  Q_OBJECT
35 
36  // Replace "Example" by your plugin name (IID should be unique - let's hope
37  // your plugin name is unique ;) The info.json file provides information
38  // about the plugin to the loading system and it is displayed in the plugin
39  // information dialog.
40  Q_PLUGIN_METADATA(IID "ecvcorp.cloudviewer.plugin.JsonRPC" FILE
41  "../info.json")
42 
43 public:
44  explicit JsonRPCPlugin(QObject *parent = nullptr);
45  ~JsonRPCPlugin() override = default;
46 
47  // Inherited from ccStdPluginInterface
48  QList<QAction *> getActions() override;
49 public slots:
50  void triggered(bool checked);
51  JsonRPCResult execute(QString method, QMap<QString, QVariant> params);
52 
53 private:
55 
59  QAction *m_action{nullptr};
60 
61 protected:
62  // jcon::JsonRpcTcpServer rpc_server;
63  // QTcpServer rpc_server;
64  // QWebSocketServer wsrpc_server(QStringLiteral("ACloudViewer"),
65  // QWebSocketServer::NonSecureMode);
67 };
#define slots
cmdLineReadable * params[]
Example qCC plugin.
Definition: JsonRPCPlugin.h:32
JsonRPCResult execute(QString method, QMap< QString, QVariant > params)
void triggered(bool checked)
JsonRPCServer rpc_server
Definition: JsonRPCPlugin.h:66
Standard ECV plugin interface.
Standard ECV plugin interface.