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

#include <api_handler_sch.h>

Inheritance diagram for API_HANDLER_SCH:
API_HANDLER_EDITOR API_HANDLER

Public Member Functions

 API_HANDLER_SCH (SCH_EDIT_FRAME *aFrame)
 
 API_HANDLER_SCH (std::shared_ptr< SCH_CONTEXT > aContext, SCH_EDIT_FRAME *aFrame=nullptr)
 
API_RESULT Handle (ApiRequest &aMsg)
 Attempt to handle the given API request, if a handler exists in this class for the message.
 

Protected Types

typedef std::function< HANDLER_RESULT< ApiResponse >(ApiRequest &)> REQUEST_HANDLER
 A handler for outer messages (envelopes) that will unpack to inner messages and call a specific handler function.
 

Protected Member Functions

std::unique_ptr< COMMITcreateCommit () override
 Override this to create an appropriate COMMIT subclass for the frame in question.
 
kiapi::common::types::DocumentType thisDocumentType () const override
 Override this to specify which document type this editor handles.
 
const EDA_IU_SCALEgetIuScale () const override
 Returns the internal-unit scale that the concrete editor uses.
 
tl::expected< bool, ApiResponseStatus > validateDocumentInternal (const DocumentSpecifier &aDocument) const override
 
std::optional< SCH_ITEM * > getItemById (const KIID &aId, SCH_SHEET_PATH *aPathOut=nullptr) const
 
HANDLER_RESULT< std::unique_ptr< EDA_ITEM > > createItemForType (KICAD_T aType, EDA_ITEM *aContainer)
 
HANDLER_RESULT< types::ItemRequestStatus > handleCreateUpdateItemsInternal (bool aCreate, const std::string &aClientName, const types::ItemHeader &aHeader, const google::protobuf::RepeatedPtrField< google::protobuf::Any > &aItems, std::function< void(commands::ItemStatus, google::protobuf::Any)> aItemHandler) override
 
void deleteItemsInternal (std::map< KIID, ItemDeletionStatus > &aItemsToDelete, const std::string &aClientName) override
 
std::optional< EDA_ITEM * > getItemFromDocument (const DocumentSpecifier &aDocument, const KIID &aId) override
 
std::optional< TITLE_BLOCK * > getTitleBlock () override
 
std::optional< PAGE_INFOgetPageSettings () override
 
bool setPageSettings (const PAGE_INFO &aPageInfo) override
 
wxString getDrawingSheetFileName () override
 
void setDrawingSheetFileName (const wxString &aFileName) override
 
void onModified () override
 
HANDLER_RESULT< std::optional< KIID > > validateItemHeaderDocument (const kiapi::common::types::ItemHeader &aHeader)
 If the header is valid, returns the item container.
 
HANDLER_RESULT< bool > validateDocument (const DocumentSpecifier &aDocument)
 
virtual std::optional< ApiResponseStatus > checkForBusy ()
 Checks if the editor can accept commands.
 
HANDLER_RESULT< commands::BeginCommitResponse > handleBeginCommit (const HANDLER_CONTEXT< commands::BeginCommit > &aCtx)
 
HANDLER_RESULT< commands::EndCommitResponse > handleEndCommit (const HANDLER_CONTEXT< commands::EndCommit > &aCtx)
 
COMMITgetCurrentCommit (const std::string &aClientName)
 
virtual void pushCurrentCommit (const std::string &aClientName, const wxString &aMessage)
 
HANDLER_RESULT< commands::CreateItemsResponse > handleCreateItems (const HANDLER_CONTEXT< commands::CreateItems > &aCtx)
 
HANDLER_RESULT< commands::UpdateItemsResponse > handleUpdateItems (const HANDLER_CONTEXT< commands::UpdateItems > &aCtx)
 
HANDLER_RESULT< commands::DeleteItemsResponse > handleDeleteItems (const HANDLER_CONTEXT< commands::DeleteItems > &aCtx)
 
HANDLER_RESULT< commands::HitTestResponse > handleHitTest (const HANDLER_CONTEXT< commands::HitTest > &aCtx)
 
HANDLER_RESULT< types::TitleBlockInfo > handleGetTitleBlockInfo (const HANDLER_CONTEXT< commands::GetTitleBlockInfo > &aCtx)
 
HANDLER_RESULT< google::protobuf::Empty > handleSetTitleBlockInfo (const HANDLER_CONTEXT< commands::SetTitleBlockInfo > &aCtx)
 
HANDLER_RESULT< types::PageSettings > handleGetPageSettings (const HANDLER_CONTEXT< commands::GetPageSettings > &aCtx)
 
HANDLER_RESULT< types::PageSettings > handleSetPageSettings (const HANDLER_CONTEXT< commands::SetPageSettings > &aCtx)
 
template<class RequestType, class ResponseType, class HandlerType>
void registerHandler (HANDLER_RESULT< ResponseType >(HandlerType::*aHandler)(const HANDLER_CONTEXT< RequestType > &))
 Registers an API command handler for the given message types.
 

Static Protected Member Functions

static std::vector< KICAD_TparseRequestedItemTypes (const google::protobuf::RepeatedField< int > &aTypes)
 

Protected Attributes

std::map< std::string, std::pair< KIID, std::unique_ptr< COMMIT > > > m_commits
 
std::set< std::string > m_activeClients
 
std::map< std::string, REQUEST_HANDLERm_handlers
 Maps type name (without the URL prefix) to a handler method.
 

Static Protected Attributes

static const wxString m_defaultCommitMessage = _( "Modification from API" )
 

Private Member Functions

HANDLER_RESULT< commands::GetOpenDocumentsResponse > handleGetOpenDocuments (const HANDLER_CONTEXT< commands::GetOpenDocuments > &aCtx)
 
HANDLER_RESULT< commands::GetItemsResponse > handleGetItems (const HANDLER_CONTEXT< commands::GetItems > &aCtx)
 
HANDLER_RESULT< commands::GetItemsResponse > handleGetItemsById (const HANDLER_CONTEXT< commands::GetItemsById > &aCtx)
 
HANDLER_RESULT< types::RunJobResponse > handleRunSchematicJobExportSvg (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportSvg > &aCtx)
 
HANDLER_RESULT< types::RunJobResponse > handleRunSchematicJobExportDxf (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportDxf > &aCtx)
 
HANDLER_RESULT< types::RunJobResponse > handleRunSchematicJobExportPdf (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportPdf > &aCtx)
 
HANDLER_RESULT< types::RunJobResponse > handleRunSchematicJobExportPs (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportPs > &aCtx)
 
HANDLER_RESULT< types::RunJobResponse > handleRunSchematicJobExportNetlist (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportNetlist > &aCtx)
 
HANDLER_RESULT< types::RunJobResponse > handleRunSchematicJobExportBOM (const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportBOM > &aCtx)
 
HANDLER_RESULT< kiapi::schematic::types::SchematicHierarchyResponse > handleGetSchematicHierarchy (const HANDLER_CONTEXT< kiapi::schematic::types::GetSchematicHierarchy > &aCtx)
 
void packSheetInstance (kiapi::schematic::types::SheetInstance *aInstance, SCH_SHEET_PATH &aPath, SCH_SHEET *aSheet)
 
HANDLER_RESULT< kiapi::schematic::types::SchematicNetlistResponse > handleGetSchematicNetlist (const HANDLER_CONTEXT< kiapi::schematic::types::GetSchematicNetlist > &aCtx)
 
SCHEMATICschematic () const
 
void filterValidSchTypes (std::set< KICAD_T > &aTypeList)
 
template<typename MessageType>
bool tryUnpack (ApiRequest &aRequest, ApiResponse &aReply, MessageType &aDest)
 

Private Attributes

SCH_EDIT_FRAMEm_frame
 
std::shared_ptr< SCH_CONTEXTm_context
 

Static Private Attributes

static std::set< KICAD_Ts_allowedTypes
 

Detailed Description

Definition at line 39 of file api_handler_sch.h.

Member Typedef Documentation

◆ REQUEST_HANDLER

typedef std::function<HANDLER_RESULT<ApiResponse>( ApiRequest& )> API_HANDLER::REQUEST_HANDLER
protectedinherited

A handler for outer messages (envelopes) that will unpack to inner messages and call a specific handler function.

See also
registerHandler.

Definition at line 76 of file api_handler.h.

Constructor & Destructor Documentation

◆ API_HANDLER_SCH() [1/2]

API_HANDLER_SCH::API_HANDLER_SCH ( SCH_EDIT_FRAME * aFrame)

Definition at line 99 of file api_handler_sch.cpp.

References API_HANDLER_SCH(), and CreateSchFrameContext().

Referenced by API_HANDLER_SCH().

◆ API_HANDLER_SCH() [2/2]

Member Function Documentation

◆ checkForBusy()

std::optional< ApiResponseStatus > API_HANDLER_EDITOR::checkForBusy ( )
protectedvirtualinherited

Checks if the editor can accept commands.

Returns
an error status if busy, std::nullopt if not busy

Definition at line 222 of file api_handler_editor.cpp.

References m_frame.

Referenced by API_HANDLER_PCB::handleAddToSelection(), handleBeginCommit(), API_HANDLER_PCB::handleClearSelection(), handleCreateItems(), handleDeleteItems(), handleEndCommit(), API_HANDLER_PCB::handleGetBoundingBox(), API_HANDLER_PCB::handleGetConnectedItems(), API_HANDLER_PCB::handleGetItems(), API_HANDLER_SCH::handleGetItems(), API_HANDLER_PCB::handleGetItemsById(), API_HANDLER_SCH::handleGetItemsById(), API_HANDLER_PCB::handleGetItemsByNet(), API_HANDLER_PCB::handleGetItemsByNetClass(), API_HANDLER_SCH::handleGetSchematicNetlist(), handleHitTest(), API_HANDLER_PCB::handleInjectDrcError(), API_HANDLER_PCB::handleInteractiveMoveItems(), API_HANDLER_PCB::handleParseAndCreateItemsFromString(), API_HANDLER_PCB::handleRefillZones(), API_HANDLER_PCB::handleRemoveFromSelection(), API_HANDLER_PCB::handleRevertDocument(), API_HANDLER_PCB::handleRunAction(), API_HANDLER_PCB::handleRunBoardJobExport3D(), API_HANDLER_PCB::handleRunBoardJobExportDrill(), API_HANDLER_PCB::handleRunBoardJobExportDxf(), API_HANDLER_PCB::handleRunBoardJobExportGencad(), API_HANDLER_PCB::handleRunBoardJobExportGerbers(), API_HANDLER_PCB::handleRunBoardJobExportIpc2581(), API_HANDLER_PCB::handleRunBoardJobExportIpcD356(), API_HANDLER_PCB::handleRunBoardJobExportODB(), API_HANDLER_PCB::handleRunBoardJobExportPdf(), API_HANDLER_PCB::handleRunBoardJobExportPosition(), API_HANDLER_PCB::handleRunBoardJobExportPs(), API_HANDLER_PCB::handleRunBoardJobExportRender(), API_HANDLER_PCB::handleRunBoardJobExportStats(), API_HANDLER_PCB::handleRunBoardJobExportSvg(), API_HANDLER_SCH::handleRunSchematicJobExportBOM(), API_HANDLER_SCH::handleRunSchematicJobExportDxf(), API_HANDLER_SCH::handleRunSchematicJobExportNetlist(), API_HANDLER_SCH::handleRunSchematicJobExportPdf(), API_HANDLER_SCH::handleRunSchematicJobExportPs(), API_HANDLER_SCH::handleRunSchematicJobExportSvg(), API_HANDLER_PCB::handleSaveCopyOfDocument(), API_HANDLER_PCB::handleSaveDocument(), API_HANDLER_PCB::handleSetActiveLayer(), API_HANDLER_PCB::handleSetBoardEditorAppearanceSettings(), API_HANDLER_PCB::handleSetBoardOrigin(), API_HANDLER_PCB::handleSetVisibleLayers(), and handleUpdateItems().

◆ createCommit()

std::unique_ptr< COMMIT > API_HANDLER_SCH::createCommit ( )
overrideprotectedvirtual

Override this to create an appropriate COMMIT subclass for the frame in question.

Returns
a new COMMIT, bound to the editor frame

Implements API_HANDLER_EDITOR.

Definition at line 138 of file api_handler_sch.cpp.

References m_frame.

◆ createItemForType()

HANDLER_RESULT< std::unique_ptr< EDA_ITEM > > API_HANDLER_SCH::createItemForType ( KICAD_T aType,
EDA_ITEM * aContainer )
protected

◆ deleteItemsInternal()

void API_HANDLER_SCH::deleteItemsInternal ( std::map< KIID, ItemDeletionStatus > & aItemsToDelete,
const std::string & aClientName )
overrideprotectedvirtual

◆ filterValidSchTypes()

void API_HANDLER_SCH::filterValidSchTypes ( std::set< KICAD_T > & aTypeList)
private

Definition at line 244 of file api_handler_sch.cpp.

References s_allowedTypes.

Referenced by handleGetItems().

◆ getCurrentCommit()

◆ getDrawingSheetFileName()

wxString API_HANDLER_SCH::getDrawingSheetFileName ( )
overrideprotectedvirtual

Reimplemented from API_HANDLER_EDITOR.

Definition at line 844 of file api_handler_sch.cpp.

References BASE_SCREEN::m_DrawingSheetFileName.

◆ getItemById()

std::optional< SCH_ITEM * > API_HANDLER_SCH::getItemById ( const KIID & aId,
SCH_SHEET_PATH * aPathOut = nullptr ) const
protected

◆ getItemFromDocument()

std::optional< EDA_ITEM * > API_HANDLER_SCH::getItemFromDocument ( const DocumentSpecifier & aDocument,
const KIID & aId )
overrideprotectedvirtual

◆ getIuScale()

const EDA_IU_SCALE & API_HANDLER_SCH::getIuScale ( ) const
inlineoverrideprotectedvirtual

Returns the internal-unit scale that the concrete editor uses.

API wire coordinates are always in nanometers, so this scale drives conversion to the editor's native IU. Defaults to pcbIUScale; schematic-like editors must override.

Reimplemented from API_HANDLER_EDITOR.

Definition at line 53 of file api_handler_sch.h.

References schIUScale.

◆ getPageSettings()

std::optional< PAGE_INFO > API_HANDLER_SCH::getPageSettings ( )
overrideprotectedvirtual

Reimplemented from API_HANDLER_EDITOR.

Definition at line 829 of file api_handler_sch.cpp.

References m_context.

◆ getTitleBlock()

std::optional< TITLE_BLOCK * > API_HANDLER_SCH::getTitleBlock ( )
overrideprotectedvirtual

Reimplemented from API_HANDLER_EDITOR.

Definition at line 822 of file api_handler_sch.cpp.

References m_context.

◆ Handle()

API_RESULT API_HANDLER::Handle ( ApiRequest & aMsg)
inherited

Attempt to handle the given API request, if a handler exists in this class for the message.

Parameters
aMsgis a request to attempt to handle
Returns
a response to send to the client, or an appropriate error

Definition at line 30 of file api_handler.cpp.

References m_handlers.

◆ handleBeginCommit()

HANDLER_RESULT< BeginCommitResponse > API_HANDLER_EDITOR::handleBeginCommit ( const HANDLER_CONTEXT< commands::BeginCommit > & aCtx)
protectedinherited

◆ handleCreateItems()

HANDLER_RESULT< CreateItemsResponse > API_HANDLER_EDITOR::handleCreateItems ( const HANDLER_CONTEXT< commands::CreateItems > & aCtx)
protectedinherited

◆ handleCreateUpdateItemsInternal()

◆ handleDeleteItems()

HANDLER_RESULT< DeleteItemsResponse > API_HANDLER_EDITOR::handleDeleteItems ( const HANDLER_CONTEXT< commands::DeleteItems > & aCtx)
protectedinherited

◆ handleEndCommit()

HANDLER_RESULT< EndCommitResponse > API_HANDLER_EDITOR::handleEndCommit ( const HANDLER_CONTEXT< commands::EndCommit > & aCtx)
protectedinherited

◆ handleGetItems()

◆ handleGetItemsById()

◆ handleGetOpenDocuments()

