24#ifndef PANEL_REMOTE_SYMBOL_H
25#define PANEL_REMOTE_SYMBOL_H
33#include <nlohmann/json_fwd.hpp>
34#include <wx/filename.h>
46#define REMOTE_SYMBOL_SESSION_VERSION 1
72 nlohmann::json aParameters = nlohmann::json::object(),
73 std::optional<int> aResponseTo = std::nullopt,
74 const wxString& aStatus = wxS(
"OK" ),
75 const std::string& aData = std::string(),
76 const wxString& aErrorCode = wxEmptyString,
77 const wxString& aErrorMessage = wxEmptyString );
80 const wxString& aErrorCode,
const wxString& aErrorMessage );
84 bool aGlobalTable, wxString& aError )
const;
86 bool aGlobalTable, wxString& aError )
const;
89 bool receiveFootprint(
const nlohmann::json& aParams,
const std::vector<uint8_t>& aPayload,
91 bool receiveSymbol(
const nlohmann::json& aParams,
const std::vector<uint8_t>& aPayload,
93 bool receive3DModel(
const nlohmann::json& aParams,
const std::vector<uint8_t>& aPayload,
95 bool receiveSPICEModel(
const nlohmann::json& aParams,
const std::vector<uint8_t>& aPayload,
103 wxString
jsonString(
const nlohmann::json& aObject,
const char* aKey )
const;
106 std::vector<uint8_t>& aOutPayload,
107 wxString& aError )
const;
110 const std::vector<uint8_t>& aInput,
111 std::vector<uint8_t>& aOutput,
112 wxString& aError )
const;
115 const std::vector<uint8_t>& aData,
116 wxString& aError )
const;
119 const wxString& aLibItemName,
120 wxString& aError )
const;
127 std::shared_ptr<PLUGIN_CONTENT_MANAGER>
m_pcm;
Define a library symbol object.
wxString sanitizeFileComponent(const wxString &aComponent, const wxString &aDefault) const
std::optional< wxString > extractUrlFromJson(const wxString &aJsonContent) const
void sendRpcMessage(const wxString &aCommand, nlohmann::json aParameters=nlohmann::json::object(), std::optional< int > aResponseTo=std::nullopt, const wxString &aStatus=wxS("OK"), const std::string &aData=std::string(), const wxString &aErrorCode=wxEmptyString, const wxString &aErrorMessage=wxEmptyString)
bool receiveSymbol(const nlohmann::json &aParams, const std::vector< uint8_t > &aPayload, wxString &aError)
void onWebViewLoaded(wxWebViewEvent &aEvent)
bool HasDataSources() const
void onKicadMessage(const wxString &aMessage)
wxString sanitizedPrefix() const
void showMessage(const wxString &aMessage)
wxString jsonString(const nlohmann::json &aObject, const char *aKey) const
bool writeBinaryFile(const wxFileName &aFile, const std::vector< uint8_t > &aData, wxString &aError) const
void handleRpcMessage(const nlohmann::json &aMessage)
std::vector< PCM_INSTALLATION_ENTRY > m_dataSources
bool receiveFootprint(const nlohmann::json &aParams, const std::vector< uint8_t > &aPayload, wxString &aError)
bool ensureSymbolLibraryEntry(const wxFileName &aLibraryFile, const wxString &aNickname, bool aGlobalTable, wxString &aError) const
void respondWithError(const wxString &aCommand, int aResponseTo, const wxString &aErrorCode, const wxString &aErrorMessage)
std::optional< wxFileName > findDataSourceJson(const PCM_INSTALLATION_ENTRY &aEntry) const
PANEL_REMOTE_SYMBOL(SCH_EDIT_FRAME *aParent)
wxChoice * m_dataSourceChoice
bool decompressIfNeeded(const std::string &aCompression, const std::vector< uint8_t > &aInput, std::vector< uint8_t > &aOutput, wxString &aError) const
bool decodeBase64Payload(const std::string &aMessage, std::vector< uint8_t > &aOutPayload, wxString &aError) const
void RefreshDataSources()
wxString sanitizeForScript(const std::string &aJson) const
void beginSessionHandshake()
std::unique_ptr< LIB_SYMBOL > loadSymbolFromPayload(const std::vector< uint8_t > &aPayload, const wxString &aLibItemName, wxString &aError) const
void onConfigure(wxCommandEvent &aEvent)
bool ensureDestinationRoot(wxFileName &aOutDir, wxString &aError) const
bool loadDataSource(size_t aIndex)
bool ensureFootprintLibraryEntry(const wxFileName &aLibraryDir, const wxString &aNickname, bool aGlobalTable, wxString &aError) const
bool receiveSPICEModel(const nlohmann::json &aParams, const std::vector< uint8_t > &aPayload, wxString &aError)
BITMAP_BUTTON * m_configButton
std::shared_ptr< PLUGIN_CONTENT_MANAGER > m_pcm
WEBVIEW_PANEL * m_webView
bool receive3DModel(const nlohmann::json &aParams, const std::vector< uint8_t > &aPayload, wxString &aError)
void onDataSourceChanged(wxCommandEvent &aEvent)
bool placeDownloadedSymbol(const wxString &aNickname, const wxString &aLibItemName, wxString &aError)
Schematic editor (Eeschema) main window.