KiCad PCB EDA Suite
Loading...
Searching...
No Matches
API_PLUGIN Class Reference

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)
 
 ~API_PLUGIN ()
 
bool IsOk () const
 
const wxString & Identifier () const
 
const wxString & Name () const
 
const wxString & Description () const
 
const PLUGIN_RUNTIMERuntime () const
 
wxString BasePath () const
 
const std::vector< PLUGIN_ACTION > & Actions () const
 
wxString ActionSettingsKey (const PLUGIN_ACTION &aAction) const
 

Private Member Functions

std::optional< PLUGIN_ACTIONcreateActionFromJson (const nlohmann::json &aJson)
 

Private Attributes

wxFileName m_configFile
 
std::unique_ptr< API_PLUGIN_CONFIGm_config
 

Friends

struct API_PLUGIN_CONFIG
 

Detailed Description

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 104 of file api_plugin.h.

Constructor & Destructor Documentation

◆ API_PLUGIN()

API_PLUGIN::API_PLUGIN ( const wxFileName &  aConfigFile)

Definition at line 157 of file api_plugin.cpp.

◆ ~API_PLUGIN()

API_PLUGIN::~API_PLUGIN ( )

Definition at line 164 of file api_plugin.cpp.

Member Function Documentation

◆ Actions()

const std::vector< PLUGIN_ACTION > & API_PLUGIN::Actions ( ) const

Definition at line 199 of file api_plugin.cpp.

References m_config.

◆ ActionSettingsKey()

wxString API_PLUGIN::ActionSettingsKey ( const PLUGIN_ACTION aAction) const

Definition at line 211 of file api_plugin.cpp.

References PLUGIN_ACTION::identifier, and Identifier().

◆ BasePath()

wxString API_PLUGIN::BasePath ( ) const

◆ createActionFromJson()

◆ Description()

const wxString & API_PLUGIN::Description ( ) const

Definition at line 187 of file api_plugin.cpp.

References m_config.

◆ Identifier()

const wxString & API_PLUGIN::Identifier ( ) const

◆ IsOk()

bool API_PLUGIN::IsOk ( ) const

Definition at line 169 of file api_plugin.cpp.

References m_config.

◆ Name()

const wxString & API_PLUGIN::Name ( ) const

Definition at line 181 of file api_plugin.cpp.

References m_config.

◆ Runtime()

const PLUGIN_RUNTIME & API_PLUGIN::Runtime ( ) const

Definition at line 193 of file api_plugin.cpp.

References m_config.

Referenced by API_PLUGIN_MANAGER::InvokeAction().

Friends And Related Function Documentation

◆ API_PLUGIN_CONFIG

friend struct API_PLUGIN_CONFIG
friend

Definition at line 124 of file api_plugin.h.

Member Data Documentation

◆ m_config

std::unique_ptr<API_PLUGIN_CONFIG> API_PLUGIN::m_config
private

Definition at line 130 of file api_plugin.h.

Referenced by Actions(), Description(), Identifier(), IsOk(), Name(), and Runtime().

◆ m_configFile

wxFileName API_PLUGIN::m_configFile
private

Definition at line 128 of file api_plugin.h.

Referenced by BasePath(), and createActionFromJson().


The documentation for this class was generated from the following files: