21#ifndef KICAD_API_HANDLER_LIBRARIES_H
22#define KICAD_API_HANDLER_LIBRARIES_H
29#include <api/common/commands/editor_commands.pb.h>
30#include <api/common/commands/library_commands.pb.h>
tl::expected< T, ApiResponseStatus > HANDLER_RESULT
HANDLER_RESULT< kiapi::common::commands::LibraryItemsResponse > handleGetLibraryItems(const HANDLER_CONTEXT< kiapi::common::commands::GetLibraryItems > &aCtx)
HANDLER_RESULT< kiapi::common::commands::LibraryStatusResponse > handleGetLibraryStatuses(const HANDLER_CONTEXT< kiapi::common::commands::GetLibraryStatuses > &aCtx)
virtual bool packLibraryItem(const LIB_ID &aId, google::protobuf::Any &aOutput) const
~API_HANDLER_LIBRARIES() override
HANDLER_RESULT< kiapi::common::types::LibraryCommandStatus > handleReloadLibrary(const HANDLER_CONTEXT< kiapi::common::commands::ReloadLibrary > &aCtx)
kiapi::common::types::LibraryCommandStatus loadAllLibraries()
Starts a background load of all libraries of this handler's type.
virtual std::vector< wxString > getItemNames(LIBRARY_MANAGER_ADAPTER &aAdapter, const wxString &aNickname) const
Returns the names of all entries in the given library, or an empty vector if the library is not loade...
void SetKiway(KIWAY *aKiway)
virtual LIBRARY_MANAGER_ADAPTER * adapterForProject(PROJECT &aProject) const
LIBRARY_TABLE_TYPE m_type
API_HANDLER_LIBRARIES(LIBRARY_TABLE_TYPE aType=LIBRARY_TABLE_TYPE::DESIGN_BLOCK)
LIBRARY_TABLE_TYPE libraryType() const
std::function< void(KIFACE *)> m_handlerRegisterCallback
Invoked with a lazily-loaded KIFACE so its handlers can be registered on the server.
KIWAY * m_kiway
Used to lazily load kifaces for LoadAllLibraries in headless; null in GUI mode.
HANDLER_RESULT< kiapi::common::types::LibraryCommandStatus > handleLoadAllLibraries(const HANDLER_CONTEXT< kiapi::common::commands::LoadAllLibraries > &aCtx)
void SetLibraryHandlerRegistrar(std::function< void(KIFACE *)> aRegistrar)
Set a callback to register the handler on the API server in headless mode.
HANDLER_RESULT< kiapi::common::commands::GetItemsResponse > handleGetItemsFromLibrary(const HANDLER_CONTEXT< kiapi::common::commands::GetItemsFromLibrary > &aCtx)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
The interface used by the classes that actually can load IO plugins for the different parts of KiCad ...
A logical library item identifier and consists of various portions much like a URI.
Container for project specific data.
Implement a participant in the KIWAY alchemy.