84 static SCH_PLUGIN* FindPlugin( SCH_FILE_T aFileType );
97 static const wxString
ShowType( SCH_FILE_T aFileType );
102 static SCH_FILE_T
EnumFromStr(
const wxString& aFileType );
275 virtual void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
298 const wxString& aLibraryPath,
367 virtual void DeleteSymbol(
const wxString& aLibraryPath,
const wxString& aSymbolName,
500 virtual bool CheckHeader(
const wxString& aFileName );
510 virtual const wxString&
GetError()
const;
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Define a library symbol object.
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Holds all the data relating to one schematic.
A factory which returns an instance of a SCH_PLUGIN.
static SCH_FILE_T EnumFromStr(const wxString &aFileType)
Return the #SCH_FILE_T from the corresponding plugin type name: "kicad", "legacy",...
static const wxString GetFileExtension(SCH_FILE_T aFileType)
Return the schematic file extension for aFileType.
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
static const wxString GetLibraryFileExtension(SCH_FILE_T aFileType)
Return the symbol library file extension (if any) for aFileType.
static void ReleasePlugin(SCH_PLUGIN *aPlugin)
Release a SCH_PLUGIN back to the system, and may cause it to be unloaded from memory.
static SCH_FILE_T GuessPluginTypeFromSchPath(const wxString &aSchematicPath)
Return a plugin type given a schematic using the file extension of aSchematicPath.
DEFINE_ENUM_VECTOR(SCH_FILE_T, { SCH_LEGACY, SCH_KICAD, SCH_ALTIUM, SCH_CADSTAR_ARCHIVE, SCH_EAGLE, SCH_DATABASE, SCH_LTSPICE, SCH_FILE_UNKNOWN }) APIEXPORT static SCH_PLUGIN *FindPlugin(SCH_FILE_T aFileType)
A set of file types that the SCH_IO_MGR knows about, and for which there has been a plugin written.
static SCH_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath)
Return a plugin type given a symbol library using the file extension of aLibPath.
Helper object to release a SCH_PLUGIN in the context of a potential thrown exception through its dest...
void set(SCH_PLUGIN *aPlugin)
SCH_PLUGIN_RELEASER(const SCH_PLUGIN_RELEASER &aOther)
SCH_PLUGIN_RELEASER & operator=(SCH_PLUGIN_RELEASER &aOther)
SCH_PLUGIN * operator->() const
SCH_PLUGIN_RELEASER(SCH_PLUGIN *aPlugin=nullptr)
Base class that schematic file and library loading and saving plugins should derive from.
virtual void EnumerateSymbolLib(wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr)
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.
virtual int GetModifyHash() const =0
Return the modification hash from the library cache.
virtual void SaveSymbol(const wxString &aLibraryPath, const LIB_SYMBOL *aSymbol, const STRING_UTF8_MAP *aProperties=nullptr)
Write aSymbol to an existing library located at aLibraryPath.
virtual void DeleteSymbol(const wxString &aLibraryPath, const wxString &aSymbolName, const STRING_UTF8_MAP *aProperties=nullptr)
Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath.
virtual void SaveLibrary(const wxString &aFileName, const STRING_UTF8_MAP *aProperties=nullptr)
virtual const wxString GetName() const =0
Return a brief hard coded name for this SCH_PLUGIN.
virtual void GetAvailableSymbolFields(std::vector< wxString > &aNames)
Retrieves a list of (custom) field names that are present on symbols in this library.
virtual const wxString GetLibraryFileExtension() const =0
Return the library file extension for the SCH_PLUGIN object.
virtual void SymbolLibOptions(STRING_UTF8_MAP *aListToAppendTo) const
Append supported SCH_PLUGIN options to aListToAppenTo along with internationalized descriptions.
virtual LIB_SYMBOL * LoadSymbol(const wxString &aLibraryPath, const wxString &aPartName, const STRING_UTF8_MAP *aProperties=nullptr)
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this...
virtual bool SupportsSubLibraries() const
virtual void SetLibTable(SYMBOL_LIB_TABLE *aTable)
Some library plugins need to have access to their parent library table.
virtual const wxString & GetError() const
Return an error string to the caller.
virtual void CreateSymbolLib(const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr)
Create a new empty symbol library at aLibraryPath.
virtual void Save(const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const STRING_UTF8_MAP *aProperties=nullptr)
Write aSchematic to a storage file in a format that this SCH_PLUGIN implementation knows about,...
virtual SCH_SHEET * Load(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const STRING_UTF8_MAP *aProperties=nullptr)
Load information from some input file format that this SCH_PLUGIN implementation knows about,...
virtual bool DeleteSymbolLib(const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr)
Delete an existing symbol library and returns true if successful, or if library does not exist return...
virtual void GetSubLibraryNames(std::vector< wxString > &aNames)
Retrieves a list of sub-libraries in this library.
virtual const wxString GetFileExtension() const =0
Return the file extension for the SCH_PLUGIN.
virtual void SetReporter(REPORTER *aReporter)
Set an optional reporter for warnings/errors.
virtual void GetDefaultSymbolFields(std::vector< wxString > &aNames)
Retrieves a list of (custom) field names that should be shown by default for this library in the symb...
virtual void SetProgressReporter(PROGRESS_REPORTER *aReporter)
Set an optional progress reporter.
virtual bool CheckHeader(const wxString &aFileName)
Return true if the first line in aFileName begins with the expected header.
virtual bool IsSymbolLibWritable(const wxString &aLibraryPath)
Return true if the library at aLibraryPath is writable.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
A name/value tuple with unique names and optional values.
Object used to load, save, search, and otherwise manipulate symbol library files.
#define APIEXPORT
Macros which export functions from a DLL/DSO.