23#ifndef _SCH_SEXPR_PLUGIN_H_
24#define _SCH_SEXPR_PLUGIN_H_
73 return wxT(
"Eeschema s-expression" );
118 const wxString& aLibraryPath,
121 const wxString& aLibraryPath,
127 void DeleteSymbol(
const wxString& aLibraryPath,
const wxString& aSymbolName,
143 static std::vector<LIB_SYMBOL*>
ParseLibSymbols( std::string& aSymbolText,
153 bool aForClipboard );
164 void saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias,
int aNestLevel );
165 void saveInstances(
const std::vector<SCH_SHEET_INSTANCE>& aSheets,
int aNestLevel );
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Define a library symbol object.
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
A progress reporter interface for use in multi-threaded environments.
Holds all the data relating to one schematic.
Object to handle a bitmap image that can be inserted in a schematic.
Base class for a bus or wire entry.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Segment description base class to describe items which have 2 end points (track, wire,...
Base class that schematic file and library loading and saving plugins should derive from.
A cache assistant for the KiCad s-expression symbol libraries.
A SCH_PLUGIN derivation for loading schematic files using the new s-expression file format.
wxString m_error
For throwing exceptions or errors on partial loads.
const PLUGIN_FILE_DESC GetLibraryFileDesc() const override
Returns symbol library description for the SCH_PLUGIN.
void saveBusAlias(std::shared_ptr< BUS_ALIAS > aAlias, int aNestLevel)
void GetDefaultSymbolFields(std::vector< wxString > &aNames) override
Retrieves a list of (custom) field names that should be shown by default for this library in the symb...
SCH_SHEET_PATH m_currentSheetPath
void cacheLib(const wxString &aLibraryFileName, const STRING_UTF8_MAP *aProperties)
wxString m_path
Root project path for loading child sheets.
void saveField(SCH_FIELD *aField, int aNestLevel)
void saveTextBox(SCH_TEXTBOX *aText, int aNestLevel)
OUTPUTFORMATTER * m_out
The formatter for saving SCH_SCREEN objects.
void Format(SCH_SHEET *aSheet)
void SaveSymbol(const wxString &aLibraryPath, const LIB_SYMBOL *aSymbol, const STRING_UTF8_MAP *aProperties=nullptr) override
Write aSymbol to an existing library located at aLibraryPath.
static void FormatLibSymbol(LIB_SYMBOL *aPart, OUTPUTFORMATTER &aFormatter)
void SaveLibrary(const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override
void GetAvailableSymbolFields(std::vector< wxString > &aNames) override
Retrieves a list of (custom) field names that are present on symbols in this library.
bool DeleteSymbolLib(const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override
Delete an existing symbol library and returns true if successful, or if library does not exist return...
const wxString GetName() const override
Return a brief hard coded name for this SCH_PLUGIN.
std::stack< wxString > m_currentPath
Stack to maintain nested sheet paths.
void loadFile(const wxString &aFileName, SCH_SHEET *aSheet)
void saveLine(SCH_LINE *aLine, int aNestLevel)
void saveInstances(const std::vector< SCH_SHEET_INSTANCE > &aSheets, int aNestLevel)
virtual ~SCH_SEXPR_PLUGIN()
const wxString & GetError() const override
Return an error string to the caller.
bool m_appending
Schematic load append status.
SCH_SHEET * m_rootSheet
The root sheet of the schematic being loaded.
void DeleteSymbol(const wxString &aLibraryPath, const wxString &aSymbolName, const STRING_UTF8_MAP *aProperties=nullptr) override
Delete the entire LIB_SYMBOL associated with aAliasName from the library aLibraryPath.
SCH_SHEET * LoadSchematicFile(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const STRING_UTF8_MAP *aProperties=nullptr) override
Load information from some input file format that this SCH_PLUGIN implementation knows about,...
void SetProgressReporter(PROGRESS_REPORTER *aReporter) override
Set an optional progress reporter.
void saveText(SCH_TEXT *aText, int aNestLevel)
const PLUGIN_FILE_DESC GetSchematicFileDesc() const override
Returns schematic file description for the SCH_PLUGIN.
void EnumerateSymbolLib(wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.
void saveSymbol(SCH_SYMBOL *aSymbol, const SCHEMATIC &aSchematic, int aNestLevel, bool aForClipboard)
void saveSheet(SCH_SHEET *aSheet, int aNestLevel)
SCH_SEXPR_PLUGIN_CACHE * m_cache
void CreateSymbolLib(const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override
Create a new empty symbol library at aLibraryPath.
void LoadContent(LINE_READER &aReader, SCH_SHEET *aSheet, int aVersion=SEXPR_SCHEMATIC_FILE_VERSION)
bool IsSymbolLibWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
void loadHierarchy(const SCH_SHEET_PATH &aParentSheetPath, SCH_SHEET *aSheet)
static std::vector< LIB_SYMBOL * > ParseLibSymbols(std::string &aSymbolText, std::string aSource, int aFileVersion=SEXPR_SCHEMATIC_FILE_VERSION)
bool isBuffering(const STRING_UTF8_MAP *aProperties)
PROGRESS_REPORTER * m_progressReporter
void init(SCHEMATIC *aSchematic, const STRING_UTF8_MAP *aProperties=nullptr)
initialize PLUGIN like a constructor would.
static const char * PropBuffering
The property used internally by the plugin to enable cache buffering which prevents the library file ...
void saveShape(SCH_SHAPE *aShape, int aNestLevel)
LIB_SYMBOL * LoadSymbol(const wxString &aLibraryPath, const wxString &aAliasName, const STRING_UTF8_MAP *aProperties=nullptr) override
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this...
void saveBitmap(SCH_BITMAP *aBitmap, int aNestLevel)
void SaveSchematicFile(const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const STRING_UTF8_MAP *aProperties=nullptr) override
Write aSchematic to a storage file in a format that this SCH_PLUGIN implementation knows about,...
void saveBusEntry(SCH_BUS_ENTRY_BASE *aBusEntry, int aNestLevel)
int m_version
Version of file being loaded.
int GetModifyHash() const override
Return the modification hash from the library cache.
void saveNoConnect(SCH_NO_CONNECT *aNoConnect, int aNestLevel)
void saveJunction(SCH_JUNCTION *aJunction, int aNestLevel)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
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.
const std::string KiCadSymbolLibFileExtension
const std::string KiCadSchematicFileExtension
#define SEXPR_SCHEMATIC_FILE_VERSION
Schematic file version.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
Container that describes file type info.
A simple container for sheet instance information.
A simple container for schematic symbol instance information.
Definition of file extensions used in Kicad.