MCPcopy Create free account
hub / github.com/SpartanJ/eepp / getPropertyString

Method getPropertyString

src/eepp/ui/uicodeeditor.cpp:3069–3117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3067}
3068
3069std::string UICodeEditor::getPropertyString( const PropertyDefinition* propertyDef,
3070 const Uint32& propertyIndex ) const {
3071 if ( NULL == propertyDef )
3072 return "";
3073
3074 switch ( propertyDef->getPropertyId() ) {
3075 case PropertyId::Locked:
3076 return isLocked() ? "true" : "false";
3077 case PropertyId::Color:
3078 return getFontColor().toHexString();
3079 case PropertyId::TextShadowColor:
3080 return getFontShadowColor().toHexString();
3081 case PropertyId::TextShadowOffset:
3082 return String::fromFloat( getFontShadowOffset().x ) + " " +
3083 String::fromFloat( getFontShadowOffset().y );
3084 case PropertyId::SelectionColor:
3085 return getFontSelectedColor().toHexString();
3086 case PropertyId::SelectionBackColor:
3087 return getFontSelectionBackColor().toHexString();
3088 case PropertyId::FontFamily:
3089 return NULL != getFont() ? getFont()->getName() : "";
3090 case PropertyId::FontSize:
3091 return String::fromFloat( PixelDensity::pxToDp( getFontSize() ), "dp" );
3092 case PropertyId::TextDecoration:
3093 return Text::styleFlagToString( getTextDecoration() );
3094 case PropertyId::FontStyle:
3095 return Text::styleFlagToString( getFontStyle() );
3096 case PropertyId::TextStrokeWidth:
3097 return String::fromFloat( PixelDensity::dpToPx( getOutlineThickness() ), "px" );
3098 case PropertyId::TextStrokeColor:
3099 return getOutlineColor().toHexString();
3100 case PropertyId::TextSelection:
3101 return isTextSelectionEnabled() ? "true" : "false";
3102 case PropertyId::LineSpacing:
3103 return getLineSpacing().toString();
3104 case PropertyId::EnableCodeEditorFlags:
3105 return getCodeEditorFlags( true );
3106 case PropertyId::DisableCodeEditorFlags:
3107 return getCodeEditorFlags( false );
3108 case PropertyId::LineWrapMode:
3109 return LineWrap::fromLineWrapMode( getLineWrapMode() );
3110 case PropertyId::LineWrapType:
3111 return LineWrap::fromLineWrapType( getLineWrapType() );
3112 case PropertyId::Text:
3113 return mDoc->getLineTextUtf8( 0 );
3114 default:
3115 return UIWidget::getPropertyString( propertyDef, propertyIndex );
3116 }
3117}
3118
3119std::vector<PropertyId> UICodeEditor::getPropertiesImplemented() const {
3120 auto props = UIWidget::getPropertiesImplemented();

Callers

nothing calls this directly

Calls 6

getPropertyIdMethod · 0.80
getLineTextUtf8Method · 0.80
getLineWrapModeFunction · 0.50
toHexStringMethod · 0.45
getNameMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected