KiCad PCB EDA Suite
Loading...
Searching...
No Matches
HEADLESS_SYMBOL_EDITOR_CONTEXT Class Reference

#include <headless_symbol_editor_context.h>

Inheritance diagram for HEADLESS_SYMBOL_EDITOR_CONTEXT:
SYMBOL_EDITOR_CONTEXT

Public Member Functions

 HEADLESS_SYMBOL_EDITOR_CONTEXT (std::unique_ptr< LIB_SYMBOL > aSymbol, const LIB_ID &aLibId, PROJECT *aProject, APP_SETTINGS_BASE *aSettings, KIWAY *aKiway=nullptr)
 
 ~HEADLESS_SYMBOL_EDITOR_CONTEXT () override
 
LIB_SYMBOL * GetCurSymbol () const override
 
SCH_SCREEN * GetScreen () const override
 
LIB_ID GetLoadedLibId () const override
 
bool IsContentModified () const override
 
void SetContentModified (bool aModified=true) override
 
PROJECT & Prj () const override
 
TOOL_MANAGER * GetToolManager () const override
 
KIWAY * GetKiway () const override
 
bool CanAcceptApiCommands () const override
 
bool SaveSymbol () override
 Save the current symbol to its library, without any user interaction.
 
bool SaveSymbolCopy (const wxString &aFileName, bool aOverwrite) override
 Save a copy of the current symbol to the given library file, without user interaction.
 
bool RevertSymbol () override
 Reload the current symbol from its library, discarding unsaved changes.
 
bool LoadSymbol (const LIB_ID &aLibId) override
 Load a symbol into the editor (activating it for editing); false if not found.
 

Private Attributes

std::unique_ptr< LIB_SYMBOL > m_symbol
 
std::unique_ptr< SCH_SCREEN > m_screen
 
LIB_ID m_libId
 
PROJECT * m_project
 
KIWAY * m_kiway
 
bool m_contentModified = false
 
std::unique_ptr< TOOL_MANAGER > m_toolManager
 

Detailed Description

Definition at line 36 of file headless_symbol_editor_context.h.

Constructor & Destructor Documentation

◆ HEADLESS_SYMBOL_EDITOR_CONTEXT()

HEADLESS_SYMBOL_EDITOR_CONTEXT::HEADLESS_SYMBOL_EDITOR_CONTEXT ( std::unique_ptr< LIB_SYMBOL > aSymbol,
const LIB_ID & aLibId,
PROJECT * aProject,
APP_SETTINGS_BASE * aSettings,
KIWAY * aKiway = nullptr )

◆ ~HEADLESS_SYMBOL_EDITOR_CONTEXT()

HEADLESS_SYMBOL_EDITOR_CONTEXT::~HEADLESS_SYMBOL_EDITOR_CONTEXT ( )
overridedefault

Member Function Documentation

◆ CanAcceptApiCommands()

bool HEADLESS_SYMBOL_EDITOR_CONTEXT::CanAcceptApiCommands ( ) const
inlineoverridevirtual

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 61 of file headless_symbol_editor_context.h.

◆ GetCurSymbol()

LIB_SYMBOL * HEADLESS_SYMBOL_EDITOR_CONTEXT::GetCurSymbol ( ) const
inlineoverridevirtual

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 45 of file headless_symbol_editor_context.h.

References m_symbol.

◆ GetKiway()

KIWAY * HEADLESS_SYMBOL_EDITOR_CONTEXT::GetKiway ( ) const
inlineoverridevirtual

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 59 of file headless_symbol_editor_context.h.

References m_kiway.

◆ GetLoadedLibId()

LIB_ID HEADLESS_SYMBOL_EDITOR_CONTEXT::GetLoadedLibId ( ) const
inlineoverridevirtual

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 49 of file headless_symbol_editor_context.h.

References m_libId.

◆ GetScreen()

SCH_SCREEN * HEADLESS_SYMBOL_EDITOR_CONTEXT::GetScreen ( ) const
inlineoverridevirtual

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 47 of file headless_symbol_editor_context.h.

References m_screen.

◆ GetToolManager()

TOOL_MANAGER * HEADLESS_SYMBOL_EDITOR_CONTEXT::GetToolManager ( ) const
overridevirtual

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 64 of file headless_symbol_editor_context.cpp.

