25#ifndef _SYMBOL_LIB_TABLE_H_
26#define _SYMBOL_LIB_TABLE_H_
35class DIALOG_SYMBOL_LIB_TABLE;
45 typedef SCH_IO_MGR::SCH_FILE_T
LIB_T;
48 const wxString& aOptions = wxEmptyString,
49 const wxString& aDescr = wxEmptyString ) :
76 void SetType(
const wxString& aType )
override;
91 return type == SCH_IO_MGR::SCH_FILE_T::SCH_DATABASE;
106 plugin->GetAvailableSymbolFields( aNames );
115 plugin->GetDefaultSymbolFields( aNames );
154 virtual void Parse( LIB_TABLE_LEXER* aLexer )
override;
194 bool aPowerSymbolsOnly =
false );
196 void LoadSymbolLib( std::vector<LIB_SYMBOL*>& aAliasList,
const wxString& aNickname,
197 bool aPowerSymbolsOnly =
false );
242 bool aOverwrite =
true );
251 void DeleteSymbol(
const wxString& aNickname,
const wxString& aSymbolName );
A logical library item identifier and consists of various portions much like a URI.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Define a library symbol object.
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
void SetEnabled(bool aEnabled=true)
Change the enabled status of this library.
bool GetIsEnabled() const
Manage LIB_TABLE_ROW records (rows), and can be searched based on library nickname.
Dialog to show and edit symbol library tables.
ELEM
The set of #_ELEMs that a PROJECT can hold.
A factory which returns an instance of a SCH_IO.
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
Base class that schematic file and library loading and saving plugins should derive from.
Build a wxGridTableBase by wrapping an SYMBOL_LIB_TABLE object.
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_IO object i...
bool operator==(const SYMBOL_LIB_TABLE_ROW &aRow) const
void SetType(const wxString &aType) override
Change the schematic plugin type represented by this row.
bool operator!=(const SYMBOL_LIB_TABLE_ROW &aRow) const
void GetAvailableSymbolFields(std::vector< wxString > &aNames) const
void GetSubLibraryNames(std::vector< wxString > &aNames) const
bool Refresh() override
Attempt to reload the library.
SYMBOL_LIB_TABLE_ROW(const wxString &aNick, const wxString &aURI, const wxString &aType, const wxString &aOptions=wxEmptyString, const wxString &aDescr=wxEmptyString)
void setPlugin(SCH_IO *aPlugin)
SYMBOL_LIB_TABLE_ROW(const SYMBOL_LIB_TABLE_ROW &aRow)
void ShowSettingsDialog(wxWindow *aWindow) const override
void GetDefaultSymbolFields(std::vector< wxString > &aNames) const
virtual LIB_TABLE_ROW * do_clone() const override
bool SupportsSubLibraries() const
SCH_IO_MGR::SCH_FILE_T LIB_T
SCH_IO_MGR::SCH_FILE_T GetFileType()
wxString GetSubLibraryDescription(const wxString &aName) const
bool SupportsSettingsDialog() const override
const wxString GetType() const override
Return the type of symbol library table represented by this row.
IO_RELEASER< SCH_IO > plugin
void LoadSymbolLib(std::vector< LIB_SYMBOL * > &aAliasList, const wxString &aNickname, bool aPowerSymbolsOnly=false)
bool operator!=(const SYMBOL_LIB_TABLE &aOther) const
void DeleteSymbol(const wxString &aNickname, const wxString &aSymbolName)
Deletes the aSymbolName from the library given by aNickname.
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
virtual void Parse(LIB_TABLE_LEXER *aLexer) override
Parse the #LIB_TABLE_LEXER s-expression library table format into the appropriate LIB_TABLE_ROW objec...
static const wxString & GetSymbolLibTableFileName()
static const char * PropPowerSymsOnly
bool IsSymbolLibWritable(const wxString &aNickname)
Return true if the library given by aNickname is writable.
bool IsSymbolLibLoaded(const wxString &aNickname)
Return true if the library given by aNickname was successfully loaded.
virtual void Format(OUTPUTFORMATTER *aOutput, int aIndentLevel) const override
Generate the table in s-expression format to aOutput with an indentation level of aIndentLevel.
void DeleteSymbolLib(const wxString &aNickname)
void CreateSymbolLib(const wxString &aNickname)
PROJECT::ELEM ProjectElementType() override
static wxString GetGlobalTableFileName()
Fetch the global symbol library table file name.
void EnumerateSymbolLib(const wxString &aNickname, wxArrayString &aAliasNames, bool aPowerSymbolsOnly=false)
Return a list of symbol alias names contained within the library given by aNickname.
static bool LoadGlobalTable(SYMBOL_LIB_TABLE &aTable)
Load the global symbol library table into aTable.
static const wxString GlobalPathEnvVariableName()
Return the name of the environment variable used to hold the directory of locally installed "KiCad sp...
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
LIB_SYMBOL * LoadSymbolWithOptionalNickname(const LIB_ID &aId)
Load a LIB_SYMBOL having aFootprintId with possibly an empty library nickname.
static const char * PropNonPowerSymsOnly
bool operator==(const SYMBOL_LIB_TABLE &aOther) const
Compares this table against another.
SAVE_T SaveSymbol(const wxString &aNickname, const LIB_SYMBOL *aSymbol, bool aOverwrite=true)
Write aSymbol to an existing library given by aNickname.
SAVE_T
The set of return values from SaveSymbol() below.
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName, bool aCheckIfEnabled=false)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
static int m_modifyHash
helper for GetModifyHash()
LIB_SYMBOL * LoadSymbol(const LIB_ID &aLibId)
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.