22#ifndef DESIGN_BLOCK_LIBRARY_ADAPTER_H
23#define DESIGN_BLOCK_LIBRARY_ADAPTER_H
41 static wxString GlobalPathEnvVariableName();
48 std::optional<LIB_STATUS>
GetLibraryStatus(
const wxString& aNickname )
const override {
return std::nullopt; }
51 std::vector<DESIGN_BLOCK*> GetDesignBlocks(
const wxString& aNickname );
54 std::vector<wxString> GetDesignBlockNames(
const wxString& aNickname );
69 DESIGN_BLOCK* LoadDesignBlock(
const wxString& aNickname,
const wxString& aDesignBlockName,
70 bool aKeepUUID =
false );
75 bool DesignBlockExists(
const wxString& aNickname,
const wxString& aDesignBlockName );
84 const DESIGN_BLOCK* GetEnumeratedDesignBlock(
const wxString& aNickname,
const wxString& aDesignBlockName );
109 SAVE_T SaveDesignBlock(
const wxString& aNickname,
const DESIGN_BLOCK* aDesignBlock,
110 bool aOverwrite =
true );
121 void DeleteDesignBlock(
const wxString& aNickname,
const wxString& aDesignBlockName );
130 bool IsDesignBlockLibWritable(
const wxString& aNickname );
147 bool aKeepUUID =
false );
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
virtual std::optional< LIB_STATUS > LoadOne(LIB_DATA *aLib)=0
LIBRARY_MANAGER_ADAPTER(LIBRARY_MANAGER &aManager)
Constructs a type-specific adapter into the library manager.
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)