103 void AddSymbol(
const wxString& aName,
const wxString& aParentName,
bool aIsPower,
137 std::set<wxString>
GetAncestors(
const wxString& aSymbolName )
const;
145 std::set<wxString>
GetDescendants(
const wxString& aSymbolName )
const;
153 wxString
GetParent(
const wxString& aSymbolName )
const;
166 bool IsDerived(
const wxString& aSymbolName )
const;
176 std::vector<wxString>
SetSymbolSelected(
const wxString& aSymbolName,
bool aSelected );
199 void SelectAll( std::function<
bool(
const wxString& )> aFilter =
nullptr );
206 void DeselectAll( std::function<
bool(
const wxString& )> aFilter =
nullptr );
231 static bool MatchesFilter(
const wxString& aSymbolName,
const wxString& aFilter );
Define a library symbol object.
std::function< bool(const wxString &symbolName)> SYMBOL_EXISTS_FUNC
Callback type for checking if a symbol exists in the destination library.
void DeselectWithDescendants(const wxString &aSymbolName)
Force deselection of a symbol and all its descendants.
std::vector< wxString > GetConflicts() const
Get list of symbols that will conflict (selected and exist in destination).
void CheckExistingSymbols(SYMBOL_EXISTS_FUNC aExistsFunc)
Mark symbols that exist in the destination library.
std::map< wxString, wxString > m_parentMap
Map from symbol name to its parent name (for derived symbols)
void SelectAll(std::function< bool(const wxString &)> aFilter=nullptr)
Select all symbols (optionally filtered).
std::vector< wxString > GetDirectDerivatives(const wxString &aSymbolName) const
Get direct children (derivatives) of a symbol.
wxString GetParent(const wxString &aSymbolName) const
Get the direct parent of a symbol.
int GetManualSelectionCount() const
Get count of manually selected symbols.
std::map< wxString, SYMBOL_IMPORT_INFO > m_symbols
All symbols available for import, keyed by name.
void DeselectAll(std::function< bool(const wxString &)> aFilter=nullptr)
Deselect all symbols (optionally filtered).
size_t GetSymbolCount() const
Get total number of symbols.
void AddSymbol(const wxString &aName, const wxString &aParentName, bool aIsPower, LIB_SYMBOL *aSymbol=nullptr)
Add a symbol to the import list.
std::vector< wxString > GetSelectedDescendants(const wxString &aSymbolName) const
Get selected descendants that would be orphaned if a symbol is deselected.
std::vector< wxString > SetSymbolSelected(const wxString &aSymbolName, bool aSelected)
Set the selection state of a symbol.
std::vector< wxString > GetSymbolNames() const
Get all symbol names.
static bool MatchesFilter(const wxString &aSymbolName, const wxString &aFilter)
Check if a symbol name matches a filter string (case-insensitive contains).
int GetAutoSelectionCount() const
Get count of auto-selected symbols (dependencies).
void Clear()
Clear all loaded symbols and reset state.
void recalculateAutoSelections()
Recalculate auto-selection state for all symbols based on current manual selections.
SYMBOL_IMPORT_INFO * GetSymbolInfo(const wxString &aName)
Get symbol info by name.
std::map< wxString, std::vector< wxString > > m_derivativesMap
Map from parent name to list of direct derivative names.
bool IsDerived(const wxString &aSymbolName) const
Check if a symbol is derived from another.
std::set< wxString > GetAncestors(const wxString &aSymbolName) const
Get all ancestors of a symbol (full inheritance chain).
std::set< wxString > GetDescendants(const wxString &aSymbolName) const
Get all descendants of a symbol (all derived symbols recursively).
std::vector< wxString > GetSymbolsToImport() const
Get list of all symbols that will be imported (checked + auto-selected).
void BuildDependencyMaps()
Build the dependency maps from parent relationships.
Information about a symbol available for import.
bool m_existsInDest
True if symbol exists in destination library.
bool m_isPower
True if power symbol.
bool m_checked
User's manual selection state.
bool m_autoSelected
True if auto-selected as dependency.
wxString m_name
Symbol name.
std::unique_ptr< LIB_SYMBOL > m_symbol
Loaded symbol (may be null)
wxString m_parentName
Parent symbol name if derived.
CONFLICT_RESOLUTION
Result of conflict resolution for a single symbol.
@ OVERWRITE
Overwrite existing symbol.
@ SKIP
Don't import this symbol.