22#ifndef DESIGN_BLOCK_LIBRARY_ADAPTER_H
23#define DESIGN_BLOCK_LIBRARY_ADAPTER_H
41 static wxString GlobalPathEnvVariableName();
46 std::optional<LIB_STATUS>
GetLibraryStatus(
const wxString& aNickname )
const override {
return std::nullopt; }
49 std::vector<DESIGN_BLOCK*> GetDesignBlocks(
const wxString& aNickname );
52 std::vector<wxString> GetDesignBlockNames(
const wxString& aNickname );
67 DESIGN_BLOCK* LoadDesignBlock(
const wxString& aNickname,
const wxString& aDesignBlockName,
68 bool aKeepUUID =
false );
73 bool DesignBlockExists(
const wxString& aNickname,
const wxString& aDesignBlockName );
82 const DESIGN_BLOCK* GetEnumeratedDesignBlock(
const wxString& aNickname,
const wxString& aDesignBlockName );
107 SAVE_T SaveDesignBlock(
const wxString& aNickname,
const DESIGN_BLOCK* aDesignBlock,
108 bool aOverwrite =
true );
119 void DeleteDesignBlock(
const wxString& aNickname,
const wxString& aDesignBlockName );
128 bool IsDesignBlockLibWritable(
const wxString& aNickname );
145 bool aKeepUUID =
false );
147 std::optional<LIBRARY_ERROR>
LibraryError(
const wxString& aNickname )
const override;
SAVE_T
The set of return values from DesignBlockSave() below.
std::map< wxString, LIB_DATA > & globalLibs() const override
std::optional< LIB_STATUS > GetLibraryStatus(const wxString &aNickname) const override
Returns the status of a loaded library, or nullopt if the library hasn't been loaded (yet)
static std::mutex GlobalLibraryMutex
std::map< wxString, LIB_DATA > & globalLibs() override
LIBRARY_TABLE_TYPE Type() const override
The type of library table this adapter works with.
static std::map< wxString, LIB_DATA > GlobalLibraries
DESIGN_BLOCK_LIBRARY_ADAPTER(LIBRARY_MANAGER &aManager)
std::mutex & globalLibsMutex() override
LIBRARY_MANAGER_ADAPTER(LIBRARY_MANAGER &aManager)
Constructs a type-specific adapter into the library manager.
virtual std::optional< LIBRARY_ERROR > LibraryError(const wxString &aNickname) const
virtual void AsyncLoad()=0
Loads all available libraries for this adapter type in the background.
virtual LIBRARY_RESULT< IO_BASE * > createPlugin(const LIBRARY_TABLE_ROW *row)=0
Creates a concrete plugin for the given row.
virtual IO_BASE * plugin(const LIB_DATA *aRow)=0
A logical library item identifier and consists of various portions much like a URI.
Container for project specific data.
tl::expected< ResultType, LIBRARY_ERROR > LIBRARY_RESULT
Storage for an actual loaded library (including library content owned by the plugin)