const char* const PROPERTY_NAME_EMBOSS = "emboss";
const char* const PROPERTY_NAME_OUTLINE = "outline";
const char* const PROPERTY_NAME_BACKGROUND = "textBackground";
+const char* const PROPERTY_NAME_STRIKETHROUGH = "strikethrough";
const char* const PROPERTY_NAME_PIXEL_SIZE = "pixelSize";
const char* const PROPERTY_NAME_ELLIPSIS = "ellipsis";
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_FONT_SIZE_SCALE ) == DevelTextLabel::Property::FONT_SIZE_SCALE );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE ) == DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS_POSITION ) == DevelTextLabel::Property::ELLIPSIS_POSITION );
+ DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_STRIKETHROUGH ) == DevelTextLabel::Property::STRIKETHROUGH );
END_TEST;
}
label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ), Color::BLUE, TEST_LOCATION );
+ Property::Map strikethroughMapSet;
+ Property::Map strikethroughMapGet;
+
+ strikethroughMapSet.Insert( "enable", false );
+ strikethroughMapSet.Insert( "color", Color::BLUE );
+ strikethroughMapSet.Insert( "height", 2.0f );
+
+ label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+
+ strikethroughMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::STRIKETHROUGH );
+ DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION );
+
Property::Map underlineMapSet;
Property::Map underlineMapGet;
label.SetProperty( TextLabel::Property::LINE_SPACING, 10.f );
DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::LINE_SPACING ), 10.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ // Check the strikethrough property
+ strikethroughMapSet.Clear();
+ strikethroughMapSet.Insert( "enable", true );
+ strikethroughMapSet.Insert( "color", Color::RED );
+ strikethroughMapSet.Insert( "height", 2.0f );
+
+ label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+
+ application.SendNotification();
+ application.Render();
+
+ strikethroughMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::STRIKETHROUGH );
+ DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION );
+
+ strikethroughMapSet.Clear();
+ strikethroughMapSet.Insert( Toolkit::DevelText::Strikethrough::Property::ENABLE, true );
+ strikethroughMapSet.Insert( Toolkit::DevelText::Strikethrough::Property::COLOR, Color::RED );
+ strikethroughMapSet.Insert( Toolkit::DevelText::Strikethrough::Property::HEIGHT, 2.0f );
+
+ label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+
+ application.SendNotification();
+ application.Render();
+
+ strikethroughMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::STRIKETHROUGH );
+ DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+ std::vector<std::string> strikethroughIndicesConversionTable = { "enable", "color","height"};
+ DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet, strikethroughIndicesConversionTable ), true, TEST_LOCATION );
+
+ strikethroughMapSet.Clear();
+
+ Property::Map strikethroughDisabledMapGet;
+ strikethroughDisabledMapGet.Insert( "enable", false );
+ strikethroughDisabledMapGet.Insert( "color", Color::RED );
+ strikethroughDisabledMapGet.Insert( "height", 2.0f );
+
+ label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+
+ application.SendNotification();
+ application.Render();
+
+ strikethroughMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::STRIKETHROUGH );
+ DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughDisabledMapGet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughDisabledMapGet ), true, TEST_LOCATION );
+
// Check the underline property
underlineMapSet.Clear();
underlineMapSet.Insert( "enable", true );
shadowMap.Insert( "offset", Vector2( 1.0f, 1.0f ) );
label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
+ Property::Map strikethroughMap;
+ strikethroughMap.Insert( "enable", true );
+ strikethroughMap.Insert( "color", Color::GREEN );
+ strikethroughMap.Insert( "height", 2.0f );
+ label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMap );
+
try
{
// Render some text with the shared atlas backend
label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE );
+ Property::Map strikethroughMapSet;
+ strikethroughMapSet.Clear();
+ strikethroughMapSet.Insert( "enable", true );
+ strikethroughMapSet.Insert( "color", Color::RED );
+ strikethroughMapSet.Insert( "height", 2.0f );
+ label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+ label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE );
+
application.GetScene().Add( label );
application.SendNotification();
END_TEST;
}
+int UtcDaliToolkitTextlabelStrikethroughExceedsWidthAndHeight(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelStrikethroughExceedsWidthAndHeight");
+
+ TextLabel label = TextLabel::New();
+ label.SetProperty( TextLabel::Property::TEXT, "Test" );
+ label.SetProperty( TextLabel::Property::FONT_FAMILY, "DejaVu Sans");
+
+ //Exeeding BufferWidth
+ label.SetProperty(Actor::Property::SIZE, Vector2(200.f, 400.0f));
+ label.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, HorizontalAlignment::RIGHT);
+ label.SetProperty(TextLabel::Property::POINT_SIZE, 200.f);
+
+ application.GetScene().Add( label );
+ application.SendNotification();
+ application.Render();
+
+ Property::Map strikethroughMapSet;
+ strikethroughMapSet.Clear();
+ strikethroughMapSet.Insert( "enable", true );
+ strikethroughMapSet.Insert( "color", Color::BLUE);
+ strikethroughMapSet.Insert( "height", 2.0f);
+ label.SetProperty( TextLabel::Property::TEXT, "Test1" );
+ label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+ label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE );
+ application.GetScene().Add( label );
+ application.SendNotification();
+ application.Render();
+ // Check if the number of renderers is 1.
+ DALI_TEST_EQUALS( 1, label.GetRendererCount(), TEST_LOCATION);
+
+
+ label = TextLabel::New();
+ label.SetProperty( TextLabel::Property::TEXT, "Test" );
+ label.SetProperty( TextLabel::Property::FONT_FAMILY, "DejaVu Sans");
+
+ //Exeeding BufferHeight
+ label.SetProperty(Actor::Property::SIZE, Vector2(200.f, 100.0f));
+ label.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, HorizontalAlignment::RIGHT);
+ label.SetProperty(TextLabel::Property::POINT_SIZE, 200.f);
+
+ application.GetScene().Add( label );
+ application.SendNotification();
+ application.Render();
+
+ strikethroughMapSet.Clear();
+ strikethroughMapSet.Insert( "enable", true );
+ strikethroughMapSet.Insert( "color", Color::BLUE);
+ strikethroughMapSet.Insert( "height", 2.0f);
+ label.SetProperty( TextLabel::Property::TEXT, "Test2" );
+ label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+ label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE );
+ application.GetScene().Add( label );
+ application.SendNotification();
+ application.Render();
+ // Check if the number of renderers is 1.
+ DALI_TEST_EQUALS( 1, label.GetRendererCount(), TEST_LOCATION);
+
+ END_TEST;
+}
+
int UtcDaliToolkitTextlabelLastCharacterIndex(void)
{
ToolkitTestApplication application;
END_TEST;
}
-
int utcDaliTextLabelGetHeightForWidthChangeLineCountWhenTextChanged(void)
{
ToolkitTestApplication application;
END_TEST;
}
+
+int UtcDaliToolkitTextLabelStrikethroughGeneration(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextLabelStrikethroughGeneration");
+
+ TextLabel textLabel = TextLabel::New();
+ textLabel.SetProperty( TextLabel::Property::TEXT, "Test" );
+ textLabel.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 100.f ) );
+ textLabel.SetProperty( TextLabel::Property::POINT_SIZE, 10) ;
+ textLabel.SetProperty( TextLabel::Property::FONT_FAMILY, "DejaVu Sans");
+
+ application.GetScene().Add( textLabel );
+ application.SendNotification();
+ application.Render();
+
+ Property::Map strikethroughMapSet;
+ Property::Map strikethroughMapGet;
+
+ strikethroughMapSet.Insert( "enable", true );
+ strikethroughMapSet.Insert( "color", Color::RED );
+ strikethroughMapSet.Insert( "height", 2.0f );
+
+ // Check the strikethrough property
+ textLabel.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+ strikethroughMapGet = textLabel.GetProperty<Property::Map>( DevelTextLabel::Property::STRIKETHROUGH );
+ textLabel.SetProperty( TextLabel::Property::TEXT, "Test1" );
+ DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ strikethroughMapSet.Clear();
+ strikethroughMapGet.Clear();
+
+ END_TEST;
+}
\ No newline at end of file