HANDLER_RESULT< GetOpenDocumentsResponse > API_HANDLER_SCH::handleGetOpenDocuments ( const HANDLER_CONTEXT< commands::GetOpenDocuments > & aCtx)
private

◆ handleGetPageSettings()

◆ handleGetSchematicHierarchy()

HANDLER_RESULT< kiapi::schematic::types::SchematicHierarchyResponse > API_HANDLER_SCH::handleGetSchematicHierarchy ( const HANDLER_CONTEXT< kiapi::schematic::types::GetSchematicHierarchy > & aCtx)
private

◆ handleGetSchematicNetlist()

◆ handleGetTitleBlockInfo()

HANDLER_RESULT< types::TitleBlockInfo > API_HANDLER_EDITOR::handleGetTitleBlockInfo ( const HANDLER_CONTEXT< commands::GetTitleBlockInfo > & aCtx)
protectedinherited

◆ handleHitTest()

HANDLER_RESULT< HitTestResponse > API_HANDLER_EDITOR::handleHitTest ( const HANDLER_CONTEXT< commands::HitTest > & aCtx)
protectedinherited

◆ handleRunSchematicJobExportBOM()

◆ handleRunSchematicJobExportDxf()

HANDLER_RESULT< types::RunJobResponse > API_HANDLER_SCH::handleRunSchematicJobExportDxf ( const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportDxf > & aCtx)
private

◆ handleRunSchematicJobExportNetlist()

◆ handleRunSchematicJobExportPdf()

HANDLER_RESULT< types::RunJobResponse > API_HANDLER_SCH::handleRunSchematicJobExportPdf ( const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportPdf > & aCtx)
private

◆ handleRunSchematicJobExportPs()

HANDLER_RESULT< types::RunJobResponse > API_HANDLER_SCH::handleRunSchematicJobExportPs ( const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportPs > & aCtx)
private

◆ handleRunSchematicJobExportSvg()

HANDLER_RESULT< types::RunJobResponse > API_HANDLER_SCH::handleRunSchematicJobExportSvg ( const HANDLER_CONTEXT< kiapi::schematic::jobs::RunSchematicJobExportSvg > & aCtx)
private

◆ handleSetPageSettings()

◆ handleSetTitleBlockInfo()

HANDLER_RESULT< google::protobuf::Empty > API_HANDLER_EDITOR::handleSetTitleBlockInfo ( const HANDLER_CONTEXT< commands::SetTitleBlockInfo > & aCtx)
protectedinherited

◆ handleUpdateItems()

HANDLER_RESULT< UpdateItemsResponse > API_HANDLER_EDITOR::handleUpdateItems ( const HANDLER_CONTEXT< commands::UpdateItems > & aCtx)
protectedinherited

◆ onModified()

void API_HANDLER_SCH::onModified ( )
overrideprotectedvirtual

Reimplemented from API_HANDLER_EDITOR.

Definition at line 860 of file api_handler_sch.cpp.

References m_frame.

◆ packSheetInstance()

◆ parseRequestedItemTypes()

std::vector< KICAD_T > API_HANDLER_EDITOR::parseRequestedItemTypes ( const google::protobuf::RepeatedField< int > & aTypes)
staticprotectedinherited

◆ pushCurrentCommit()

void API_HANDLER_EDITOR::pushCurrentCommit ( const std::string & aClientName,
const wxString & aMessage )
protectedvirtualinherited

◆ registerHandler()

template<class RequestType, class ResponseType, class HandlerType>
void API_HANDLER::registerHandler ( HANDLER_RESULT< ResponseType >(HandlerType::* aHandler )(const HANDLER_CONTEXT< RequestType > &))
inlineprotectedinherited

Registers an API command handler for the given message types.

When an API request matching the given type comes in, the handler will be called and its response will be packed into an envelope for sending back to the API client.

If the given message does not unpack into the request type, an envelope is returned with status AS_BAD_REQUEST, which probably indicates corruption in the message.

Template Parameters
RequestTypeis a protobuf message type containing a command
ResponseTypeis a protobuf message type containing a command response
HandlerTypeis the implied type of the API_HANDLER subclass
Parameters
aHandleris the handler function for the given request and response types

Definition at line 93 of file api_handler.h.

