00001 #ifndef ENUMPROPERTY_H 00002 #define ENUMPROPERTY_H 00003 00004 #include "Types.h" 00005 #include "PointerProperty.h" 00006 00007 namespace RenderTools { 00008 00009 template< class T > 00010 class EnumProperty : public PointerProperty< T > { 00011 public: 00012 00013 EnumProperty( const shared_ptr< T > & pointer ): 00014 PointerProperty< T >( pointer ){ 00015 } 00016 00017 virtual void onInitialize( void ){ 00018 PointerProperty< T >::onInitialize(); 00019 } 00020 00021 virtual bool isEnum( void ) const { 00022 return( true ); 00023 } 00024 00025 virtual const string getTypeName( bool ofComponent = false ) const { 00026 T t; 00027 return( RenderTools::getTypeName( t, ofComponent ) ); 00028 } 00029 void setEnums( const EnumList & enums ){ 00030 m_enums = enums; 00031 sendPropertyEvent( PropertyEvent( PropertyEvent::CHANGED, getSharedPtr< AbstractProperty >() ) ); 00032 } 00033 00034 const EnumList & getEnums( void ) const { 00035 return( m_enums ); 00036 } 00037 00038 protected: 00039 EnumList m_enums; 00040 }; 00041 00042 00043 }; // namespace RenderTools 00044 00045 00046 #endif
1.5.8