KiCad PCB EDA Suite
|
A plugin that is invoked by KiCad and runs as an external process; communicating with KiCad via the IPC API. More...
#include <api_plugin.h>
Public Member Functions | |
API_PLUGIN (const wxFileName &aConfigFile, const JSON_SCHEMA_VALIDATOR &aValidator) | |
~API_PLUGIN () | |
bool | IsOk () const |
const wxString & | Identifier () const |
const wxString & | Name () const |
const wxString & | Description () const |
const PLUGIN_RUNTIME & | Runtime () const |
wxString | BasePath () const |
const std::vector< PLUGIN_ACTION > & | Actions () const |
wxString | ActionSettingsKey (const PLUGIN_ACTION &aAction) const |
Static Public Member Functions | |
static bool | IsValidIdentifier (const wxString &aIdentifier) |
Private Member Functions | |
std::optional< PLUGIN_ACTION > | createActionFromJson (const nlohmann::json &aJson) |
Private Attributes | |
wxFileName | m_configFile |
std::unique_ptr< API_PLUGIN_CONFIG > | m_config |
Friends | |
struct | API_PLUGIN_CONFIG |
A plugin that is invoked by KiCad and runs as an external process; communicating with KiCad via the IPC API.
The plugin metadata is read from a JSON file containing things like which actions the plugin is capable of and how to invoke each one.
Definition at line 105 of file api_plugin.h.
API_PLUGIN::API_PLUGIN | ( | const wxFileName & | aConfigFile, |
const JSON_SCHEMA_VALIDATOR & | aValidator | ||
) |
Definition at line 182 of file api_plugin.cpp.
API_PLUGIN::~API_PLUGIN | ( | ) |
Definition at line 189 of file api_plugin.cpp.
const std::vector< PLUGIN_ACTION > & API_PLUGIN::Actions | ( | ) | const |
Definition at line 232 of file api_plugin.cpp.
References m_config.
wxString API_PLUGIN::ActionSettingsKey | ( | const PLUGIN_ACTION & | aAction | ) | const |
Definition at line 244 of file api_plugin.cpp.
References PLUGIN_ACTION::identifier, and Identifier().
wxString API_PLUGIN::BasePath | ( | ) | const |
Definition at line 238 of file api_plugin.cpp.
References m_configFile.
Referenced by API_PLUGIN_MANAGER::InvokeAction(), and API_PLUGIN_MANAGER::RecreatePluginEnvironment().
|
private |
Definition at line 251 of file api_plugin.cpp.
References PLUGIN_ACTION::args, PLUGIN_ACTION::description, PLUGIN_ACTION::entrypoint, PLUGIN_ACTION::icon_dark, PLUGIN_ACTION::icon_light, PLUGIN_ACTION::identifier, m_configFile, PLUGIN_ACTION::name, PLUGIN_ACTION::scopes, PLUGIN_ACTION::show_button, and traceApi.
Referenced by API_PLUGIN_CONFIG::API_PLUGIN_CONFIG().
const wxString & API_PLUGIN::Description | ( | ) | const |
Definition at line 220 of file api_plugin.cpp.
References m_config.
const wxString & API_PLUGIN::Identifier | ( | ) | const |
Definition at line 208 of file api_plugin.cpp.
References m_config.
Referenced by ActionSettingsKey(), API_PLUGIN_MANAGER::InvokeAction(), and API_PLUGIN_MANAGER::RecreatePluginEnvironment().
bool API_PLUGIN::IsOk | ( | ) | const |
Definition at line 194 of file api_plugin.cpp.
References m_config.
|
static |
Definition at line 200 of file api_plugin.cpp.
Referenced by API_PLUGIN_CONFIG::API_PLUGIN_CONFIG(), and API_HANDLER_COMMON::handleGetPluginSettingsPath().
const wxString & API_PLUGIN::Name | ( | ) | const |
Definition at line 214 of file api_plugin.cpp.
References m_config.
const PLUGIN_RUNTIME & API_PLUGIN::Runtime | ( | ) | const |
Definition at line 226 of file api_plugin.cpp.
References m_config.
Referenced by API_PLUGIN_MANAGER::InvokeAction().
|
friend |
Definition at line 127 of file api_plugin.h.
|
private |
Definition at line 133 of file api_plugin.h.
Referenced by Actions(), Description(), Identifier(), IsOk(), Name(), and Runtime().
|
private |
Definition at line 131 of file api_plugin.h.
Referenced by BasePath(), and createActionFromJson().