KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PROPERTY_ENUM< Owner, T, Base > Class Template Reference

#include <property.h>

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

Public Types

using BASE_TYPE
 

Public Member Functions

template<typename SetType, typename GetType>
 PROPERTY_ENUM (const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)(), PROPERTY_DISPLAY aDisplay=PT_DEFAULT)
 
template<typename SetType, typename GetType>
 PROPERTY_ENUM (const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)() const, PROPERTY_DISPLAY aDisplay=PT_DEFAULT, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType=ORIGIN_TRANSFORMS::NOT_A_COORD)
 
void setter (void *obj, wxAny &v) override
 
wxAny getter (const void *obj) const override
 Set method.
 
const wxPGChoices & Choices () const override
 Return a limited set of possible values (e.g.
 
void SetChoices (const wxPGChoices &aChoices) override
 Set the possible values for for the property.
 
bool HasChoices () const override
 Return true if this PROPERTY has a limited set of possible values.
 
size_t OwnerHash () const override
 Return type-id of the Owner class.
 
size_t BaseHash () const override
 Return type-id of the Base class.
 
size_t TypeHash () const override
 Return type-id of the property type.
 
bool Writeable (INSPECTABLE *aObject) const override
 
const wxString & Name () const
 
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.
 
wxPGChoices GetChoices (INSPECTABLE *aObject) const
 
PROPERTY_BASESetChoicesFunc (std::function< wxPGChoices(INSPECTABLE *)> aFunc)
 
PROPERTY_BASESetWriteableFunc (std::function< bool(INSPECTABLE *)> aFunc)
 
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

void set (void *aObject, T aValue)
 
T get (const void *aObject) const
 

Protected Attributes

wxPGChoices m_choices
 
std::unique_ptr< SETTER_BASE< Owner, T > > m_setter
 Get method.
 
std::unique_ptr< GETTER_BASE< Owner, T > > m_getter
 Owner class type-id.
 
const size_t m_ownerHash
 Base class type-id.
 
const size_t m_baseHash
 Property value type-id.
 
const size_t m_typeHash
 

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
 

Detailed Description

template<typename Owner, typename T, typename Base = Owner>
class PROPERTY_ENUM< Owner, T, Base >

Definition at line 566 of file property.h.

Member Typedef Documentation

◆ BASE_TYPE

using PROPERTY< Owner, T, Owner >::BASE_TYPE
inherited

Definition at line 464 of file property.h.

Constructor & Destructor Documentation

◆ PROPERTY_ENUM() [1/2]

template<typename Owner, typename T, typename Base = Owner>
template<typename SetType, typename GetType>
PROPERTY_ENUM< Owner, T, Base >::PROPERTY_ENUM ( const wxString & aName,
void(Base::* aSetter )(SetType),
GetType(Base::* aGetter )(),
PROPERTY_DISPLAY aDisplay = PT_DEFAULT )
inline

◆ PROPERTY_ENUM() [2/2]

template<typename Owner, typename T, typename Base = Owner>
template<typename SetType, typename GetType>
PROPERTY_ENUM< Owner, T, Base >::PROPERTY_ENUM ( const wxString & aName,
void(Base::* aSetter )(SetType),
GetType(Base::* aGetter )() const,
PROPERTY_DISPLAY aDisplay = PT_DEFAULT,
ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType = ORIGIN_TRANSFORMS::NOT_A_COORD )
inline

Member Function Documentation

◆ Available()

bool PROPERTY_BASE::Available ( INSPECTABLE * aObject) const
inlineinherited

Return true if aObject offers this PROPERTY.

Definition at line 251 of file property.h.

◆ BaseHash()

size_t PROPERTY< Owner, T, Owner >::BaseHash ( ) const
inlineoverridevirtualinherited

Return type-id of the Base class.

Implements PROPERTY_BASE.

Definition at line 497 of file property.h.

◆ Choices()

template<typename Owner, typename T, typename Base = Owner>
const wxPGChoices & PROPERTY_ENUM< Owner, T, Base >::Choices ( ) const
inlineoverridevirtual

Return a limited set of possible values (e.g.

enum). Check with HasChoices() if a particular PROPERTY provides such set.

Reimplemented from PROPERTY_BASE.

Definition at line 632 of file property.h.

References ENUM_MAP< T >::Instance(), and m_choices.

Referenced by HasChoices().

◆ CoordType()

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

Definition at line 308 of file property.h.

◆ Display()

PROPERTY_DISPLAY PROPERTY_BASE::Display ( ) const
inlineinherited

Definition at line 305 of file property.h.

◆ get()

T PROPERTY_BASE::get ( const void * aObject) const
inlineprotectedinherited

Definition at line 406 of file property.h.

◆ GetChoices()

wxPGChoices PROPERTY_BASE::GetChoices ( INSPECTABLE * aObject) const
inlineinherited

Definition at line 265 of file property.h.

◆ getter()

template<typename Owner, typename T, typename Base = Owner>
wxAny PROPERTY_ENUM< Owner, T, Base >::getter ( const void * obj) const
inlineoverridevirtual

Set method.

Reimplemented from PROPERTY< Owner, T, Owner >.

Definition at line 625 of file property.h.

References PROPERTY< Owner, T, Base >::m_getter, res, and T.

◆ Group()

wxString PROPERTY_BASE::Group ( ) const
inlineinherited

Definition at line 343 of file property.h.

◆ HasChoices()

template<typename Owner, typename T, typename Base = Owner>
bool PROPERTY_ENUM< Owner, T, Base >::HasChoices ( ) const
inlineoverridevirtual

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

See also
PROPERTY_BASE::Choices()

Reimplemented from PROPERTY_BASE.

Definition at line 642 of file property.h.

References Choices().

◆ IsHiddenFromDesignEditors()

bool PROPERTY_BASE::IsHiddenFromDesignEditors ( ) const
inlineinherited

Definition at line 336 of file property.h.

◆ IsHiddenFromLibraryEditors()

bool PROPERTY_BASE::IsHiddenFromLibraryEditors ( ) const
inlineinherited

Definition at line 329 of file property.h.

◆ IsHiddenFromPropertiesManager()

bool PROPERTY_BASE::IsHiddenFromPropertiesManager ( ) const
inlineinherited

Definition at line 315 of file property.h.

◆ IsHiddenFromRulesEditor()

bool PROPERTY_BASE::IsHiddenFromRulesEditor ( ) const
inlineinherited

Definition at line 322 of file property.h.

◆ Name()

const wxString & PROPERTY_BASE::Name ( ) const
inlineinherited

Definition at line 219 of file property.h.

◆ NullValidator()

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

Definition at line 357 of file property.h.

◆ OwnerHash()

size_t PROPERTY< Owner, T, Owner >::OwnerHash ( ) const
inlineoverridevirtualinherited

Return type-id of the Owner class.

Implements PROPERTY_BASE.

Definition at line 492 of file property.h.

◆ set()

void PROPERTY_BASE::set ( void * aObject,
T aValue )
inlineprotectedinherited

Definition at line 364 of file property.h.

◆ SetAvailableFunc()

PROPERTY_BASE & PROPERTY_BASE::SetAvailableFunc ( std::function< bool(INSPECTABLE *)> aFunc)
inlineinherited

Set a callback function to determine whether an object provides this property.

Definition at line 259 of file property.h.

◆ SetChoices()

template<typename Owner, typename T, typename Base = Owner>
void PROPERTY_ENUM< Owner, T, Base >::SetChoices ( const wxPGChoices & aChoices)
inlineoverridevirtual

Set the possible values for for the property.

Reimplemented from PROPERTY_BASE.

Definition at line 637 of file property.h.

References m_choices.

◆ SetChoicesFunc()

PROPERTY_BASE & PROPERTY_BASE::SetChoicesFunc ( std::function< wxPGChoices(INSPECTABLE *)> aFunc)
inlineinherited

Definition at line 273 of file property.h.

◆ SetCoordType()

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

Definition at line 309 of file property.h.

◆ SetDisplay()

PROPERTY_BASE & PROPERTY_BASE::SetDisplay ( PROPERTY_DISPLAY aDisplay)
inlineinherited

Definition at line 306 of file property.h.

◆ SetGroup()

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

Definition at line 344 of file property.h.

◆ SetIsHiddenFromDesignEditors()

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

Definition at line 337 of file property.h.

◆ SetIsHiddenFromLibraryEditors()

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

Definition at line 330 of file property.h.

◆ SetIsHiddenFromPropertiesManager()

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

Definition at line 316 of file property.h.

◆ SetIsHiddenFromRulesEditor()

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

Definition at line 323 of file property.h.

◆ setter()

template<typename Owner, typename T, typename Base = Owner>
void PROPERTY_ENUM< Owner, T, Base >::setter ( void * obj,
wxAny & v )
inlineoverridevirtual

Reimplemented from PROPERTY< Owner, T, Owner >.

Definition at line 604 of file property.h.

References PROPERTY< Owner, T, Base >::m_setter, and T.

◆ SetValidator()

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

Definition at line 346 of file property.h.

◆ SetWriteableFunc()

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

Definition at line 284 of file property.h.

◆ TypeHash()

size_t PROPERTY< Owner, T, Owner >::TypeHash ( ) const
inlineoverridevirtualinherited

Return type-id of the property type.

Implements PROPERTY_BASE.

Definition at line 502 of file property.h.

◆ Validate()

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

Definition at line 352 of file property.h.

◆ Writeable()

bool PROPERTY< Owner, T, Owner >::Writeable ( INSPECTABLE * aObject) const
inlineoverridevirtualinherited

Reimplemented from PROPERTY_BASE.

Definition at line 507 of file property.h.

Member Data Documentation

◆ m_availFunc

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

Eval to determine if prop is available.

Definition at line 448 of file property.h.

◆ m_baseHash

const size_t PROPERTY< Owner, T, Owner >::m_baseHash
protectedinherited

Property value type-id.

Definition at line 558 of file property.h.

◆ m_choices

template<typename Owner, typename T, typename Base = Owner>
wxPGChoices PROPERTY_ENUM< Owner, T, Base >::m_choices
protected

Definition at line 648 of file property.h.

Referenced by Choices(), PROPERTY_ENUM(), PROPERTY_ENUM(), and SetChoices().

◆ m_choicesFunc

std::function<wxPGChoices(INSPECTABLE*)> PROPERTY_BASE::m_choicesFunc
privateinherited

Definition at line 452 of file property.h.

◆ m_coordType

ORIGIN_TRANSFORMS::COORD_TYPES_T PROPERTY_BASE::m_coordType
privateinherited

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

Definition at line 436 of file property.h.

◆ m_display

PROPERTY_DISPLAY PROPERTY_BASE::m_display
privateinherited

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

Definition at line 433 of file property.h.

◆ m_getter

std::unique_ptr<GETTER_BASE<Owner, T> > PROPERTY< Owner, T, Owner >::m_getter
protectedinherited

Owner class type-id.

Definition at line 552 of file property.h.

◆ m_group

wxString PROPERTY_BASE::m_group
privateinherited

Optional group identifier.

Definition at line 446 of file property.h.

◆ m_hideFromDesignEditors

bool PROPERTY_BASE::m_hideFromDesignEditors
privateinherited

Definition at line 441 of file property.h.

◆ m_hideFromLibraryEditors

bool PROPERTY_BASE::m_hideFromLibraryEditors
privateinherited

Definition at line 439 of file property.h.

◆ m_hideFromPropertiesManager

bool PROPERTY_BASE::m_hideFromPropertiesManager
privateinherited

Definition at line 438 of file property.h.

◆ m_hideFromRulesEditor

bool PROPERTY_BASE::m_hideFromRulesEditor
privateinherited

Definition at line 443 of file property.h.

◆ m_name

const wxString PROPERTY_BASE::m_name
privateinherited

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.

◆ m_ownerHash

const size_t PROPERTY< Owner, T, Owner >::m_ownerHash
protectedinherited

Base class type-id.

Definition at line 555 of file property.h.

◆ m_setter

std::unique_ptr<SETTER_BASE<Owner, T> > PROPERTY< Owner, T, Owner >::m_setter
protectedinherited

Get method.

Definition at line 549 of file property.h.

◆ m_typeHash

const size_t PROPERTY< Owner, T, Owner >::m_typeHash
protectedinherited

Definition at line 561 of file property.h.

◆ m_validator

PROPERTY_VALIDATOR_FN PROPERTY_BASE::m_validator
privateinherited

Definition at line 454 of file property.h.

◆ m_writeableFunc

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

Eval to determine if prop is read-only.

Definition at line 450 of file property.h.


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