KiCad PCB EDA Suite
|
#include <property.h>
Public Member Functions | |
PROPERTY_BASE (const wxString &aName, PROPERTY_DISPLAY aDisplay=PT_DEFAULT, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType=ORIGIN_TRANSFORMS::NOT_A_COORD) | |
< Used to generate unique IDs. Must come up front so it's initialized before ctor. | |
virtual | ~PROPERTY_BASE () |
const wxString & | Name () const |
virtual const wxPGChoices & | Choices () const |
Return a limited set of possible values (e.g. | |
virtual void | SetChoices (const wxPGChoices &aChoices) |
Set the possible values for for the property. | |
virtual bool | HasChoices () const |
Return true if this PROPERTY has a limited set of possible values. | |
bool | Available (INSPECTABLE *aObject) const |
Return true if aObject offers this PROPERTY. | |
PROPERTY_BASE & | SetAvailableFunc (std::function< bool(INSPECTABLE *)> aFunc) |
Set a callback function to determine whether an object provides this property. | |
wxPGChoices | GetChoices (INSPECTABLE *aObject) const |
PROPERTY_BASE & | SetChoicesFunc (std::function< wxPGChoices(INSPECTABLE *)> aFunc) |
virtual bool | Writeable (INSPECTABLE *aObject) const |
PROPERTY_BASE & | SetWriteableFunc (std::function< bool(INSPECTABLE *)> aFunc) |
virtual size_t | OwnerHash () const =0 |
Return type-id of the Owner class. | |
virtual size_t | BaseHash () const =0 |
Return type-id of the Base class. | |
virtual size_t | TypeHash () const =0 |
Return type-id of the property type. | |
PROPERTY_DISPLAY | Display () const |
PROPERTY_BASE & | SetDisplay (PROPERTY_DISPLAY aDisplay) |
ORIGIN_TRANSFORMS::COORD_TYPES_T | CoordType () const |
PROPERTY_BASE & | SetCoordType (ORIGIN_TRANSFORMS::COORD_TYPES_T aType) |
bool | IsHiddenFromPropertiesManager () const |
PROPERTY_BASE & | SetIsHiddenFromPropertiesManager (bool aHide=true) |
bool | IsHiddenFromRulesEditor () const |
PROPERTY_BASE & | SetIsHiddenFromRulesEditor (bool aHide=true) |
bool | IsHiddenFromLibraryEditors () const |
PROPERTY_BASE & | SetIsHiddenFromLibraryEditors (bool aIsHidden=true) |
bool | IsHiddenFromDesignEditors () const |
PROPERTY_BASE & | SetIsHiddenFromDesignEditors (bool aIsHidden=true) |
wxString | Group () const |
PROPERTY_BASE & | SetGroup (const wxString &aGroup) |
PROPERTY_BASE & | SetValidator (PROPERTY_VALIDATOR_FN &&aValidator) |
VALIDATOR_RESULT | Validate (const wxAny &&aValue, EDA_ITEM *aItem) |
Static Public Member Functions | |
static VALIDATOR_RESULT | NullValidator (const wxAny &&aValue, EDA_ITEM *aItem) |
Protected Member Functions | |
template<typename T> | |
void | set (void *aObject, T aValue) |
template<typename T> | |
T | get (const void *aObject) const |
Private Member Functions | |
virtual void | setter (void *aObject, wxAny &aValue)=0 |
virtual wxAny | getter (const void *aObject) const =0 |
Private Attributes | |
const wxString | m_name |
Permanent identifier for this property. | |
PROPERTY_DISPLAY | m_display |
The display style controls how properties are edited in the properties manager GUI. | |
ORIGIN_TRANSFORMS::COORD_TYPES_T | m_coordType |
The coordinate type controls how distances are mapped to the user coordinate system. | |
bool | m_hideFromPropertiesManager |
bool | m_hideFromLibraryEditors |
bool | m_hideFromDesignEditors |
bool | m_hideFromRulesEditor |
wxString | m_group |
Optional group identifier. | |
std::function< bool(INSPECTABLE *)> | m_availFunc |
Eval to determine if prop is available. | |
std::function< bool(INSPECTABLE *)> | m_writeableFunc |
Eval to determine if prop is read-only. | |
std::function< wxPGChoices(INSPECTABLE *)> | m_choicesFunc |
PROPERTY_VALIDATOR_FN | m_validator |
Friends | |
class | INSPECTABLE |
Definition at line 194 of file property.h.
|
inline |
< Used to generate unique IDs. Must come up front so it's initialized before ctor.
Definition at line 200 of file property.h.
References INSPECTABLE, m_availFunc, m_coordType, m_display, m_hideFromDesignEditors, m_hideFromLibraryEditors, m_hideFromPropertiesManager, m_hideFromRulesEditor, m_name, ORIGIN_TRANSFORMS::NOT_A_COORD, and PT_DEFAULT.
Referenced by PCB_FOOTPRINT_FIELD_PROPERTY::PCB_FOOTPRINT_FIELD_PROPERTY(), PROPERTY< Owner, T, Base >::PROPERTY(), SCH_SYMBOL_FIELD_PROPERTY::SCH_SYMBOL_FIELD_PROPERTY(), SetAvailableFunc(), SetChoicesFunc(), SetCoordType(), SetDisplay(), SetGroup(), SetIsHiddenFromDesignEditors(), SetIsHiddenFromLibraryEditors(), SetIsHiddenFromPropertiesManager(), SetIsHiddenFromRulesEditor(), SetValidator(), and SetWriteableFunc().
|
inlinevirtual |
Definition at line 215 of file property.h.
|
inline |
Return true if aObject offers this PROPERTY.
Definition at line 251 of file property.h.
References INSPECTABLE, and m_availFunc.
Referenced by BOOST_AUTO_TEST_CASE(), and PROPERTY_MANAGER::IsAvailableFor().
|
pure virtual |
Return type-id of the Base class.
Implemented in PCB_FOOTPRINT_FIELD_PROPERTY, PROPERTY< Owner, T, Base >, PROPERTY< Owner, T, Owner >, and SCH_SYMBOL_FIELD_PROPERTY.
Referenced by PROPERTY_MANAGER::IsAvailableFor(), and PROPERTY_MANAGER::IsWriteableFor().
|
inlinevirtual |
Return a limited set of possible values (e.g.
enum). Check with HasChoices() if a particular PROPERTY provides such set.
Reimplemented in PROPERTY_ENUM< Owner, T, Base >.
Definition at line 225 of file property.h.
References empty().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PCB_PROPERTIES_PANEL::createPGProperty(), and PGPropertyFactory().
|
inline |
Definition at line 308 of file property.h.
References m_coordType.
Referenced by PGPropertyFactory().
|
inline |
Definition at line 406 of file property.h.
Referenced by INSPECTABLE::Get(), and INSPECTABLE::Get().
|
inline |
Definition at line 265 of file property.h.
References INSPECTABLE, and m_choicesFunc.
Referenced by PROPERTIES_PANEL::extractValueAndWritability(), and INSPECTABLE::Set().
|
privatepure virtual |
Implemented in PCB_FOOTPRINT_FIELD_PROPERTY, PROPERTY< Owner, T, Base >, PROPERTY< Owner, T, Owner >, PROPERTY_ENUM< Owner, T, Base >, and SCH_SYMBOL_FIELD_PROPERTY.
Referenced by INSPECTABLE::Get(), get(), and set().
|
inline |
Definition at line 343 of file property.h.
References m_group.
|
inlinevirtual |
Return true if this PROPERTY has a limited set of possible values.
Reimplemented in PROPERTY_ENUM< Owner, T, Base >.
Definition at line 243 of file property.h.
References m_choicesFunc.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PCB_PROPERTIES_PANEL::createPGProperty(), PCBEXPR_UCODE::CreateVarRef(), PROPERTIES_PANEL::getItemValue(), and PGPropertyFactory().
|
inline |
Definition at line 336 of file property.h.
References m_hideFromDesignEditors.
|
inline |
Definition at line 329 of file property.h.
References m_hideFromLibraryEditors.
|
inline |
Definition at line 315 of file property.h.
References m_hideFromPropertiesManager.
|
inline |
Definition at line 322 of file property.h.
References m_hideFromRulesEditor.
|
inline |
Definition at line 219 of file property.h.
References m_name.
Referenced by PROPERTY_MANAGER::AddProperty(), PCB_PROPERTIES_PANEL::createPGProperty(), SCH_PROPERTIES_PANEL::createPGProperty(), GENERATOR_TOOL::GENERATOR_TOOL(), PROPERTIES_PANEL::getItemValue(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::IsAvailableFor(), PROPERTY_MANAGER::IsWriteableFor(), PGPropertyFactory(), SCHEMATIC::SCHEMATIC(), and SCH_SYMBOL::SyncOtherUnits().
|
inlinestatic |
Definition at line 357 of file property.h.
|
pure virtual |
Return type-id of the Owner class.
Implemented in PCB_FOOTPRINT_FIELD_PROPERTY, PROPERTY< Owner, T, Base >, PROPERTY< Owner, T, Owner >, and SCH_SYMBOL_FIELD_PROPERTY.
Referenced by PROPERTY_MANAGER::AddProperty(), INSPECTABLE::Get(), INSPECTABLE::Get(), PROPERTY_MANAGER::ReplaceProperty(), INSPECTABLE::Set(), INSPECTABLE::Set(), INSPECTABLE::Set(), and INSPECTABLE::Set().
Definition at line 364 of file property.h.
References EDA_ANGLE_VARIANT_DATA::Angle(), COLOR4D_VARIANT_DATA::Color(), getter(), setter(), T, STD_OPTIONAL_DOUBLE_VARIANT_DATA::Value(), and STD_OPTIONAL_INT_VARIANT_DATA::Value().
Referenced by INSPECTABLE::Set(), INSPECTABLE::Set(), and INSPECTABLE::Set().
|
inline |
Set a callback function to determine whether an object provides this property.
Definition at line 259 of file property.h.
References INSPECTABLE, m_availFunc, and PROPERTY_BASE().
Referenced by BOARD_ITEM_DESC::BOARD_ITEM_DESC(), DIMENSION_DESC::DIMENSION_DESC(), EDA_SHAPE_DESC::EDA_SHAPE_DESC(), EDA_TEXT_DESC::EDA_TEXT_DESC(), PAD_DESC::PAD_DESC(), PCB_SHAPE_DESC::PCB_SHAPE_DESC(), PCB_TUNING_PATTERN_DESC::PCB_TUNING_PATTERN_DESC(), SCH_ITEM_DESC::SCH_ITEM_DESC(), SCH_LABEL_DESC::SCH_LABEL_DESC(), SCH_LINE_DESC::SCH_LINE_DESC(), SCH_PIN_DESC::SCH_PIN_DESC(), SCH_SHAPE_DESC::SCH_SHAPE_DESC(), SCH_SYMBOL_DESC::SCH_SYMBOL_DESC(), TRACK_VIA_DESC::TRACK_VIA_DESC(), and ZONE_DESC::ZONE_DESC().
|
inlinevirtual |
Set the possible values for for the property.
Reimplemented in PROPERTY_ENUM< Owner, T, Base >.
Definition at line 234 of file property.h.
|
inline |
Definition at line 273 of file property.h.
References INSPECTABLE, m_choicesFunc, and PROPERTY_BASE().
Referenced by EDA_TEXT_DESC::EDA_TEXT_DESC(), PAD_DESC::PAD_DESC(), SCH_ITEM_DESC::SCH_ITEM_DESC(), and SCH_SYMBOL_DESC::SCH_SYMBOL_DESC().
|
inline |
Definition at line 309 of file property.h.
References m_coordType, and PROPERTY_BASE().
|
inline |
Definition at line 306 of file property.h.
References m_display, and PROPERTY_BASE().
|
inline |
Definition at line 344 of file property.h.
References m_group, and PROPERTY_BASE().
Referenced by PROPERTY_MANAGER::AddProperty().
|
inline |
Definition at line 337 of file property.h.
References m_hideFromDesignEditors, and PROPERTY_BASE().
Referenced by SCH_ITEM_DESC::SCH_ITEM_DESC().
|
inline |
Definition at line 330 of file property.h.
References m_hideFromLibraryEditors, and PROPERTY_BASE().
Referenced by BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), BOARD_ITEM_DESC::BOARD_ITEM_DESC(), FOOTPRINT_DESC::FOOTPRINT_DESC(), PAD_DESC::PAD_DESC(), and PCB_FIELD_DESC::PCB_FIELD_DESC().
|
inline |
Definition at line 316 of file property.h.
References m_hideFromPropertiesManager, and PROPERTY_BASE().
Referenced by BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), BOARD_ITEM_DESC::BOARD_ITEM_DESC(), EDA_ITEM_DESC::EDA_ITEM_DESC(), PCB_FIELD_DESC::PCB_FIELD_DESC(), and ZONE_DESC::ZONE_DESC().
|
inline |
Definition at line 323 of file property.h.
References m_hideFromRulesEditor, and PROPERTY_BASE().
Referenced by BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), EDA_SHAPE_DESC::EDA_SHAPE_DESC(), EDA_TEXT_DESC::EDA_TEXT_DESC(), PCB_SHAPE_DESC::PCB_SHAPE_DESC(), and SCH_TABLECELL_DESC::SCH_TABLECELL_DESC().
|
privatepure virtual |
Implemented in PCB_FOOTPRINT_FIELD_PROPERTY, PROPERTY< Owner, T, Base >, PROPERTY< Owner, T, Owner >, PROPERTY_ENUM< Owner, T, Base >, and SCH_SYMBOL_FIELD_PROPERTY.
Referenced by INSPECTABLE::Set(), and set().
|
inline |
Definition at line 346 of file property.h.
References m_validator, and PROPERTY_BASE().
Referenced by EDA_SHAPE_DESC::EDA_SHAPE_DESC(), PAD_DESC::PAD_DESC(), SCH_SHEET_DESC::SCH_SHEET_DESC(), and ZONE_DESC::ZONE_DESC().
|
inline |
Definition at line 284 of file property.h.
References INSPECTABLE, m_writeableFunc, and PROPERTY_BASE().
Referenced by DIMENSION_DESC::DIMENSION_DESC(), PAD_DESC::PAD_DESC(), SCH_PIN_DESC::SCH_PIN_DESC(), and ZONE_DESC::ZONE_DESC().
|
pure virtual |
Return type-id of the property type.
Implemented in PCB_FOOTPRINT_FIELD_PROPERTY, PROPERTY< Owner, T, Base >, PROPERTY< Owner, T, Owner >, and SCH_SYMBOL_FIELD_PROPERTY.
Referenced by PCB_PROPERTIES_PANEL::createPGProperty(), PCBEXPR_UCODE::CreateVarRef(), and PGPropertyFactory().
|
inline |
Definition at line 352 of file property.h.
References m_validator.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlinevirtual |
Reimplemented in PCB_FOOTPRINT_FIELD_PROPERTY, PROPERTY< Owner, T, Base >, PROPERTY< Owner, T, Owner >, and SCH_SYMBOL_FIELD_PROPERTY.
Definition at line 279 of file property.h.
References INSPECTABLE, and m_writeableFunc.
Referenced by PROPERTY_MANAGER::IsWriteableFor(), PCB_FOOTPRINT_FIELD_PROPERTY::Writeable(), PROPERTY< Owner, T, Base >::Writeable(), and SCH_SYMBOL_FIELD_PROPERTY::Writeable().
|
friend |
Definition at line 456 of file property.h.
References INSPECTABLE.
Referenced by Available(), GetChoices(), INSPECTABLE, PROPERTY_BASE(), SetAvailableFunc(), SetChoicesFunc(), SetWriteableFunc(), PCB_FOOTPRINT_FIELD_PROPERTY::Writeable(), PROPERTY< Owner, T, Base >::Writeable(), Writeable(), and SCH_SYMBOL_FIELD_PROPERTY::Writeable().
|
private |
Eval to determine if prop is available.
Definition at line 448 of file property.h.
Referenced by Available(), PROPERTY_BASE(), and SetAvailableFunc().
|
private |
Definition at line 452 of file property.h.
Referenced by GetChoices(), HasChoices(), and SetChoicesFunc().
|
private |
The coordinate type controls how distances are mapped to the user coordinate system.
Definition at line 436 of file property.h.
Referenced by CoordType(), PROPERTY_BASE(), and SetCoordType().
|
private |
The display style controls how properties are edited in the properties manager GUI.
Definition at line 433 of file property.h.
Referenced by Display(), PROPERTY_BASE(), and SetDisplay().
|
private |
Optional group identifier.
Definition at line 446 of file property.h.
Referenced by Group(), and SetGroup().
|
private |
Definition at line 441 of file property.h.
Referenced by IsHiddenFromDesignEditors(), PROPERTY_BASE(), and SetIsHiddenFromDesignEditors().
|
private |
Definition at line 439 of file property.h.
Referenced by IsHiddenFromLibraryEditors(), PROPERTY_BASE(), and SetIsHiddenFromLibraryEditors().
|
private |
Definition at line 438 of file property.h.
Referenced by IsHiddenFromPropertiesManager(), PROPERTY_BASE(), and SetIsHiddenFromPropertiesManager().
|
private |
Definition at line 443 of file property.h.
Referenced by IsHiddenFromRulesEditor(), PROPERTY_BASE(), and SetIsHiddenFromRulesEditor().
|
private |
Permanent identifier for this property.
Property names are an API contract; changing them after release will impact the Custom DRC Rules system as well as the automatic API binding system. Never rename properties; instead deprecate them and hide them from the GUI.
Definition at line 430 of file property.h.
Referenced by Name(), and PROPERTY_BASE().
|
private |
Definition at line 454 of file property.h.
Referenced by SetValidator(), and Validate().
|
private |
Eval to determine if prop is read-only.
Definition at line 450 of file property.h.
Referenced by SetWriteableFunc(), and Writeable().