20#ifndef KICAD_API_HANDLER_SYMBOL_H
21#define KICAD_API_HANDLER_SYMBOL_H
23#include <google/protobuf/empty.pb.h>
26#include <api/common/commands/editor_commands.pb.h>
27#include <api/common/commands/project_commands.pb.h>
30using google::protobuf::Empty;
49 return kiapi::common::types::DOCTYPE_SYMBOL;
59 const std::string& aClientName,
60 const types::ItemHeader &aHeader,
61 const google::protobuf::RepeatedPtrField<google::protobuf::Any>& aItems,
62 std::function<
void( commands::ItemStatus, google::protobuf::Any )> aItemHandler )
66 const std::string& aClientName )
override;
70 void pushCurrentCommit(
const std::string& aClientName,
const wxString& aMessage )
override;
tl::expected< T, ApiResponseStatus > HANDLER_RESULT
constexpr EDA_IU_SCALE schIUScale
API_HANDLER_EDITOR(EDA_BASE_FRAME *aFrame=nullptr)
HANDLER_RESULT< commands::GetItemsResponse > handleGetItems(const HANDLER_CONTEXT< commands::GetItems > &aCtx)
tl::expected< bool, ApiResponseStatus > validateDocumentInternal(const DocumentSpecifier &aDocument) const override
std::unique_ptr< COMMIT > createCommit() override
Override this to create an appropriate COMMIT subclass for the frame in question.
HANDLER_RESULT< Empty > handleSaveDocument(const HANDLER_CONTEXT< commands::SaveDocument > &aCtx)
SYMBOL_EDITOR_CONTEXT * context() const
static std::set< KICAD_T > s_allowedTypes
LIB_SYMBOL * symbol() const
HANDLER_RESULT< Empty > handleRevertDocument(const HANDLER_CONTEXT< commands::RevertDocument > &aCtx)
HANDLER_RESULT< commands::GetDocumentModifiedStateResponse > handleGetDocumentModifiedState(const HANDLER_CONTEXT< commands::GetDocumentModifiedState > &aCtx) override
void deleteItemsInternal(std::map< KIID, ItemDeletionStatus > &aItemsToDelete, const std::string &aClientName) override
void onModified() override
const EDA_IU_SCALE & getIuScale() const override
Returns the internal-unit scale that the concrete editor uses.
HANDLER_RESULT< Empty > handleOpenLibraryItem(const HANDLER_CONTEXT< commands::OpenLibraryItem > &aCtx)
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
API_HANDLER_SYMBOL(SYMBOL_EDIT_FRAME *aFrame)
std::shared_ptr< SYMBOL_EDITOR_CONTEXT > m_context
HANDLER_RESULT< commands::GetOpenDocumentsResponse > handleGetOpenDocuments(const HANDLER_CONTEXT< commands::GetOpenDocuments > &aCtx)
HANDLER_RESULT< Empty > handleSaveCopyOfDocument(const HANDLER_CONTEXT< commands::SaveCopyOfDocument > &aCtx)
void pushCurrentCommit(const std::string &aClientName, const wxString &aMessage) override
SYMBOL_EDIT_FRAME * frame() const
kiapi::common::types::DocumentType thisDocumentType() const override
Override this to specify which document type this editor handles.
std::optional< EDA_ITEM * > getItemFromDocument(const DocumentSpecifier &aDocument, const KIID &aId) override
HANDLER_RESULT< commands::GetItemsResponse > handleGetItemsById(const HANDLER_CONTEXT< commands::GetItemsById > &aCtx)
Define a library symbol object.
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual LIB_SYMBOL * GetCurSymbol() const =0
The symbol library editor main window.