KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PROPERTY_BASE Class Referenceabstract

#include <property.h>

Inheritance diagram for PROPERTY_BASE:
PROPERTY< Owner, T, Owner > PROPERTY< Owner, T, Base > PROPERTY_ENUM< Owner, T, Base >

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_BASESetAvailableFunc (std::function< bool(INSPECTABLE *)> aFunc)
 Set a callback function to determine whether an object provides this property.
 
virtual bool Writeable (INSPECTABLE *aObject) const
 
PROPERTY_BASESetWriteableFunc (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_BASESetDisplay (PROPERTY_DISPLAY aDisplay)
 
ORIGIN_TRANSFORMS::COORD_TYPES_T CoordType () const
 
PROPERTY_BASESetCoordType (ORIGIN_TRANSFORMS::COORD_TYPES_T aType)
 
bool IsHiddenFromPropertiesManager () const
 
PROPERTY_BASESetIsHiddenFromPropertiesManager (bool aHide=true)
 
bool IsHiddenFromRulesEditor () const
 
PROPERTY_BASESetIsHiddenFromRulesEditor (bool aHide=true)
 
bool IsHiddenFromLibraryEditors () const
 
PROPERTY_BASESetIsHiddenFromLibraryEditors (bool aIsHidden=true)
 
bool IsHiddenFromDesignEditors () const
 
PROPERTY_BASESetIsHiddenFromDesignEditors (bool aIsHidden=true)
 
wxString Group () const
 
PROPERTY_BASESetGroup (const wxString &aGroup)
 
PROPERTY_BASESetValidator (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 >
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.
 
PROPERTY_VALIDATOR_FN m_validator
 

Friends

class INSPECTABLE
 

Detailed Description

Definition at line 192 of file property.h.

Constructor & Destructor Documentation

◆ PROPERTY_BASE()

PROPERTY_BASE::PROPERTY_BASE ( const wxString &  aName,
PROPERTY_DISPLAY  aDisplay = PT_DEFAULT,
ORIGIN_TRANSFORMS::COORD_TYPES_T  aCoordType = ORIGIN_TRANSFORMS::NOT_A_COORD 
)
inline

< Used to generate unique IDs. Must come up front so it's initialized before ctor.

Definition at line 198 of file property.h.

◆ ~PROPERTY_BASE()

virtual PROPERTY_BASE::~PROPERTY_BASE ( )
inlinevirtual

Definition at line 213 of file property.h.

Member Function Documentation

◆ Available()

bool PROPERTY_BASE::Available ( INSPECTABLE aObject) const
inline

Return true if aObject offers this PROPERTY.

Definition at line 249 of file property.h.

Referenced by BOOST_AUTO_TEST_CASE(), and PROPERTY_MANAGER::IsAvailableFor().

◆ BaseHash()

virtual size_t PROPERTY_BASE::BaseHash ( ) const
pure virtual

◆ Choices()

virtual const wxPGChoices & PROPERTY_BASE::Choices ( ) const
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 223 of file property.h.

References empty().

Referenced by BOOST_AUTO_TEST_CASE(), PCB_PROPERTIES_PANEL::createPGProperty(), and PGPropertyFactory().

◆ CoordType()

ORIGIN_TRANSFORMS::COORD_TYPES_T PROPERTY_BASE::CoordType ( ) const
inline

Definition at line 292 of file property.h.

Referenced by PGPropertyFactory().

◆ Display()

PROPERTY_DISPLAY PROPERTY_BASE::Display ( ) const
inline

Definition at line 289 of file property.h.

Referenced by PGPropertyFactory().

◆ get()

template<typename T >
T PROPERTY_BASE::get ( const void *  aObject) const
inlineprotected

Definition at line 390 of file property.h.

Referenced by INSPECTABLE::Get().

◆ getter()

virtual wxAny PROPERTY_BASE::getter ( const void *  aObject) const
privatepure virtual

◆ Group()

wxString PROPERTY_BASE::Group ( ) const
inline

Definition at line 327 of file property.h.

◆ HasChoices()

virtual bool PROPERTY_BASE::HasChoices ( ) const
inlinevirtual

Return true if this PROPERTY has a limited set of possible values.

See also
PROPERTY_BASE::Choices()

Reimplemented in PROPERTY_ENUM< Owner, T, Base >.

Definition at line 241 of file property.h.

Referenced by BOOST_AUTO_TEST_CASE(), PCB_PROPERTIES_PANEL::createPGProperty(), PCBEXPR_UCODE::CreateVarRef(), PROPERTIES_PANEL::getItemValue(), and PGPropertyFactory().

◆ IsHiddenFromDesignEditors()

bool PROPERTY_BASE::IsHiddenFromDesignEditors ( ) const
inline

Definition at line 320 of file property.h.

◆ IsHiddenFromLibraryEditors()

bool PROPERTY_BASE::IsHiddenFromLibraryEditors ( ) const
inline

Definition at line 313 of file property.h.

◆ IsHiddenFromPropertiesManager()

bool PROPERTY_BASE::IsHiddenFromPropertiesManager ( ) const
inline

Definition at line 299 of file property.h.

Referenced by PROPERTIES_PANEL::extractValueAndWritability().

◆ IsHiddenFromRulesEditor()

bool PROPERTY_BASE::IsHiddenFromRulesEditor ( ) const
inline

Definition at line 306 of file property.h.

◆ Name()

◆ NullValidator()

static VALIDATOR_RESULT PROPERTY_BASE::NullValidator ( const wxAny &&  aValue,
EDA_ITEM aItem 
)
inlinestatic

Definition at line 341 of file property.h.

◆ OwnerHash()

virtual size_t PROPERTY_BASE::OwnerHash ( ) const
pure virtual

◆ set()

template<typename T >
void PROPERTY_BASE::set ( void *  aObject,
aValue 
)
inlineprotected

◆ SetAvailableFunc()

◆ SetChoices()

virtual void PROPERTY_BASE::SetChoices ( const wxPGChoices &  aChoices)
inlinevirtual

Set the possible values for for the property.

Reimplemented in PROPERTY_ENUM< Owner, T, Base >.

Definition at line 232 of file property.h.

Referenced by SCH_PROPERTIES_PANEL::updateFontList(), and PCB_PROPERTIES_PANEL::updateLists().

◆ SetCoordType()

PROPERTY_BASE & PROPERTY_BASE::SetCoordType ( ORIGIN_TRANSFORMS::COORD_TYPES_T  aType)
inline

Definition at line 293 of file property.h.

◆ SetDisplay()

PROPERTY_BASE & PROPERTY_BASE::SetDisplay ( PROPERTY_DISPLAY  aDisplay)
inline

Definition at line 290 of file property.h.

◆ SetGroup()

PROPERTY_BASE & PROPERTY_BASE::SetGroup ( const wxString &  aGroup)
inline

Definition at line 328 of file property.h.

Referenced by PROPERTY_MANAGER::AddProperty().

◆ SetIsHiddenFromDesignEditors()

PROPERTY_BASE & PROPERTY_BASE::SetIsHiddenFromDesignEditors ( bool  aIsHidden = true)
inline

Definition at line 321 of file property.h.

Referenced by SCH_ITEM_DESC::SCH_ITEM_DESC().

◆ SetIsHiddenFromLibraryEditors()

PROPERTY_BASE & PROPERTY_BASE::SetIsHiddenFromLibraryEditors ( bool  aIsHidden = true)
inline

◆ SetIsHiddenFromPropertiesManager()

PROPERTY_BASE & PROPERTY_BASE::SetIsHiddenFromPropertiesManager ( bool  aHide = true)
inline

◆ SetIsHiddenFromRulesEditor()

PROPERTY_BASE & PROPERTY_BASE::SetIsHiddenFromRulesEditor ( bool  aHide = true)
inline

◆ setter()

virtual void PROPERTY_BASE::setter ( void *  aObject,
wxAny &  aValue 
)
privatepure virtual

◆ SetValidator()

PROPERTY_BASE & PROPERTY_BASE::SetValidator ( PROPERTY_VALIDATOR_FN &&  aValidator)
inline

Definition at line 330 of file property.h.

Referenced by PAD_DESC::PAD_DESC(), and ZONE_DESC::ZONE_DESC().

◆ SetWriteableFunc()

PROPERTY_BASE & PROPERTY_BASE::SetWriteableFunc ( std::function< bool(INSPECTABLE *)>  aFunc)
inline

◆ TypeHash()

virtual size_t PROPERTY_BASE::TypeHash ( ) const
pure virtual

◆ Validate()

VALIDATOR_RESULT PROPERTY_BASE::Validate ( const wxAny &&  aValue,
EDA_ITEM aItem 
)
inline

Definition at line 336 of file property.h.

◆ Writeable()

virtual bool PROPERTY_BASE::Writeable ( INSPECTABLE aObject) const
inlinevirtual

Friends And Related Function Documentation

◆ INSPECTABLE

friend class INSPECTABLE
friend

Definition at line 438 of file property.h.

Member Data Documentation

◆ m_availFunc

std::function<bool(INSPECTABLE*)> PROPERTY_BASE::m_availFunc
private

Eval to determine if prop is available.

Definition at line 432 of file property.h.

◆ m_coordType

ORIGIN_TRANSFORMS::COORD_TYPES_T PROPERTY_BASE::m_coordType
private

The coordinate type controls how distances are mapped to the user coordinate system.

Definition at line 420 of file property.h.

◆ m_display

PROPERTY_DISPLAY PROPERTY_BASE::m_display
private

The display style controls how properties are edited in the properties manager GUI.

Definition at line 417 of file property.h.

◆ m_group

wxString PROPERTY_BASE::m_group
private

Optional group identifier.

Definition at line 430 of file property.h.

◆ m_hideFromDesignEditors

bool PROPERTY_BASE::m_hideFromDesignEditors
private

Definition at line 425 of file property.h.

◆ m_hideFromLibraryEditors

bool PROPERTY_BASE::m_hideFromLibraryEditors
private

Definition at line 423 of file property.h.

◆ m_hideFromPropertiesManager

bool PROPERTY_BASE::m_hideFromPropertiesManager
private

Definition at line 422 of file property.h.

◆ m_hideFromRulesEditor

bool PROPERTY_BASE::m_hideFromRulesEditor
private

Definition at line 427 of file property.h.

◆ m_name

const wxString PROPERTY_BASE::m_name
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 414 of file property.h.

◆ m_validator

PROPERTY_VALIDATOR_FN PROPERTY_BASE::m_validator
private

Definition at line 436 of file property.h.

◆ m_writeableFunc

std::function<bool(INSPECTABLE*)> PROPERTY_BASE::m_writeableFunc
private

Eval to determine if prop is read-only.

Definition at line 434 of file property.h.


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