References HANDLER_CONTEXT< RequestMessageType >::ClientName, m_handlers, HANDLER_CONTEXT< RequestMessageType >::Request, and tryUnpack().

Referenced by API_HANDLER_COMMON::API_HANDLER_COMMON(), API_HANDLER_EDITOR::API_HANDLER_EDITOR(), API_HANDLER_PCB::API_HANDLER_PCB(), and API_HANDLER_SCH::API_HANDLER_SCH().

◆ schematic()

◆ setDrawingSheetFileName()

void API_HANDLER_SCH::setDrawingSheetFileName ( const wxString & aFileName)
overrideprotectedvirtual

◆ setPageSettings()

bool API_HANDLER_SCH::setPageSettings ( const PAGE_INFO & aPageInfo)
overrideprotectedvirtual

Reimplemented from API_HANDLER_EDITOR.

Definition at line 836 of file api_handler_sch.cpp.

References m_context.

◆ thisDocumentType()

kiapi::common::types::DocumentType API_HANDLER_SCH::thisDocumentType ( ) const
inlineoverrideprotectedvirtual

Override this to specify which document type this editor handles.

Implements API_HANDLER_EDITOR.

Definition at line 48 of file api_handler_sch.h.

◆ tryUnpack()

template<typename MessageType>
bool API_HANDLER::tryUnpack ( ApiRequest & aRequest,
ApiResponse & aReply,
MessageType & aDest )
inlineprivateinherited

Definition at line 136 of file api_handler.h.

Referenced by registerHandler().

◆ validateDocument()

HANDLER_RESULT< bool > API_HANDLER_EDITOR::validateDocument ( const DocumentSpecifier & aDocument)
protectedinherited

Definition at line 178 of file api_handler_editor.cpp.

References validateDocumentInternal().

Referenced by API_HANDLER_PCB::getItemFromDocument(), API_HANDLER_SCH::getItemFromDocument(), API_HANDLER_PCB::handleCheckPadstackPresenceOnLayers(), API_HANDLER_PCB::handleExpandTextVariables(), API_HANDLER_PCB::handleGetActiveLayer(), API_HANDLER_PCB::handleGetBoardDesignRules(), API_HANDLER_PCB::handleGetBoardEnabledLayers(), API_HANDLER_PCB::handleGetBoardLayerName(), API_HANDLER_PCB::handleGetBoardOrigin(), API_HANDLER_PCB::handleGetCustomDesignRules(), API_HANDLER_PCB::handleGetGraphicsDefaults(), API_HANDLER_PCB::handleGetNets(), API_HANDLER_PCB::handleGetPadShapeAsPolygon(), handleGetPageSettings(), API_HANDLER_SCH::handleGetSchematicHierarchy(), API_HANDLER_SCH::handleGetSchematicNetlist(), API_HANDLER_PCB::handleGetStackup(), handleGetTitleBlockInfo(), API_HANDLER_PCB::handleGetVisibleLayers(), API_HANDLER_PCB::handleInjectDrcError(), API_HANDLER_PCB::handleInteractiveMoveItems(), API_HANDLER_PCB::handleParseAndCreateItemsFromString(), API_HANDLER_PCB::handleRefillZones(), API_HANDLER_PCB::handleRevertDocument(), API_HANDLER_PCB::handleRunBoardJobExport3D(), API_HANDLER_PCB::handleRunBoardJobExportDrill(), API_HANDLER_PCB::handleRunBoardJobExportDxf(), API_HANDLER_PCB::handleRunBoardJobExportGencad(), API_HANDLER_PCB::handleRunBoardJobExportGerbers(), API_HANDLER_PCB::handleRunBoardJobExportIpc2581(), API_HANDLER_PCB::handleRunBoardJobExportIpcD356(), API_HANDLER_PCB::handleRunBoardJobExportODB(), API_HANDLER_PCB::handleRunBoardJobExportPdf(), API_HANDLER_PCB::handleRunBoardJobExportPosition(), API_HANDLER_PCB::handleRunBoardJobExportPs(), API_HANDLER_PCB::handleRunBoardJobExportRender(), API_HANDLER_PCB::handleRunBoardJobExportStats(), API_HANDLER_PCB::handleRunBoardJobExportSvg(), API_HANDLER_SCH::handleRunSchematicJobExportBOM(), API_HANDLER_SCH::handleRunSchematicJobExportDxf(), API_HANDLER_SCH::handleRunSchematicJobExportNetlist(), API_HANDLER_SCH::handleRunSchematicJobExportPdf(), API_HANDLER_SCH::handleRunSchematicJobExportPs(), API_HANDLER_SCH::handleRunSchematicJobExportSvg(), API_HANDLER_PCB::handleSaveCopyOfDocument(), API_HANDLER_PCB::handleSaveDocument(), API_HANDLER_PCB::handleSaveDocumentToString(), API_HANDLER_PCB::handleSetActiveLayer(), API_HANDLER_PCB::handleSetBoardDesignRules(), API_HANDLER_PCB::handleSetBoardEnabledLayers(), API_HANDLER_PCB::handleSetBoardOrigin(), API_HANDLER_PCB::handleSetCustomDesignRules(), handleSetPageSettings(), handleSetTitleBlockInfo(), API_HANDLER_PCB::handleSetVisibleLayers(), and validateItemHeaderDocument().

◆ validateDocumentInternal()

tl::expected< bool, ApiResponseStatus > API_HANDLER_SCH::validateDocumentInternal ( const DocumentSpecifier & aDocument) const
overrideprotectedvirtual
Returns
true if the given document is valid for this editor and is currently open

Implements API_HANDLER_EDITOR.

Definition at line 166 of file api_handler_sch.cpp.

References PROJECT::GetProjectName(), PROJECT::GetProjectPath(), m_context, path, schematic(), and kiapi::common::UnpackSheetPath().

◆ validateItemHeaderDocument()

Member Data Documentation

◆ m_activeClients

◆ m_commits

std::map<std::string, std::pair<KIID, std::unique_ptr<COMMIT> > > API_HANDLER_EDITOR::m_commits
protectedinherited

◆ m_context

◆ m_defaultCommitMessage

const wxString API_HANDLER::m_defaultCommitMessage = _( "Modification from API" )
staticprotectedinherited

Definition at line 131 of file api_handler.h.

Referenced by API_HANDLER_EDITOR::pushCurrentCommit().

◆ m_frame

SCH_EDIT_FRAME* API_HANDLER_SCH::m_frame
private

◆ m_handlers

std::map<std::string, REQUEST_HANDLER> API_HANDLER::m_handlers
protectedinherited

Maps type name (without the URL prefix) to a handler method.

Definition at line 129 of file api_handler.h.

Referenced by Handle(), and registerHandler().

◆ s_allowedTypes

std::set< KICAD_T > API_HANDLER_SCH::s_allowedTypes
staticprivate
Initial value:
= {
}
@ SCH_GROUP_T
Definition typeinfo.h:174
@ SCH_LINE_T
Definition typeinfo.h:164
@ SCH_NO_CONNECT_T
Definition typeinfo.h:161
@ SCH_SYMBOL_T
Definition typeinfo.h:173
@ SCH_DIRECTIVE_LABEL_T
Definition typeinfo.h:172
@ SCH_LABEL_T
Definition typeinfo.h:168
@ SCH_SHEET_T
Definition typeinfo.h:176
@ SCH_SHAPE_T
Definition typeinfo.h:150
@ SCH_HIER_LABEL_T
Definition typeinfo.h:170
@ SCH_BUS_BUS_ENTRY_T
Definition typeinfo.h:163
@ SCH_TEXT_T
Definition typeinfo.h:152
@ SCH_BUS_WIRE_ENTRY_T
Definition typeinfo.h:162
@ SCH_BITMAP_T
Definition typeinfo.h:165
@ SCH_TEXTBOX_T
Definition typeinfo.h:153
@ SCH_GLOBAL_LABEL_T
Definition typeinfo.h:169
@ SCH_JUNCTION_T
Definition typeinfo.h:160

Definition at line 54 of file api_handler_sch.h.

Referenced by createItemForType(), deleteItemsInternal(), filterValidSchTypes(), handleGetItems(), and handleGetItemsById().


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