From 5adddaee3a851bef26ccbd4fd23cbff951222079 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Tue, 3 Oct 2017 19:02:38 +0100 Subject: [PATCH] (TextLabel) Moved all devel properties to Public API Change-Id: Iae2a8f25a9f858d108ca9fdb8c4d3abd185adb7e --- .../src/dali-toolkit/utc-Dali-TextLabel.cpp | 99 ++++++----- .../controls/text-controls/text-label-devel.h | 178 -------------------- dali-toolkit/devel-api/file.list | 1 - .../controls/text-controls/text-label-impl.cpp | 115 +++++++------ dali-toolkit/internal/text/text-scroller.cpp | 12 +- dali-toolkit/internal/text/text-scroller.h | 8 +- .../public-api/controls/text-controls/text-label.h | 184 +++++++++++++++++---- docs/content/example-code/properties.cpp | 2 +- 8 files changed, 271 insertions(+), 328 deletions(-) delete mode 100644 dali-toolkit/devel-api/controls/text-controls/text-label-devel.h diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index 1130c39..b827cc5 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -21,7 +21,6 @@ #include #include -#include using namespace Dali; using namespace Toolkit; @@ -208,9 +207,9 @@ int UtcDaliToolkitTextLabelGetPropertyP(void) DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_SHADOW ) == TextLabel::Property::SHADOW ); DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_EMBOSS ) == TextLabel::Property::EMBOSS ); DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_OUTLINE ) == TextLabel::Property::OUTLINE ); - DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == DevelTextLabel::Property::PIXEL_SIZE ); - DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == DevelTextLabel::Property::ELLIPSIS ); - DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY ) == DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY ); + DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == TextLabel::Property::PIXEL_SIZE ); + DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == TextLabel::Property::ELLIPSIS ); + DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY ) == TextLabel::Property::AUTO_SCROLL_LOOP_DELAY ); END_TEST; } @@ -372,15 +371,15 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) DALI_TEST_EQUALS( SCROLL_LOOPS, label.GetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT ), TEST_LOCATION ); label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, SCROLL_GAP ); DALI_TEST_EQUALS( SCROLL_GAP, label.GetProperty( TextLabel::Property::AUTO_SCROLL_GAP ), TEST_LOCATION ); - label.SetProperty(DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY, SCROLL_LOOP_DELAY ); - DALI_TEST_EQUALS( SCROLL_LOOP_DELAY, label.GetProperty( DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY ), TEST_LOCATION ); + label.SetProperty(TextLabel::Property::AUTO_SCROLL_LOOP_DELAY, SCROLL_LOOP_DELAY ); + DALI_TEST_EQUALS( SCROLL_LOOP_DELAY, label.GetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_DELAY ), TEST_LOCATION ); //Check autoscroll stop type property - label.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE ); - DALI_TEST_EQUALS( STOP_IMMEDIATE, label.GetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE ), TEST_LOCATION ); + label.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE ); + DALI_TEST_EQUALS( STOP_IMMEDIATE, label.GetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE ), TEST_LOCATION ); - label.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP ); - DALI_TEST_EQUALS( STOP_FINISH_LOOP, label.GetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE ), TEST_LOCATION ); + label.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP ); + DALI_TEST_EQUALS( STOP_FINISH_LOOP, label.GetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE ), TEST_LOCATION ); // Check the line spacing property @@ -460,13 +459,13 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION ); // Check the pixel size of font - label.SetProperty( DevelTextLabel::Property::PIXEL_SIZE, 20.f ); - DALI_TEST_EQUALS( label.GetProperty( DevelTextLabel::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + label.SetProperty( TextLabel::Property::PIXEL_SIZE, 20.f ); + DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); // Check the ellipsis property - DALI_TEST_CHECK( !label.GetProperty( DevelTextLabel::Property::ELLIPSIS ) ); - label.SetProperty( DevelTextLabel::Property::ELLIPSIS, true ); - DALI_TEST_CHECK( label.GetProperty( DevelTextLabel::Property::ELLIPSIS ) ); + DALI_TEST_CHECK( !label.GetProperty( TextLabel::Property::ELLIPSIS ) ); + label.SetProperty( TextLabel::Property::ELLIPSIS, true ); + DALI_TEST_CHECK( label.GetProperty( TextLabel::Property::ELLIPSIS ) ); END_TEST; } @@ -598,7 +597,7 @@ int UtcDaliToolkitTextlabelScrollingP(void) labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); - labelImmediate.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE ); + labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE ); Stage::GetCurrent().Add( labelFinished ); // Turn on all the effects @@ -606,7 +605,7 @@ int UtcDaliToolkitTextlabelScrollingP(void) labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); - labelFinished.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP ); + labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP ); @@ -649,7 +648,7 @@ int UtcDaliToolkitTextlabelScrollingCenterAlignP(void) labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); - labelShort.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE ); + labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE ); Stage::GetCurrent().Add( labelLong ); // Turn on all the effects @@ -658,7 +657,7 @@ int UtcDaliToolkitTextlabelScrollingCenterAlignP(void) labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); - labelLong.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP ); + labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP ); try { @@ -699,7 +698,7 @@ int UtcDaliToolkitTextlabelScrollingCenterAlignRTLP(void) labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); - labelShort.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE ); + labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE ); Stage::GetCurrent().Add( labelLong ); // Turn on all the effects @@ -708,7 +707,7 @@ int UtcDaliToolkitTextlabelScrollingCenterAlignRTLP(void) labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); - labelLong.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP ); + labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP ); try { @@ -749,7 +748,7 @@ int UtcDaliToolkitTextlabelScrollingEndAlignP(void) labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); - labelShort.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE ); + labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE ); Stage::GetCurrent().Add( labelLong ); // Turn on all the effects @@ -758,7 +757,7 @@ int UtcDaliToolkitTextlabelScrollingEndAlignP(void) labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); - labelLong.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP ); + labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP ); try { @@ -799,7 +798,7 @@ int UtcDaliToolkitTextlabelScrollingEndAlignRTLP(void) labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); - labelShort.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE ); + labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE ); Stage::GetCurrent().Add( labelLong ); // Turn on all the effects @@ -808,7 +807,7 @@ int UtcDaliToolkitTextlabelScrollingEndAlignRTLP(void) labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); - labelLong.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP ); + labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP ); try { @@ -965,23 +964,23 @@ int UtcDaliToolkitTextlabelTextWarpMode(void) //label.SetProperty( TextLabel::Property::POINT_SIZE, 18 ); Stage::GetCurrent().Add( label ); - label.SetProperty( DevelTextLabel::Property::LINE_WRAP_MODE, "WRAP_MODE_WORD" ); + label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WRAP_MODE_WORD" ); application.SendNotification(); application.Render(); - lineCount = label.GetProperty( DevelTextLabel::Property::LINE_COUNT ); + lineCount = label.GetProperty( TextLabel::Property::LINE_COUNT ); DALI_TEST_EQUALS( lineCount, 4, TEST_LOCATION ); - label.SetProperty( DevelTextLabel::Property::LINE_WRAP_MODE, "WRAP_MODE_CHARACTER" ); + label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WRAP_MODE_CHARACTER" ); application.SendNotification(); application.Render(); - lineCount = label.GetProperty( DevelTextLabel::Property::LINE_COUNT ); + lineCount = label.GetProperty( TextLabel::Property::LINE_COUNT ); DALI_TEST_EQUALS( lineCount, 3, TEST_LOCATION ); END_TEST; @@ -992,28 +991,28 @@ int UtcDaliToolkitTextLabelColorComponents(void) ToolkitTestApplication application; TextLabel label = TextLabel::New(); - label.SetProperty( DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE, Color::RED ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_RED ), 1.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_GREEN ), 0.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_BLUE ), 0.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION ); - - label.SetProperty( DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE, Color::GREEN ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_RED ), 0.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_GREEN ), 1.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_BLUE ), 0.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION ); - - label.SetProperty( DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE, Color::BLUE ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_RED ), 0.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_GREEN ), 0.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_BLUE ), 1.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION ); - - label.SetProperty( DevelTextLabel::Property::TEXT_COLOR_ALPHA, 0.6f ); - DALI_TEST_EQUALS( label.GetProperty< float >( DevelTextLabel::Property::TEXT_COLOR_ALPHA ), 0.6f, TEST_LOCATION ); - DALI_TEST_EQUALS( label.GetProperty< Vector4 >( DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE ), Vector4( 0.0f, 0.0f, 1.0f, 0.6f ), TEST_LOCATION ); + label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ), 1.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION ); + + label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::GREEN ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 1.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION ); + + label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ), 1.0f, TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION ); + + label.SetProperty( TextLabel::Property::TEXT_COLOR_ALPHA, 0.6f ); + DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 0.6f, TEST_LOCATION ); DALI_TEST_EQUALS( label.GetProperty< Vector4 >( TextLabel::Property::TEXT_COLOR ), Vector4( 0.0f, 0.0f, 1.0f, 0.6f ), TEST_LOCATION ); + DALI_TEST_EQUALS( label.GetProperty< Vector4 >( TextLabel::Property::UNUSED_PROPERTY_TEXT_COLOR ), Vector4( 0.0f, 0.0f, 1.0f, 0.6f ), TEST_LOCATION ); END_TEST; } diff --git a/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h deleted file mode 100644 index dfcd279..0000000 --- a/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h +++ /dev/null @@ -1,178 +0,0 @@ -#ifndef DALI_TOOLKIT_TEXT_LABEL_DEVEL_H -#define DALI_TOOLKIT_TEXT_LABEL_DEVEL_H - -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// INTERNAL INCLUDES -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace DevelTextLabel -{ - -/** - * @brief Enumeration for the start and end property ranges for this control. - * @SINCE_1_0.0 - */ -enum PropertyRange -{ - ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX, - ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices -}; - -namespace Property -{ - enum Type - { - /////////////////////////////////////////////////////////////////////////////// - // Event side (non-animatable) properties - /////////////////////////////////////////////////////////////////////////////// - - RENDERING_BACKEND = Dali::Toolkit::TextLabel::Property::RENDERING_BACKEND, - TEXT = Dali::Toolkit::TextLabel::Property::TEXT, - FONT_FAMILY = Dali::Toolkit::TextLabel::Property::FONT_FAMILY, - FONT_STYLE = Dali::Toolkit::TextLabel::Property::FONT_STYLE, - POINT_SIZE = Dali::Toolkit::TextLabel::Property::POINT_SIZE, - MULTI_LINE = Dali::Toolkit::TextLabel::Property::MULTI_LINE, - HORIZONTAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, - VERTICAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, - TEXT_COLOR = Dali::Toolkit::TextLabel::Property::TEXT_COLOR, - SHADOW_OFFSET = Dali::Toolkit::TextLabel::Property::SHADOW_OFFSET, - SHADOW_COLOR = Dali::Toolkit::TextLabel::Property::SHADOW_COLOR, - UNDERLINE_ENABLED = Dali::Toolkit::TextLabel::Property::UNDERLINE_ENABLED, - UNDERLINE_COLOR = Dali::Toolkit::TextLabel::Property::UNDERLINE_COLOR, - UNDERLINE_HEIGHT = Dali::Toolkit::TextLabel::Property::UNDERLINE_HEIGHT, - ENABLE_MARKUP = Dali::Toolkit::TextLabel::Property::ENABLE_MARKUP, - ENABLE_AUTO_SCROLL = Dali::Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL, - AUTO_SCROLL_SPEED = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED, - AUTO_SCROLL_LOOP_COUNT = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, - AUTO_SCROLL_GAP = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_GAP, - LINE_SPACING = Dali::Toolkit::TextLabel::Property::LINE_SPACING, - UNDERLINE = Dali::Toolkit::TextLabel::Property::UNDERLINE, - SHADOW = Dali::Toolkit::TextLabel::Property::SHADOW, - EMBOSS = Dali::Toolkit::TextLabel::Property::EMBOSS, - OUTLINE = Dali::Toolkit::TextLabel::Property::OUTLINE, - - /** - * @brief The size of font in pixels. - * @details Name "pixelSize", type Property::FLOAT. - * Conversion from Point size to Pixel size: - * Pixel size = Point size * DPI / 72 - */ - PIXEL_SIZE = OUTLINE + 1, - - /** - * @brief Enable or disable the ellipsis. - * @details Name "ellipsis", type Property::BOOLEAN. - */ - ELLIPSIS = OUTLINE + 2, - - /** - * @brief delay starting time of auto scrolling and further loops - * @details Name "autoScrollLoopDelay", type Property::FLOAT. - */ - AUTO_SCROLL_LOOP_DELAY = OUTLINE + 3, - - /** - * @brief Auto scrolling stop behaviour. - * @details Name "autoScrollStopMode", type [Type](@ref Dali::Toolkit::DevelTextLabel::AutoScrollStopMode::Type) (Property::INTEGER) or Property::STRING. - * Values FINISH_LOOP, IMMEDIATE, default FINISH_LOOP - */ - AUTO_SCROLL_STOP_MODE = OUTLINE + 4, - - /* - * @brief The line count of text. - * @details name "lineCount", type int - * @node This property is read-only. - */ - LINE_COUNT = OUTLINE + 5, - - /** - * @brief line wrap mode when the text lines over layout width. - * @details Name "lineWrapMode", type Property::STRING. - */ - LINE_WRAP_MODE = OUTLINE + 6, - - /////////////////////////////////////////////////////////////////////////////// - // Animatable Properties - /////////////////////////////////////////////////////////////////////////////// - - /* - * @brief Animatable text color. - * @details Name "textColorAnimatable", type Property::VECTOR4. - * Text color property to use if required to animate the text color. - */ - TEXT_COLOR_ANIMATABLE = ANIMATABLE_PROPERTY_START_INDEX, - - /** - * @brief The red component of the text color. - * @details Name "textColorRed", type Property::FLOAT. - * @see TEXT_COLOR_ANIMATABLE - */ - TEXT_COLOR_RED = ANIMATABLE_PROPERTY_START_INDEX + 1, - - /** - * @brief The green component of the text color. - * @details Name "textColorGreen", type Property::FLOAT. - * @see TEXT_COLOR_ANIMATABLE - */ - TEXT_COLOR_GREEN = ANIMATABLE_PROPERTY_START_INDEX + 2, - - /** - * @brief The blue component of the text color. - * @details Name "textColorBlue", type Property::FLOAT. - * @see TEXT_COLOR_ANIMATABLE - */ - TEXT_COLOR_BLUE = ANIMATABLE_PROPERTY_START_INDEX + 3, - - /** - * @brief The alpha component of the text color. - * @details Name "textColorAlpha", type Property::FLOAT. - * @see TEXT_COLOR_ANIMATABLE - */ - TEXT_COLOR_ALPHA = ANIMATABLE_PROPERTY_START_INDEX + 4, - }; -} // namespace Property - -/** -* @brief The type for TextLabel::Property::AUTO_SCROLL_STOP_MODE -*/ -namespace AutoScrollStopMode -{ -/** -* @ref Dali::Toolkit::DevelTextLabel::AutoScrollStopMode -*/ -enum Type -{ - FINISH_LOOP = 0, ///< stop animation after current loop finished. - IMMEDIATE ///< stop animation immediatly and reset position. -}; -} // namespace AutoScrollStopMode - -} // namespace DevelText - -} // namespace Toolkit - -} // namespace Dali - -#endif // DALI_TOOLKIT_TEXT_LABEL_DEVEL_H diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list index 9c657a4..17fb99d 100644 --- a/dali-toolkit/devel-api/file.list +++ b/dali-toolkit/devel-api/file.list @@ -126,7 +126,6 @@ devel_api_text_controls_header_files = \ $(devel_api_src_dir)/controls/text-controls/hidden-input-properties.h \ $(devel_api_src_dir)/controls/text-controls/text-editor-devel.h \ $(devel_api_src_dir)/controls/text-controls/text-field-devel.h \ - $(devel_api_src_dir)/controls/text-controls/text-label-devel.h \ $(devel_api_src_dir)/controls/text-controls/text-selection-popup.h \ $(devel_api_src_dir)/controls/text-controls/text-selection-toolbar.h diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp index 87a4fae..c29f484 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -26,7 +26,6 @@ // INTERNAL INCLUDES #include #include -#include #include #include #include @@ -67,8 +66,8 @@ namespace const Scripting::StringEnum AUTO_SCROLL_STOP_MODE_TABLE[] = { - { "IMMEDIATE", Toolkit::DevelTextLabel::AutoScrollStopMode::IMMEDIATE }, - { "FINISH_LOOP", Toolkit::DevelTextLabel::AutoScrollStopMode::FINISH_LOOP }, + { "IMMEDIATE", Toolkit::TextLabel::AutoScrollStopMode::IMMEDIATE }, + { "FINISH_LOOP", Toolkit::TextLabel::AutoScrollStopMode::FINISH_LOOP }, }; const unsigned int AUTO_SCROLL_STOP_MODE_TABLE_COUNT = sizeof( AUTO_SCROLL_STOP_MODE_TABLE ) / sizeof( AUTO_SCROLL_STOP_MODE_TABLE[0] ); @@ -104,41 +103,41 @@ BaseHandle Create() // Setup properties, signals and actions using the type-registry. DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextLabel, Toolkit::Control, Create ); -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "renderingBackend", INTEGER, RENDERING_BACKEND ) // Deprecated property -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text", STRING, TEXT ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontFamily", STRING, FONT_FAMILY ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle", MAP, FONT_STYLE ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pointSize", FLOAT, POINT_SIZE ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "multiLine", BOOLEAN, MULTI_LINE ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "horizontalAlignment", STRING, HORIZONTAL_ALIGNMENT ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "verticalAlignment", STRING, VERTICAL_ALIGNMENT ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "textColor", VECTOR4, TEXT_COLOR ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowOffset", VECTOR2, SHADOW_OFFSET ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowColor", VECTOR4, SHADOW_COLOR ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineEnabled", BOOLEAN, UNDERLINE_ENABLED ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineColor", VECTOR4, UNDERLINE_COLOR ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineHeight", FLOAT, UNDERLINE_HEIGHT ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableMarkup", BOOLEAN, ENABLE_MARKUP ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableAutoScroll", BOOLEAN, ENABLE_AUTO_SCROLL ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollSpeed", INTEGER, AUTO_SCROLL_SPEED ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopCount", INTEGER, AUTO_SCROLL_LOOP_COUNT ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollGap", FLOAT, AUTO_SCROLL_GAP ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineSpacing", FLOAT, LINE_SPACING ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline", MAP, UNDERLINE ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow", MAP, SHADOW ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "emboss", MAP, EMBOSS ) -DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "outline", MAP, OUTLINE ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pixelSize", FLOAT, PIXEL_SIZE ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "ellipsis", BOOLEAN, ELLIPSIS ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopDelay", FLOAT, AUTO_SCROLL_LOOP_DELAY ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollStopMode", STRING, AUTO_SCROLL_STOP_MODE ) -DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "lineCount", INTEGER, LINE_COUNT ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineWrapMode", STRING, LINE_WRAP_MODE ) -DALI_DEVEL_ANIMATABLE_PROPERTY_REGISTRATION_WITH_DEFAULT( Toolkit, TextLabel, "textColorAnimatable", Color::BLACK, TEXT_COLOR_ANIMATABLE ) -DALI_DEVEL_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorRed", TEXT_COLOR_RED, TEXT_COLOR_ANIMATABLE, 0) -DALI_DEVEL_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorGreen", TEXT_COLOR_GREEN, TEXT_COLOR_ANIMATABLE, 1) -DALI_DEVEL_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorBlue", TEXT_COLOR_BLUE, TEXT_COLOR_ANIMATABLE, 2) -DALI_DEVEL_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorAlpha", TEXT_COLOR_ALPHA, TEXT_COLOR_ANIMATABLE, 3) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "renderingBackend", INTEGER, RENDERING_BACKEND ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text", STRING, TEXT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontFamily", STRING, FONT_FAMILY ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle", MAP, FONT_STYLE ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pointSize", FLOAT, POINT_SIZE ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "multiLine", BOOLEAN, MULTI_LINE ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "horizontalAlignment", STRING, HORIZONTAL_ALIGNMENT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "verticalAlignment", STRING, VERTICAL_ALIGNMENT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "unusedPropertyTextColor", VECTOR4, UNUSED_PROPERTY_TEXT_COLOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowOffset", VECTOR2, SHADOW_OFFSET ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowColor", VECTOR4, SHADOW_COLOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineEnabled", BOOLEAN, UNDERLINE_ENABLED ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineColor", VECTOR4, UNDERLINE_COLOR ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineHeight", FLOAT, UNDERLINE_HEIGHT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableMarkup", BOOLEAN, ENABLE_MARKUP ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableAutoScroll", BOOLEAN, ENABLE_AUTO_SCROLL ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollSpeed", INTEGER, AUTO_SCROLL_SPEED ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopCount", INTEGER, AUTO_SCROLL_LOOP_COUNT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollGap", FLOAT, AUTO_SCROLL_GAP ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineSpacing", FLOAT, LINE_SPACING ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline", MAP, UNDERLINE ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow", MAP, SHADOW ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "emboss", MAP, EMBOSS ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "outline", MAP, OUTLINE ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pixelSize", FLOAT, PIXEL_SIZE ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "ellipsis", BOOLEAN, ELLIPSIS ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopDelay", FLOAT, AUTO_SCROLL_LOOP_DELAY ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollStopMode", STRING, AUTO_SCROLL_STOP_MODE ) +DALI_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "lineCount", INTEGER, LINE_COUNT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineWrapMode", STRING, LINE_WRAP_MODE ) +DALI_ANIMATABLE_PROPERTY_REGISTRATION_WITH_DEFAULT( Toolkit, TextLabel, "textColor", Color::BLACK, TEXT_COLOR ) +DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorRed", TEXT_COLOR_RED, TEXT_COLOR, 0 ) +DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorGreen", TEXT_COLOR_GREEN, TEXT_COLOR, 1 ) +DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorBlue", TEXT_COLOR_BLUE, TEXT_COLOR, 2 ) +DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorAlpha", TEXT_COLOR_ALPHA, TEXT_COLOR, 3 ) DALI_TYPE_REGISTRATION_END() } // namespace @@ -269,9 +268,9 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr break; } - case Toolkit::TextLabel::Property::TEXT_COLOR: + case Toolkit::TextLabel::Property::UNUSED_PROPERTY_TEXT_COLOR: { - label.SetProperty( DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE, value ); + label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, value ); impl.mTextUpdateNeeded = true; break; } @@ -377,14 +376,14 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr } break; } - case Toolkit::DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE: + case Toolkit::TextLabel::Property::AUTO_SCROLL_STOP_MODE: { if( !impl.mTextScroller ) { impl.mTextScroller = Text::TextScroller::New( impl ); } - DevelTextLabel::AutoScrollStopMode::Type stopMode = impl.mTextScroller->GetStopMode(); - if( Scripting::GetEnumerationProperty< Toolkit::DevelTextLabel::AutoScrollStopMode::Type >( value, + Toolkit::TextLabel::AutoScrollStopMode::Type stopMode = impl.mTextScroller->GetStopMode(); + if( Scripting::GetEnumerationProperty< Toolkit::TextLabel::AutoScrollStopMode::Type >( value, AUTO_SCROLL_STOP_MODE_TABLE, AUTO_SCROLL_STOP_MODE_TABLE_COUNT, stopMode ) ) @@ -411,7 +410,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr impl.mTextScroller->SetLoopCount( value.Get() ); break; } - case Toolkit::DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY: + case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_DELAY: { if( !impl.mTextScroller ) { @@ -475,7 +474,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr } break; } - case Toolkit::DevelTextLabel::Property::PIXEL_SIZE: + case Toolkit::TextLabel::Property::PIXEL_SIZE: { if( impl.mController ) { @@ -489,7 +488,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr } break; } - case Toolkit::DevelTextLabel::Property::ELLIPSIS: + case Toolkit::TextLabel::Property::ELLIPSIS: { if( impl.mController ) { @@ -500,7 +499,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr } break; } - case Toolkit::DevelTextLabel::Property::LINE_WRAP_MODE: + case Toolkit::TextLabel::Property::LINE_WRAP_MODE: { const std::string& wrapModeStr = value.Get< std::string >(); DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel %p LINE_WRAP_MODE %s\n", impl.mController.Get(), wrapModeStr.c_str() ); @@ -604,9 +603,9 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde } break; } - case Toolkit::TextLabel::Property::TEXT_COLOR: + case Toolkit::TextLabel::Property::UNUSED_PROPERTY_TEXT_COLOR: { - value = label.GetProperty( Toolkit::DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE ); + value = label.GetProperty( Toolkit::TextLabel::Property::TEXT_COLOR ); break; } case Toolkit::TextLabel::Property::SHADOW_OFFSET: @@ -665,11 +664,11 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde } break; } - case Toolkit::DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE: + case Toolkit::TextLabel::Property::AUTO_SCROLL_STOP_MODE: { if( impl.mTextScroller ) { - const char* mode = Scripting::GetEnumerationName< Toolkit::DevelTextLabel::AutoScrollStopMode::Type >( impl.mTextScroller->GetStopMode(), + const char* mode = Scripting::GetEnumerationName< Toolkit::TextLabel::AutoScrollStopMode::Type >( impl.mTextScroller->GetStopMode(), AUTO_SCROLL_STOP_MODE_TABLE, AUTO_SCROLL_STOP_MODE_TABLE_COUNT ); if( mode ) @@ -700,7 +699,7 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde } break; } - case Toolkit::DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY: + case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_DELAY: { if( impl.mController ) { @@ -749,7 +748,7 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde GetOutlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT ); break; } - case Toolkit::DevelTextLabel::Property::PIXEL_SIZE: + case Toolkit::TextLabel::Property::PIXEL_SIZE: { if( impl.mController ) { @@ -757,7 +756,7 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde } break; } - case Toolkit::DevelTextLabel::Property::ELLIPSIS: + case Toolkit::TextLabel::Property::ELLIPSIS: { if( impl.mController ) { @@ -765,7 +764,7 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde } break; } - case Toolkit::DevelTextLabel::Property::LINE_WRAP_MODE: + case Toolkit::TextLabel::Property::LINE_WRAP_MODE: { if( impl.mController ) { @@ -773,7 +772,7 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde } break; } - case Toolkit::DevelTextLabel::Property::LINE_COUNT: + case Toolkit::TextLabel::Property::LINE_COUNT: { if( impl.mController ) { @@ -798,7 +797,7 @@ void TextLabel::OnInitialize() mVisual = Toolkit::VisualFactory::Get().CreateVisual( propertyMap ); DevelControl::RegisterVisual( *this, Toolkit::TextLabel::Property::TEXT, mVisual ); - TextVisual::SetAnimatableTextColorProperty( mVisual, Toolkit::DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE ); + TextVisual::SetAnimatableTextColorProperty( mVisual, Toolkit::TextLabel::Property::TEXT_COLOR ); mController = TextVisual::GetController(mVisual); if( mController ) @@ -867,7 +866,7 @@ void TextLabel::OnPropertySet( Property::Index index, Property::Value propertyVa switch ( index ) { - case Toolkit::DevelTextLabel::Property::TEXT_COLOR_ANIMATABLE: + case Toolkit::TextLabel::Property::TEXT_COLOR: { const Vector4& textColor = propertyValue.Get< Vector4 >(); if( mController->GetDefaultColor() != textColor ) diff --git a/dali-toolkit/internal/text/text-scroller.cpp b/dali-toolkit/internal/text/text-scroller.cpp index b109661..f235ce8 100644 --- a/dali-toolkit/internal/text/text-scroller.cpp +++ b/dali-toolkit/internal/text/text-scroller.cpp @@ -200,9 +200,9 @@ float TextScroller::GetLoopDelay() const return mLoopDelay; } -void TextScroller::SetStopMode( DevelTextLabel::AutoScrollStopMode::Type stopMode ) +void TextScroller::SetStopMode( TextLabel::AutoScrollStopMode::Type stopMode ) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetAutoScrollStopMode [%s]\n",(stopMode == DevelTextLabel::AutoScrollStopMode::IMMEDIATE)?"IMMEDIATE":"FINISH_LOOP" ); + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetAutoScrollStopMode [%s]\n",(stopMode == TextLabel::AutoScrollStopMode::IMMEDIATE)?"IMMEDIATE":"FINISH_LOOP" ); mStopMode = stopMode; } @@ -212,13 +212,13 @@ void TextScroller::StopScrolling() { switch( mStopMode ) { - case DevelTextLabel::AutoScrollStopMode::IMMEDIATE: + case TextLabel::AutoScrollStopMode::IMMEDIATE: { mScrollAnimation.Stop(); mScrollerInterface.ScrollingFinished(); break; } - case DevelTextLabel::AutoScrollStopMode::FINISH_LOOP: + case TextLabel::AutoScrollStopMode::FINISH_LOOP: { mScrollAnimation.SetLoopCount( 1 ); // As animation already playing this allows the current animation to finish instead of trying to stop mid-way break; @@ -231,7 +231,7 @@ void TextScroller::StopScrolling() } } -DevelTextLabel::AutoScrollStopMode::Type TextScroller::GetStopMode() const +TextLabel::AutoScrollStopMode::Type TextScroller::GetStopMode() const { return mStopMode; } @@ -243,7 +243,7 @@ TextScroller::TextScroller( ScrollerInterface& scrollerInterface ) mLoopCount( 1 ), mLoopDelay( 0.0f ), mWrapGap( 0.0f ), - mStopMode( DevelTextLabel::AutoScrollStopMode::FINISH_LOOP ) + mStopMode( TextLabel::AutoScrollStopMode::FINISH_LOOP ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller Default Constructor\n" ); } diff --git a/dali-toolkit/internal/text/text-scroller.h b/dali-toolkit/internal/text/text-scroller.h index b8dc10f..daf2587 100644 --- a/dali-toolkit/internal/text/text-scroller.h +++ b/dali-toolkit/internal/text/text-scroller.h @@ -25,7 +25,7 @@ #include // INTERNAL INCLUDES -#include +#include #include #include @@ -124,7 +124,7 @@ public: * @brief Set the mode of scrolling stop * @param[in] stopMode type when text scrolling is stoped. */ - void SetStopMode( DevelTextLabel::AutoScrollStopMode::Type stopMode ); + void SetStopMode( TextLabel::AutoScrollStopMode::Type stopMode ); /** * @brief Stop the auto scrolling. @@ -135,7 +135,7 @@ public: * @brief Get the mode of scrolling stop * @return stopMode type when text scrolling is stoped. */ - DevelTextLabel::AutoScrollStopMode::Type GetStopMode() const; + TextLabel::AutoScrollStopMode::Type GetStopMode() const; private: // Implementation @@ -183,7 +183,7 @@ private: int mLoopCount; ///< Number of time the text should scroll float mLoopDelay; ///< Time delay of loop start float mWrapGap; ///< Gap before text wraps around when scrolling - DevelTextLabel::AutoScrollStopMode::Type mStopMode; ///< Stop mode of scrolling text, when loop count is 0. + TextLabel::AutoScrollStopMode::Type mStopMode; ///< Stop mode of scrolling text, when loop count is 0. }; // TextScroller class diff --git a/dali-toolkit/public-api/controls/text-controls/text-label.h b/dali-toolkit/public-api/controls/text-controls/text-label.h index df0abce..0de1b01 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-label.h +++ b/dali-toolkit/public-api/controls/text-controls/text-label.h @@ -74,7 +74,10 @@ public: enum PropertyRange { PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0 - PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices @SINCE_1_0.0 + PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000, ///< Reserve property indices @SINCE_1_0.0 + + ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX, ///< @SINCE_1_2.60 + ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000 ///< Reserve animatable property indices @SINCE_1_2.60 }; /** @@ -89,177 +92,298 @@ public: */ enum { + /////////////////////////////////////////////////////////////////////////////// + // Event side (non-animatable) properties + /////////////////////////////////////////////////////////////////////////////// + /** - * DEPRECATED_1_2.53 No longer be supported and will be ignored. + * @DEPRECATED_1_2.53 No longer be supported and will be ignored. * @brief The type of rendering e.g. bitmap-based. - * @details name "renderingBackend", type INT, default RENDERING_SHARED_ATLAS. + * @details Name "renderingBackend", type Property::INT. * @SINCE_1_0.0 */ RENDERING_BACKEND = PROPERTY_START_INDEX, /** * @brief The text to display in UTF-8 format. - * @details name "text", type STRING. + * @details Name "text", type Property::STRING. * @SINCE_1_0.0 */ TEXT, /** * @brief The requested font family to use. - * @details name "fontFamily", type STRING. + * @details Name "fontFamily", type Property::STRING. * @SINCE_1_0.0 */ FONT_FAMILY, /** * @brief The requested font style to use. - * @details name "fontStyle", type STRING or MAP. + * @details Name "fontStyle", type Property::STRING or Property::MAP. * @SINCE_1_2.13 */ FONT_STYLE, /** * @brief The size of font in points. - * - * Conversion from Pixel size to Point size : - * Point size = Pixel size * 72 / DPI - * @details name "pointSize", type FLOAT. + * @details Name "pointSize", type Property::FLOAT. + * Conversion from Pixel size to Point size: + * Point size = Pixel size * 72 / DPI * @SINCE_1_0.0 */ POINT_SIZE, /** * @brief The single-line or multi-line layout option. - * @details name "multiLine", type BOOLEAN, default false. + * @details Name "multiLine", type Property::BOOLEAN. * @SINCE_1_0.0 + * @note Default is false. */ MULTI_LINE, /** * @brief The line horizontal alignment. - * @details name "horizontalAlignment", type STRING, values "BEGIN", "CENTER", "END", default BEGIN. + * @details Name "horizontalAlignment", type Property::STRING + * Values "BEGIN", "CENTER", "END", default BEGIN. * @SINCE_1_0.0 */ HORIZONTAL_ALIGNMENT, /** * @brief The line vertical alignment. - * @details name "verticalAlignment", type STRING, values "TOP", "CENTER", "BOTTOM" @SINCE_1_0.0, default TOP. + * @details Name "verticalAlignment", type Property::STRING. + * Values "TOP", "CENTER", "BOTTOM" @SINCE_1_0.0, default TOP. * @SINCE_1_0.0 */ VERTICAL_ALIGNMENT, /** + * @DEPRECATED_1_2.60 Use the new enum value of TEXT_COLOR instead. * @brief The color of the text. - * @details name "textColor", type VECTOR4. + * @details Name "unusedPropertyTextColor", type Property::VECTOR4. * @SINCE_1_0.0 */ - TEXT_COLOR, + UNUSED_PROPERTY_TEXT_COLOR, /** * @DEPRECATED_1_1.37 Use SHADOW instead * @brief The drop shadow offset 0 indicates no shadow. - * @details name "shadowOffset", type VECTOR2. + * @details Name "shadowOffset", type Property::VECTOR2. */ SHADOW_OFFSET, /** * @DEPRECATED_1_1.37 Use SHADOW instead * @brief The color of a drop shadow. - * @details name "shadowColor", type VECTOR4 + * @details Name "shadowColor", type Property::VECTOR4 */ SHADOW_COLOR, /** * @DEPRECATED_1_1.37 Use UNDERLINE instead * @brief The underline enabled flag. - * @details name "underlineEnabled", type BOOLEAN. + * @details Name "underlineEnabled", type Property::BOOLEAN. */ UNDERLINE_ENABLED, /** * @DEPRECATED_1_1.37 Use UNDERLINE instead * @brief The color of the underline. - * @details name "underlineColor", type VECTOR4. + * @details Name "underlineColor", type Property::VECTOR4. */ UNDERLINE_COLOR, /** * @DEPRECATED_1_1.37 Use UNDERLINE instead * @brief Overrides the underline height from font metrics. - * @details name "underlineHeight", type FLOAT. + * @details Name "underlineHeight", type Property::FLOAT. */ UNDERLINE_HEIGHT, /** * @brief Whether the mark-up processing is enabled. - * @details name "enableMarkup", type BOOLEAN. + * @details Name "enableMarkup", type Property::BOOLEAN. * @SINCE_1_0.0 + * @note Default is false. */ ENABLE_MARKUP, /** * @brief Starts or stops auto scrolling. - * @details name "enableAutoScroll", type BOOLEAN, default is false. + * @details Name "enableAutoScroll", type Property::BOOLEAN. * @SINCE_1_1.35 + * @note Default is false. */ ENABLE_AUTO_SCROLL, /** * @brief Sets the speed of scrolling in pixels per second. - * @details name "autoScrollSpeed", type INT, default in style sheet. + * @details Name "autoScrollSpeed", type Property::INT. * @SINCE_1_1.35 + * @note Default in style sheet. */ AUTO_SCROLL_SPEED, /** * @brief Number of complete loops when scrolling enabled. - * @details name "autoScrollLoopCount", type INT, default in style sheet. + * @details Name "autoScrollLoopCount", type Property::INT. * @SINCE_1_1.35 + * @note Default in style sheet. */ AUTO_SCROLL_LOOP_COUNT, /** * @brief Gap before scrolling wraps. - * @details name "autoScrollGap", type INT, default in style sheet but can be overridden to prevent same text being shown at start and end. + * @details Name "autoScrollGap", type Property::INT. * @SINCE_1_1.35 + * @note Default in style sheet but can be overridden to prevent same text being shown at start and end. */ AUTO_SCROLL_GAP, /** * @brief The default extra space between lines in points. - * @details name "lineSpacing", type FLOAT. + * @details Name "lineSpacing", type Property::FLOAT. * @SINCE_1_1.37 */ LINE_SPACING, /** * @brief The default underline parameters. - * @details name "underline", type MAP. + * @details Name "underline", type Property::MAP. * @SINCE_1_2.13 */ UNDERLINE, /** * @brief The default shadow parameters. - * @details name "shadow", type MAP. + * @details Name "shadow", type Property::MAP. * @SINCE_1_2.13 */ SHADOW, /** * @brief The default emboss parameters. - * @details name "emboss", type MAP. + * @details Name "emboss", type Property::MAP. * @SINCE_1_2.13 */ EMBOSS, /** * @brief The default outline parameters. - * @details name "outline", type MAP. + * @details Name "outline", type Property::MAP. * @SINCE_1_2.13 */ OUTLINE, + + /** + * @brief The size of font in pixels. + * @details Name "pixelSize", type Property::FLOAT. + * Conversion from Point size to Pixel size: + * Pixel size = Point size * DPI / 72 + * @SINCE_1_2.60 + */ + PIXEL_SIZE, + + /** + * @brief Whether we should show the ellipsis if required. + * @details Name "ellipsis", type Property::BOOLEAN. + * @SINCE_1_2.60 + */ + ELLIPSIS, + + /** + * @brief The amount of time to delay the starting time of auto scrolling and further loops. + * @details Name "autoScrollLoopDelay", type Property::FLOAT. + * @SINCE_1_2.60 + */ + AUTO_SCROLL_LOOP_DELAY, + + /** + * @brief The auto scrolling stop behaviour. + * @details Name "autoScrollStopMode", type AutoScrollStopMode::Type (Property::INTEGER) or Property::STRING. + * @SINCE_1_2.60 + * @note Default is AutoScrollStopMode::FINISH_LOOP. + * @see AutoScrollStopMode::Type + */ + AUTO_SCROLL_STOP_MODE, + + /* + * @brief The line count of text. + * @details name "lineCount", type Property::INTEGER. + * @SINCE_1_2.60 + * @note This property is read-only. + */ + LINE_COUNT, + + /** + * @brief Line wrap mode when text lines are greater than the layout width. + * @details Name "lineWrapMode", type Property::STRING. + * @SINCE_1_2.60 + */ + LINE_WRAP_MODE, + + /////////////////////////////////////////////////////////////////////////////// + // Animatable Properties + /////////////////////////////////////////////////////////////////////////////// + + /** + * @brief The color of the text. + * @details Name "textColor", type Property::VECTOR4. + * @SINCE_1_2.60 + */ + TEXT_COLOR = ANIMATABLE_PROPERTY_START_INDEX, + + /** + * @brief The red component of the text color. + * @details Name "textColorRed", type Property::FLOAT. + * @SINCE_1_2.60 + * @see TEXT_COLOR + */ + TEXT_COLOR_RED, + + /** + * @brief The green component of the text color. + * @details Name "textColorGreen", type Property::FLOAT. + * @SINCE_1_2.60 + * @see TEXT_COLOR + */ + TEXT_COLOR_GREEN, + + /** + * @brief The blue component of the text color. + * @details Name "textColorBlue", type Property::FLOAT. + * @SINCE_1_2.60 + * @see TEXT_COLOR + */ + TEXT_COLOR_BLUE, + + /** + * @brief The alpha component of the text color. + * @details Name "textColorAlpha", type Property::FLOAT. + * @SINCE_1_2.60 + * @see TEXT_COLOR + */ + TEXT_COLOR_ALPHA, + }; + }; + + /** + * @brief The enumerations used for auto scroll stop mode. + * @SINCE_1_2.60 + * @see Property::AUTO_SCROLL_STOP_MODE. + */ + struct AutoScrollStopMode + { + /** + * @brief The enumerations used for auto scroll stop mode. + * @SINCE_1_2.60 + * @see Property::AUTO_SCROLL_STOP_MODE. + */ + enum Type + { + FINISH_LOOP = 0, ///< Stop animation after current loop finishes. @SINCE_1_2.60 + IMMEDIATE ///< Stop animation immediately and reset position. @SINCE_1_2.60 }; }; diff --git a/docs/content/example-code/properties.cpp b/docs/content/example-code/properties.cpp index 08d764f..a68bb02 100644 --- a/docs/content/example-code/properties.cpp +++ b/docs/content/example-code/properties.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. -- 2.7.4