extern void ITs_text_label_cleanup(void);
extern void ITs_toolkit_startup(void);
extern void ITs_toolkit_cleanup(void);
-
+//~
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityLabel(void);
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityTrait(void);
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityValue(void);
extern int ITcTextFieldCopy(void);
extern int ITcTextFieldTextChangedSignal(void);
extern int ITcTextLabelNewDownCast(void);
-extern int ITcTextLabelNewWithTextAssignment(void);
+extern int ITcTextLabelGetSetPropertiesWithAssignment(void);
extern int ITcTextLabelNewWithTextCopy(void);
extern int ITcToolkitIsVertical(void);
extern int ITcToolkitIsHorizontal(void);
{"ITcTextFieldCopy", ITcTextFieldCopy, ITs_text_field_startup, ITs_text_field_cleanup},
{"ITcTextFieldTextChangedSignal", ITcTextFieldTextChangedSignal, ITs_text_field_startup, ITs_text_field_cleanup},
{"ITcTextLabelNewDownCast", ITcTextLabelNewDownCast, ITs_text_label_startup, ITs_text_label_cleanup},
- {"ITcTextLabelNewWithTextAssignment", ITcTextLabelNewWithTextAssignment, ITs_text_label_startup, ITs_text_label_cleanup},
+ {"ITcTextLabelGetSetPropertiesWithAssignment", ITcTextLabelGetSetPropertiesWithAssignment, ITs_text_label_startup, ITs_text_label_cleanup},
{"ITcTextLabelNewWithTextCopy", ITcTextLabelNewWithTextCopy, ITs_text_label_startup, ITs_text_label_cleanup},
{"ITcToolkitIsVertical", ITcToolkitIsVertical, ITs_toolkit_startup, ITs_toolkit_cleanup},
{"ITcToolkitIsHorizontal", ITcToolkitIsHorizontal, ITs_toolkit_startup, ITs_toolkit_cleanup},
extern void ITs_text_label_cleanup(void);
extern void ITs_toolkit_startup(void);
extern void ITs_toolkit_cleanup(void);
-
+//~
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityLabel(void);
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityTrait(void);
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityValue(void);
extern int ITcTextFieldCopy(void);
extern int ITcTextFieldTextChangedSignal(void);
extern int ITcTextLabelNewDownCast(void);
-extern int ITcTextLabelNewWithTextAssignment(void);
+extern int ITcTextLabelGetSetPropertiesWithAssignment(void);
extern int ITcTextLabelNewWithTextCopy(void);
extern int ITcToolkitIsVertical(void);
extern int ITcToolkitIsHorizontal(void);
{"ITcTextFieldCopy", ITcTextFieldCopy, ITs_text_field_startup, ITs_text_field_cleanup},
{"ITcTextFieldTextChangedSignal", ITcTextFieldTextChangedSignal, ITs_text_field_startup, ITs_text_field_cleanup},
{"ITcTextLabelNewDownCast", ITcTextLabelNewDownCast, ITs_text_label_startup, ITs_text_label_cleanup},
- {"ITcTextLabelNewWithTextAssignment", ITcTextLabelNewWithTextAssignment, ITs_text_label_startup, ITs_text_label_cleanup},
+ {"ITcTextLabelGetSetPropertiesWithAssignment", ITcTextLabelGetSetPropertiesWithAssignment, ITs_text_label_startup, ITs_text_label_cleanup},
{"ITcTextLabelNewWithTextCopy", ITcTextLabelNewWithTextCopy, ITs_text_label_startup, ITs_text_label_cleanup},
{"ITcToolkitIsVertical", ITcToolkitIsVertical, ITs_toolkit_startup, ITs_toolkit_cleanup},
{"ITcToolkitIsHorizontal", ITcToolkitIsHorizontal, ITs_toolkit_startup, ITs_toolkit_cleanup},
extern void ITs_text_label_cleanup(void);
extern void ITs_toolkit_startup(void);
extern void ITs_toolkit_cleanup(void);
-
+//~
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityLabel(void);
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityTrait(void);
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityValue(void);
extern int ITcTextFieldCopy(void);
extern int ITcTextFieldTextChangedSignal(void);
extern int ITcTextLabelNewDownCast(void);
-extern int ITcTextLabelNewWithTextAssignment(void);
+extern int ITcTextLabelGetSetPropertiesWithAssignment(void);
extern int ITcTextLabelNewWithTextCopy(void);
extern int ITcToolkitIsVertical(void);
extern int ITcToolkitIsHorizontal(void);
{"ITcTextFieldCopy", ITcTextFieldCopy, ITs_text_field_startup, ITs_text_field_cleanup},
{"ITcTextFieldTextChangedSignal", ITcTextFieldTextChangedSignal, ITs_text_field_startup, ITs_text_field_cleanup},
{"ITcTextLabelNewDownCast", ITcTextLabelNewDownCast, ITs_text_label_startup, ITs_text_label_cleanup},
- {"ITcTextLabelNewWithTextAssignment", ITcTextLabelNewWithTextAssignment, ITs_text_label_startup, ITs_text_label_cleanup},
+ {"ITcTextLabelGetSetPropertiesWithAssignment", ITcTextLabelGetSetPropertiesWithAssignment, ITs_text_label_startup, ITs_text_label_cleanup},
{"ITcTextLabelNewWithTextCopy", ITcTextLabelNewWithTextCopy, ITs_text_label_startup, ITs_text_label_cleanup},
{"ITcToolkitIsVertical", ITcToolkitIsVertical, ITs_toolkit_startup, ITs_toolkit_cleanup},
{"ITcToolkitIsHorizontal", ITcToolkitIsHorizontal, ITs_toolkit_startup, ITs_toolkit_cleanup},
extern void ITs_text_label_cleanup(void);
extern void ITs_toolkit_startup(void);
extern void ITs_toolkit_cleanup(void);
-
+//~
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityLabel(void);
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityTrait(void);
extern int ITcAccessibilityManagerSetGetAccessibilityAttributeWithAccessibilityValue(void);
extern int ITcTextFieldCopy(void);
extern int ITcTextFieldTextChangedSignal(void);
extern int ITcTextLabelNewDownCast(void);
-extern int ITcTextLabelNewWithTextAssignment(void);
+extern int ITcTextLabelGetSetPropertiesWithAssignment(void);
extern int ITcTextLabelNewWithTextCopy(void);
extern int ITcToolkitIsVertical(void);
extern int ITcToolkitIsHorizontal(void);
{"ITcTextFieldCopy", ITcTextFieldCopy, ITs_text_field_startup, ITs_text_field_cleanup},
{"ITcTextFieldTextChangedSignal", ITcTextFieldTextChangedSignal, ITs_text_field_startup, ITs_text_field_cleanup},
{"ITcTextLabelNewDownCast", ITcTextLabelNewDownCast, ITs_text_label_startup, ITs_text_label_cleanup},
- {"ITcTextLabelNewWithTextAssignment", ITcTextLabelNewWithTextAssignment, ITs_text_label_startup, ITs_text_label_cleanup},
+ {"ITcTextLabelGetSetPropertiesWithAssignment", ITcTextLabelGetSetPropertiesWithAssignment, ITs_text_label_startup, ITs_text_label_cleanup},
{"ITcTextLabelNewWithTextCopy", ITcTextLabelNewWithTextCopy, ITs_text_label_startup, ITs_text_label_cleanup},
{"ITcToolkitIsVertical", ITcToolkitIsVertical, ITs_toolkit_startup, ITs_toolkit_cleanup},
{"ITcToolkitIsHorizontal", ITcToolkitIsHorizontal, ITs_toolkit_startup, ITs_toolkit_cleanup},
*/
void TextLabelNewDownCast();
-void TextLabelNewWithTextAssignment();
+void TextLabelGetSetPropertiesWithAssignment();
void TextLabelNewWithTextCopy();
namespace
{
enum TEST_CASES_LIST_TEXT_LABEL
{
- TEXT_LABEL_NEW_DOWNCAST,
- TEXT_LABEL_NEW_WITH_TEXT_ASSIGNMENT,
- TEXT_LABEL_NEW_WITH_TEXT_COPY
+ TEXT_LABEL_NEW_DOWNCAST,
+ TEXT_LABEL_GET_SET_PROPERTIES_WITH_ASSIGNMENT,
+ TEXT_LABEL_NEW_WITH_TEXT_COPY
};
struct TextLabel_TestApp : public ConnectionTracker
TextLabelNewDownCast();
break;
}
- case TEXT_LABEL_NEW_WITH_TEXT_ASSIGNMENT:
+ case TEXT_LABEL_GET_SET_PROPERTIES_WITH_ASSIGNMENT:
{
- TextLabelNewWithTextAssignment();
+ TextLabelGetSetPropertiesWithAssignment();
break;
}
case TEXT_LABEL_NEW_WITH_TEXT_COPY:
DaliLog::PrintPass();
}
-void TextLabelNewWithTextAssignment()
+void TextLabelGetSetPropertiesWithAssignment()
{
OPEN_GL_FREATURE_CHECK(SUITE_NAME,__LINE__)
- TextLabel textLabelAssign;
- const string STR_TEXT = "DALi Toolkit Text Label";
- const string STR_HORIZONAL = "END";
- const string STR_VERTICAL = "CENTER";
- bool bMultyLine = true, bMultyLineGet = false;
-
- string strTextGet = "", strHorAlignGet = "", strVertAlignGet = "";
-
- TextLabel textLabel = TextLabel::New( STR_TEXT );
- DALI_CHECK_INSTANCE( textLabel, "TextLabel::New(const string&) is failed." );
-
- textLabel.SetProperty( TextLabel::Property::MULTI_LINE, bMultyLine );
- textLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, STR_HORIZONAL );
- textLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, STR_VERTICAL );
-
- textLabelAssign = textLabel;
- DALI_CHECK_INSTANCE( textLabelAssign, "TextLabel handle is empty after assignment." );
-
- strTextGet = textLabelAssign.GetProperty<string>( TextLabel::Property::TEXT );
- DALI_CHECK_FAIL( strTextGet != STR_TEXT, "TextLabel::operator= is failed along with set text." );
- bMultyLineGet = textLabelAssign.GetProperty<bool>( TextLabel::Property::MULTI_LINE );
- DALI_CHECK_FAIL( bMultyLineGet != bMultyLine, "TextLabel::operator= is failed along with set multy line status." );
+ const int SCROLL_SPEED = 80;
+ const int SCROLL_LOOPS = 4;
+ const float SCROLL_GAP = 50.0f;
+ const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL = "enableAutoScroll";
+ const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_SPEED = "autoScrollSpeed";
+ const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_LOOPS = "autoScrollLoopCount";
+ const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_GAP = "autoScrollGap";
+
+ TextLabel label = TextLabel::New();
+ DALI_CHECK_INSTANCE( label, "TextLabel::New() is failed." );
+
+ label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS );
+ DALI_CHECK_FAIL( (Text::RenderingType)label.GetProperty<int>( TextLabel::Property::RENDERING_BACKEND ) != Text::RENDERING_SHARED_ATLAS, "TextLabel rendering set/get failed.");
+
+ label.SetProperty( TextLabel::Property::TEXT, "Setting Text" );
+ DALI_CHECK_FAIL( label.GetProperty<std::string>( TextLabel::Property::TEXT ) != std::string("Setting Text"), "TextLabel text set/get failed." );
+
+ label.SetProperty( TextLabel::Property::FONT_FAMILY, "Setting font family" );
+ DALI_CHECK_FAIL( label.GetProperty<std::string>( TextLabel::Property::FONT_FAMILY ) != std::string("Setting font family"), "TextLabel font family set/get failed." );
+ label.SetProperty( TextLabel::Property::FONT_STYLE, "Setting font style" );
+ DALI_CHECK_FAIL( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ) != std::string("Setting font style"), "TextLabel font style set/get failed." );
+ label.SetProperty( TextLabel::Property::POINT_SIZE, 10.f );
+ DALI_CHECK_FAIL( label.GetProperty<float>( TextLabel::Property::POINT_SIZE ) != 10.f, "TextLabel point size set/get failed." );
+
+ label.SetProperty( TextLabel::Property::MULTI_LINE, true );
+ DALI_CHECK_FAIL( !label.GetProperty<bool>( TextLabel::Property::MULTI_LINE ), "TextLabel multiline set/get failed." );
+
+ label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+ DALI_CHECK_FAIL( label.GetProperty<std::string>( TextLabel::Property::HORIZONTAL_ALIGNMENT ) != "CENTER", "TextLabel horizontal alignment set/get failed." );
+ label.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+ DALI_CHECK_FAIL( label.GetProperty<std::string>( TextLabel::Property::VERTICAL_ALIGNMENT ) != "CENTER", "TextLabel vertical alignment set/get failed." );
+
+ label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
+ DALI_CHECK_FAIL( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) != Color::BLUE, "TextLabel color set/get failed." );
+ DALI_CHECK_FAIL( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ) != Color::BLUE, "TextLabel color set/get failed." );
+
+ label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 3.0f, 3.0f ) );
+ DALI_CHECK_FAIL( label.GetProperty<Vector2>( TextLabel::Property::SHADOW_OFFSET ) != Vector2( 3.0f, 3.0f ), "TextLabel shadoe offset set/get failed." );
+ label.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLUE );
+ DALI_CHECK_FAIL( label.GetProperty<Vector4>( TextLabel::Property::SHADOW_COLOR ) != Color::BLUE, "TextLabel shadow color set/get failed." );
+
+ label.SetProperty( TextLabel::Property::UNDERLINE_ENABLED, true );
+ DALI_CHECK_FAIL( !label.GetProperty<bool>( TextLabel::Property::UNDERLINE_ENABLED ), "TextLabel underline enable set/get failed." );
+ label.SetProperty( TextLabel::Property::UNDERLINE_COLOR, Color::RED );
+ DALI_CHECK_FAIL( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ) != Color::RED, "TextLabel underline color set/get failed." );
+ label.SetProperty( TextLabel::Property::UNDERLINE_HEIGHT, 1.0f );
+ DALI_CHECK_FAIL( label.GetProperty<float>( TextLabel::Property::UNDERLINE_HEIGHT ) != 1.0f, "TextLabel underline height set/get failed." );
+
+ TextLabel label2 = TextLabel::New( "New text" );
+ DALI_CHECK_FAIL( !label2,"TextLabel TextLabel::New(const string) failed.");
+ DALI_CHECK_FAIL( label2.GetProperty<std::string>( TextLabel::Property::TEXT ) != std::string("New text"), "TextLabel text set/get failed." );
+
+ DALI_CHECK_FAIL( label.GetProperty<bool>( TextLabel::Property::ENABLE_MARKUP ),"TextLabel enable markup failed." );
+ label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
+ DALI_CHECK_FAIL( !label.GetProperty<bool>( TextLabel::Property::ENABLE_MARKUP ),"TextLabel enable markup set/get failed." );
+
+ label.SetProperty( TextLabel::Property::MULTI_LINE, false ); // Autoscroll only supported in single line
+ DALI_CHECK_FAIL( label.GetProperty<bool>( TextLabel::Property::ENABLE_AUTO_SCROLL ), "TextLabel enable auto scroll failed." );
+ label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+ DALI_CHECK_FAIL( !label.GetProperty<bool>( TextLabel::Property::ENABLE_AUTO_SCROLL ),"TextLabel enable auto scroll set/get failed." );
+ label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, SCROLL_SPEED );
+ DALI_CHECK_FAIL( SCROLL_SPEED != label.GetProperty<int>( TextLabel::Property::AUTO_SCROLL_SPEED ), "TextLabel auto scroll speed set/get failed." );
+ label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, SCROLL_LOOPS );
+ DALI_CHECK_FAIL( SCROLL_LOOPS != label.GetProperty<int>( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT ), "TextLabel auto scroll loop set/get failed." );
+ label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, SCROLL_GAP );
+ DALI_CHECK_FAIL( SCROLL_GAP != label.GetProperty<float>( TextLabel::Property::AUTO_SCROLL_GAP ), "TextLabel auto scroll gap set/get failed." );
- strHorAlignGet = textLabelAssign.GetProperty<string>( TextLabel::Property::HORIZONTAL_ALIGNMENT );
- DALI_CHECK_FAIL( strHorAlignGet != STR_HORIZONAL, "TextLabel::operator= is failed along with set horizontal alignment." );
-
- strVertAlignGet = textLabelAssign.GetProperty<string>( TextLabel::Property:: VERTICAL_ALIGNMENT );
- DALI_CHECK_FAIL( strHorAlignGet != STR_HORIZONAL, "TextLabel::operator= is failed along with set vertical alignment." );
+ DALI_CHECK_FAIL( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL ) != TextLabel::Property::ENABLE_AUTO_SCROLL ,"Index of enable auto scroll not match");
+ DALI_CHECK_FAIL( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_SPEED ) != TextLabel::Property::AUTO_SCROLL_SPEED ,"Index of auto scroll speed not match");
+ DALI_CHECK_FAIL( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_LOOPS ) != TextLabel::Property::AUTO_SCROLL_LOOP_COUNT ,"Index of auto loop count not match");
+ DALI_CHECK_FAIL( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_GAP ) != TextLabel::Property::AUTO_SCROLL_GAP ,"Index of auto scroll gap not match");
DaliLog::PrintPass();
}
* @postcondition NA
*/
-int ITcTextLabelNewWithTextAssignment(void)
+int ITcTextLabelGetSetPropertiesWithAssignment(void)
{
DaliLog::PrintExecStarted(SUITE_NAME, __FUNCTION__);
Application application = Application::New( &gArgc, &gArgv );
- TextLabel_TestApp testApp( application, TEXT_LABEL_NEW_WITH_TEXT_ASSIGNMENT );
+ TextLabel_TestApp testApp( application, TEXT_LABEL_GET_SET_PROPERTIES_WITH_ASSIGNMENT );
application.MainLoop();
return test_return_value;