diff --git a/common/property_mgr.cpp b/common/property_mgr.cpp index 02ead2f271..ee8569631b 100644 --- a/common/property_mgr.cpp +++ b/common/property_mgr.cpp @@ -212,3 +212,39 @@ void PROPERTY_MANAGER::CLASS_DESC::collectPropsRecur( PROPERTY_LIST& aResult, PR for( const auto& base : m_bases ) base.get().collectPropsRecur( aResult, aReplaced ); } + +std::vector PROPERTY_MANAGER::GetMatchingClasses( PROPERTY_BASE* aProperty ) +{ + std::vector ids; + + for( auto& cls : m_classes ) + { + CLASS_INFO info; + + for( auto prop : cls.second.m_allProperties ) + info.properties.push_back(prop); + + + } + + return ids; +} + +PROPERTY_MANAGER::CLASSES_INFO PROPERTY_MANAGER::GetAllClasses() +{ + CLASSES_INFO rv; + for( auto& cls : m_classes ) + { + CLASS_INFO info; + + info.type = cls.first; + info.name = m_classNames[cls.first]; + + for( auto prop : cls.second.m_allProperties ) + info.properties.push_back(prop); + + rv.push_back(info); + } + + return rv; +} diff --git a/include/property_mgr.h b/include/property_mgr.h index 1fb084e255..665e1317fa 100644 --- a/include/property_mgr.h +++ b/include/property_mgr.h @@ -172,6 +172,19 @@ public: */ void Rebuild(); + struct CLASS_INFO + { + wxString name; + TYPE_ID type; + std::vector properties; + }; + + typedef std::vector CLASSES_INFO; + + CLASSES_INFO GetAllClasses(); + + std::vector GetMatchingClasses( PROPERTY_BASE* aProperty ); + private: PROPERTY_MANAGER() : m_dirty( false ), m_units( EDA_UNITS::MILLIMETRES )