References m_toolManager.

◆ IsContentModified()

bool HEADLESS_SYMBOL_EDITOR_CONTEXT::IsContentModified ( ) const
inlineoverridevirtual

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 51 of file headless_symbol_editor_context.h.

References m_contentModified.

◆ LoadSymbol()

bool HEADLESS_SYMBOL_EDITOR_CONTEXT::LoadSymbol ( const LIB_ID & aLibId)
overridevirtual

Load a symbol into the editor (activating it for editing); false if not found.

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 132 of file headless_symbol_editor_context.cpp.

References SYMBOL_LIBRARY_ADAPTER::LoadSymbol(), m_contentModified, m_libId, m_project, m_symbol, and PROJECT_SCH::SymbolLibAdapter().

◆ Prj()

PROJECT & HEADLESS_SYMBOL_EDITOR_CONTEXT::Prj ( ) const
overridevirtual

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 57 of file headless_symbol_editor_context.cpp.

References m_project.

◆ RevertSymbol()

bool HEADLESS_SYMBOL_EDITOR_CONTEXT::RevertSymbol ( )
overridevirtual

Reload the current symbol from its library, discarding unsaved changes.

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 111 of file headless_symbol_editor_context.cpp.

References SYMBOL_LIBRARY_ADAPTER::LoadSymbol(), m_contentModified, m_libId, m_project, m_symbol, and PROJECT_SCH::SymbolLibAdapter().

◆ SaveSymbol()

bool HEADLESS_SYMBOL_EDITOR_CONTEXT::SaveSymbol ( )
overridevirtual

Save the current symbol to its library, without any user interaction.

Returns
false if there is no symbol, the library is read-only, or the save failed

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 70 of file headless_symbol_editor_context.cpp.

References copy, SYMBOL_LIBRARY_ADAPTER::IsSymbolLibWritable(), m_contentModified, m_libId, m_project, m_symbol, SYMBOL_LIBRARY_ADAPTER::SAVE_OK, SYMBOL_LIBRARY_ADAPTER::SaveSymbol(), and PROJECT_SCH::SymbolLibAdapter().

◆ SaveSymbolCopy()

bool HEADLESS_SYMBOL_EDITOR_CONTEXT::SaveSymbolCopy ( const wxString & aFileName,
bool aOverwrite )
overridevirtual

Save a copy of the current symbol to the given library file, without user interaction.

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 103 of file headless_symbol_editor_context.cpp.

References m_symbol, and SaveSymbolCopyToFile().

◆ SetContentModified()

void HEADLESS_SYMBOL_EDITOR_CONTEXT::SetContentModified ( bool aModified = true)
inlineoverridevirtual

Implements SYMBOL_EDITOR_CONTEXT.

Definition at line 53 of file headless_symbol_editor_context.h.

References m_contentModified.

Member Data Documentation

◆ m_contentModified

bool HEADLESS_SYMBOL_EDITOR_CONTEXT::m_contentModified = false
private

◆ m_kiway

KIWAY* HEADLESS_SYMBOL_EDITOR_CONTEXT::m_kiway
private

Definition at line 76 of file headless_symbol_editor_context.h.

Referenced by GetKiway(), and HEADLESS_SYMBOL_EDITOR_CONTEXT().

◆ m_libId

LIB_ID HEADLESS_SYMBOL_EDITOR_CONTEXT::m_libId
private

◆ m_project

PROJECT* HEADLESS_SYMBOL_EDITOR_CONTEXT::m_project
private

◆ m_screen

std::unique_ptr<SCH_SCREEN> HEADLESS_SYMBOL_EDITOR_CONTEXT::m_screen
private

Definition at line 73 of file headless_symbol_editor_context.h.

Referenced by GetScreen(), and HEADLESS_SYMBOL_EDITOR_CONTEXT().

◆ m_symbol

std::unique_ptr<LIB_SYMBOL> HEADLESS_SYMBOL_EDITOR_CONTEXT::m_symbol
private

◆ m_toolManager

std::unique_ptr<TOOL_MANAGER> HEADLESS_SYMBOL_EDITOR_CONTEXT::m_toolManager
private

The documentation for this class was generated from the following files: