From: Adeel Kazmi Date: Wed, 4 Oct 2017 14:12:24 +0000 (+0100) Subject: (TextEditor) Moved some Devel properties to the Public API X-Git-Tag: dali_1.2.60~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=f090b040537e2a5a60a6dc80009ade9b72d37d4b;hp=0ac0783f6dd2fc14ed111373ffa60bda4c94f587 (TextEditor) Moved some Devel properties to the Public API Change-Id: Ibd4d03c7841e4d9075212c1b86099dfa2efacb01 --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp index ba8ac99..9b2b6f7 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -310,13 +310,13 @@ public: { } - void Callback( TextEditor editor, DevelTextEditor::Scroll::Type type ) + void Callback( TextEditor editor, TextEditor::Scroll::Type type ) { - if( type == DevelTextEditor::Scroll::STARTED ) + if( type == TextEditor::Scroll::STARTED ) { mStartedCalled = true; } - else if( type == DevelTextEditor::Scroll::FINISHED ) + else if( type == TextEditor::Scroll::FINISHED ) { mFinishedCalled = true; } @@ -459,17 +459,17 @@ int UtcDaliTextEditorGetPropertyP(void) DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_EMBOSS ) == TextEditor::Property::INPUT_EMBOSS ); DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_OUTLINE ) == TextEditor::Property::OUTLINE ); DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_OUTLINE ) == TextEditor::Property::INPUT_OUTLINE ); - DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SMOOTH_SCROLL ) == DevelTextEditor::Property::SMOOTH_SCROLL ); - DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SMOOTH_SCROLL_DURATION ) == DevelTextEditor::Property::SMOOTH_SCROLL_DURATION ); - DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SCROLL_BAR ) == DevelTextEditor::Property::ENABLE_SCROLL_BAR ); - DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SCROLL_BAR_SHOW_DURATION ) == DevelTextEditor::Property::SCROLL_BAR_SHOW_DURATION ); - DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SCROLL_BAR_FADE_DURATION ) == DevelTextEditor::Property::SCROLL_BAR_FADE_DURATION ); - DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == DevelTextEditor::Property::PIXEL_SIZE ); - DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_LINE_COUNT) == DevelTextEditor::Property::LINE_COUNT ); + DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SMOOTH_SCROLL ) == TextEditor::Property::SMOOTH_SCROLL ); + DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SMOOTH_SCROLL_DURATION ) == TextEditor::Property::SMOOTH_SCROLL_DURATION ); + DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SCROLL_BAR ) == TextEditor::Property::ENABLE_SCROLL_BAR ); + DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SCROLL_BAR_SHOW_DURATION ) == TextEditor::Property::SCROLL_BAR_SHOW_DURATION ); + DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SCROLL_BAR_FADE_DURATION ) == TextEditor::Property::SCROLL_BAR_FADE_DURATION ); + DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == TextEditor::Property::PIXEL_SIZE ); + DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_LINE_COUNT) == TextEditor::Property::LINE_COUNT ); + DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == TextEditor::Property::ENABLE_SELECTION ); + DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == TextEditor::Property::PLACEHOLDER ); DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT ) == DevelTextEditor::Property::PLACEHOLDER_TEXT ); DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR ) == DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR ); - DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == DevelTextEditor::Property::ENABLE_SELECTION ); - DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == DevelTextEditor::Property::PLACEHOLDER ); END_TEST; } @@ -758,27 +758,27 @@ int UtcDaliTextEditorSetPropertyP(void) DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::INPUT_OUTLINE ), std::string("Outline input properties"), TEST_LOCATION ); // Check the smooth scroll property - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::SMOOTH_SCROLL ), false, TEST_LOCATION ); - editor.SetProperty( DevelTextEditor::Property::SMOOTH_SCROLL, true ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::SMOOTH_SCROLL ), true, TEST_LOCATION ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::SMOOTH_SCROLL ), false, TEST_LOCATION ); + editor.SetProperty( TextEditor::Property::SMOOTH_SCROLL, true ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::SMOOTH_SCROLL ), true, TEST_LOCATION ); // Check the smooth scroll duration property - editor.SetProperty( DevelTextEditor::Property::SMOOTH_SCROLL_DURATION, 0.2f ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::SMOOTH_SCROLL_DURATION ), 0.2f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + editor.SetProperty( TextEditor::Property::SMOOTH_SCROLL_DURATION, 0.2f ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::SMOOTH_SCROLL_DURATION ), 0.2f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); // Check the scroll bar property - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::ENABLE_SCROLL_BAR ), false, TEST_LOCATION ); - editor.SetProperty( DevelTextEditor::Property::ENABLE_SCROLL_BAR, true ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::ENABLE_SCROLL_BAR ), true, TEST_LOCATION ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::ENABLE_SCROLL_BAR ), false, TEST_LOCATION ); + editor.SetProperty( TextEditor::Property::ENABLE_SCROLL_BAR, true ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::ENABLE_SCROLL_BAR ), true, TEST_LOCATION ); - editor.SetProperty( DevelTextEditor::Property::SCROLL_BAR_SHOW_DURATION, 0.3f ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::SCROLL_BAR_SHOW_DURATION ), 0.3f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); - editor.SetProperty( DevelTextEditor::Property::SCROLL_BAR_FADE_DURATION, 0.2f ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::SCROLL_BAR_FADE_DURATION ), 0.2f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + editor.SetProperty( TextEditor::Property::SCROLL_BAR_SHOW_DURATION, 0.3f ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::SCROLL_BAR_SHOW_DURATION ), 0.3f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + editor.SetProperty( TextEditor::Property::SCROLL_BAR_FADE_DURATION, 0.2f ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::SCROLL_BAR_FADE_DURATION ), 0.2f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); // Check the pixel size of font - editor.SetProperty( DevelTextEditor::Property::PIXEL_SIZE, 20.f ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + editor.SetProperty( TextEditor::Property::PIXEL_SIZE, 20.f ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); // Check placeholder text properties. editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER_TEXT, "Setting Placeholder Text" ); @@ -789,8 +789,8 @@ int UtcDaliTextEditorSetPropertyP(void) DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR ), Color::RED, TEST_LOCATION ); // Check the enable selection property - editor.SetProperty( DevelTextEditor::Property::ENABLE_SELECTION, false ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::ENABLE_SELECTION ), false, TEST_LOCATION ); + editor.SetProperty( TextEditor::Property::ENABLE_SELECTION, false ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::ENABLE_SELECTION ), false, TEST_LOCATION ); // Check the placeholder property with pixel size Property::Map placeholderPixelSizeMapSet; @@ -804,9 +804,9 @@ int UtcDaliTextEditorSetPropertyP(void) placeholderFontstyleMap.Insert( "weight", "bold" ); placeholderPixelSizeMapSet["placeholderFontStyle"] = placeholderFontstyleMap; - editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderPixelSizeMapSet ); + editor.SetProperty( TextEditor::Property::PLACEHOLDER, placeholderPixelSizeMapSet ); - placeholderPixelSizeMapGet = editor.GetProperty( DevelTextEditor::Property::PLACEHOLDER ); + placeholderPixelSizeMapGet = editor.GetProperty( TextEditor::Property::PLACEHOLDER ); DALI_TEST_EQUALS( placeholderPixelSizeMapGet.Count(), placeholderPixelSizeMapSet.Count(), TEST_LOCATION ); DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderPixelSizeMapGet, placeholderPixelSizeMapSet ), true, TEST_LOCATION ); @@ -826,9 +826,9 @@ int UtcDaliTextEditorSetPropertyP(void) placeholderFontstyleMap.Insert( "width", "condensed" ); placeholderFontstyleMap.Insert( "slant", "italic" ); placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap; - editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet ); + editor.SetProperty( TextEditor::Property::PLACEHOLDER, placeholderMapSet ); - placeholderMapGet = editor.GetProperty( DevelTextEditor::Property::PLACEHOLDER ); + placeholderMapGet = editor.GetProperty( TextEditor::Property::PLACEHOLDER ); DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION ); DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION ); @@ -837,24 +837,24 @@ int UtcDaliTextEditorSetPropertyP(void) placeholderFontstyleMap.Insert( "weight", "normal" ); placeholderFontstyleMap.Insert( "slant", "oblique" ); placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap; - editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet ); + editor.SetProperty( TextEditor::Property::PLACEHOLDER, placeholderMapSet ); - placeholderMapGet = editor.GetProperty( DevelTextEditor::Property::PLACEHOLDER ); + placeholderMapGet = editor.GetProperty( TextEditor::Property::PLACEHOLDER ); DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION ); DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION ); placeholderFontstyleMap.Clear(); placeholderFontstyleMap.Insert( "slant", "roman" ); placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap; - editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet ); + editor.SetProperty( TextEditor::Property::PLACEHOLDER, placeholderMapSet ); - placeholderMapGet = editor.GetProperty( DevelTextEditor::Property::PLACEHOLDER ); + placeholderMapGet = editor.GetProperty( TextEditor::Property::PLACEHOLDER ); placeholderFontstyleMap.Clear(); placeholderMapSet["placeholderFontStyle"] = placeholderFontstyleMap; - editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, placeholderMapSet ); - placeholderMapGet = editor.GetProperty( DevelTextEditor::Property::PLACEHOLDER ); + editor.SetProperty( TextEditor::Property::PLACEHOLDER, placeholderMapSet ); + placeholderMapGet = editor.GetProperty( TextEditor::Property::PLACEHOLDER ); DALI_TEST_EQUALS( placeholderMapGet.Count(), placeholderMapSet.Count(), TEST_LOCATION ); DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderMapSet ), true, TEST_LOCATION ); @@ -1823,11 +1823,11 @@ int utcDaliTextEditorEvent05(void) editor.SetSize( 50.f, 50.f ); editor.SetParentOrigin( ParentOrigin::TOP_LEFT ); editor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - editor.SetProperty( DevelTextEditor::Property::SMOOTH_SCROLL, true ); - editor.SetProperty( DevelTextEditor::Property::SMOOTH_SCROLL_DURATION, 0.2f ); - editor.SetProperty( DevelTextEditor::Property::ENABLE_SCROLL_BAR, true ); - editor.SetProperty( DevelTextEditor::Property::SCROLL_BAR_SHOW_DURATION, 0.3f ); - editor.SetProperty( DevelTextEditor::Property::SCROLL_BAR_FADE_DURATION, 0.2f ); + editor.SetProperty( TextEditor::Property::SMOOTH_SCROLL, true ); + editor.SetProperty( TextEditor::Property::SMOOTH_SCROLL_DURATION, 0.2f ); + editor.SetProperty( TextEditor::Property::ENABLE_SCROLL_BAR, true ); + editor.SetProperty( TextEditor::Property::SCROLL_BAR_SHOW_DURATION, 0.3f ); + editor.SetProperty( TextEditor::Property::SCROLL_BAR_FADE_DURATION, 0.2f ); // Avoid a crash when core load gl resources. application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); @@ -1862,7 +1862,7 @@ int utcDaliTextEditorEvent05(void) application.Render(); } // Modify duration after scroll is enabled - editor.SetProperty( DevelTextEditor::Property::SMOOTH_SCROLL_DURATION, 0.1f ); + editor.SetProperty( TextEditor::Property::SMOOTH_SCROLL_DURATION, 0.1f ); // Continuous scroll left to increase coverage for( unsigned int index = 0u; index < 10u; ++index ) @@ -1873,11 +1873,11 @@ int utcDaliTextEditorEvent05(void) application.SendNotification(); application.Render(); } - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::SMOOTH_SCROLL_DURATION ), 0.1f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::SMOOTH_SCROLL ), true, TEST_LOCATION ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::ENABLE_SCROLL_BAR ), true, TEST_LOCATION ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::SCROLL_BAR_SHOW_DURATION ), 0.3f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::SCROLL_BAR_FADE_DURATION ), 0.2f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::SMOOTH_SCROLL_DURATION ), 0.1f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::SMOOTH_SCROLL ), true, TEST_LOCATION ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::ENABLE_SCROLL_BAR ), true, TEST_LOCATION ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::SCROLL_BAR_SHOW_DURATION ), 0.3f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + DALI_TEST_EQUALS( editor.GetProperty( TextEditor::Property::SCROLL_BAR_FADE_DURATION ), 0.2f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); // Press Escape to increase coverage application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); @@ -1981,7 +1981,7 @@ int utcDaliTextEditorHandles(void) editor.SetProperty( TextEditor::Property::TEXT, "This is a long text for the size of the text-editor." ); editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f ); editor.SetProperty( TextEditor::Property::GRAB_HANDLE_IMAGE, HANDLE_IMAGE_FILE_NAME ); - editor.SetProperty( DevelTextEditor::Property::SMOOTH_SCROLL, true ); + editor.SetProperty( TextEditor::Property::SMOOTH_SCROLL, true ); editor.SetSize( 30.f, 500.f ); editor.SetParentOrigin( ParentOrigin::TOP_LEFT ); @@ -2165,11 +2165,11 @@ int utcDaliTextEditorGetPropertyLinecountP(void) Stage::GetCurrent().Add( editor ); editor.SetSize( 100.0f, 100.0f ); - lineCount = editor.GetProperty( DevelTextEditor::Property::LINE_COUNT ); + lineCount = editor.GetProperty( TextEditor::Property::LINE_COUNT ); DALI_TEST_EQUALS( lineCount, 14, TEST_LOCATION ); editor.SetSize( 50.0f, 100.0f ); - lineCount = editor.GetProperty( DevelTextEditor::Property::LINE_COUNT ); + lineCount = editor.GetProperty( TextEditor::Property::LINE_COUNT ); DALI_TEST_EQUALS( lineCount, 28, TEST_LOCATION ); END_TEST; @@ -2190,14 +2190,14 @@ int utcDaliTextEditorScrollStateChangedSignalTest(void) editor.SetSize( 50.f, 50.f ); editor.SetParentOrigin( ParentOrigin::TOP_LEFT ); editor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - editor.SetProperty( DevelTextEditor::Property::ENABLE_SCROLL_BAR, true ); + editor.SetProperty( TextEditor::Property::ENABLE_SCROLL_BAR, true ); editor.SetKeyboardFocusable(true); bool startedCalled = false; bool finishedCalled = false; ScrollStateChangeCallback callback( startedCalled, finishedCalled ); - DevelTextEditor::ScrollStateChangedSignal( editor ).Connect( &callback, &ScrollStateChangeCallback::Callback ); + editor.ScrollStateChangedSignal().Connect( &callback, &ScrollStateChangeCallback::Callback ); KeyboardFocusManager::Get().SetCurrentFocusActor( editor ); @@ -2228,23 +2228,23 @@ int UtcDaliToolkitTextEditorTextWarpMode(void) Stage::GetCurrent().Add( editor ); - editor.SetProperty( DevelTextEditor::Property::LINE_WRAP_MODE, "WORD" ); + editor.SetProperty( TextEditor::Property::LINE_WRAP_MODE, "WORD" ); application.SendNotification(); application.Render(); - lineCount = editor.GetProperty( DevelTextEditor::Property::LINE_COUNT ); + lineCount = editor.GetProperty( TextEditor::Property::LINE_COUNT ); DALI_TEST_EQUALS( lineCount, 4, TEST_LOCATION ); - editor.SetProperty( DevelTextEditor::Property::LINE_WRAP_MODE, "CHARACTER" ); + editor.SetProperty( TextEditor::Property::LINE_WRAP_MODE, "CHARACTER" ); application.SendNotification(); application.Render(); - lineCount = editor.GetProperty( DevelTextEditor::Property::LINE_COUNT ); + lineCount = editor.GetProperty( TextEditor::Property::LINE_COUNT ); DALI_TEST_EQUALS( lineCount, 3, TEST_LOCATION ); END_TEST; diff --git a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp deleted file mode 100644 index e9292bf..0000000 --- a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * 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. - * - */ - -// CLASS HEADER -#include - -// INTERNAL HEADER -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace DevelTextEditor -{ - -ScrollStateChangedSignalType& ScrollStateChangedSignal( TextEditor textEditor ) -{ - return Dali::Toolkit::GetImpl( textEditor ).ScrollStateChangedSignal(); -} - -} // namespace DevelText - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h index 3560363..153a538 100644 --- a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h @@ -74,130 +74,31 @@ namespace Property INPUT_EMBOSS = Dali::Toolkit::TextEditor::Property::INPUT_EMBOSS, OUTLINE = Dali::Toolkit::TextEditor::Property::OUTLINE, INPUT_OUTLINE = Dali::Toolkit::TextEditor::Property::INPUT_OUTLINE, - - /** - * @brief name "smoothScroll", type bool - * @details Enable or disable the smooth scroll animation - * @note This property is currently being used for some applications, so it can't be changed. - */ - SMOOTH_SCROLL = INPUT_OUTLINE + 1, - - /** - * @brief name "smoothScrollDuration", type float - * @details Sets the duration of smooth scroll animation - * @note This property is currently being used for some applications, so it can't be changed. - */ - SMOOTH_SCROLL_DURATION, - - /** - * @brief name "enableScrollBar", type bool - * @details Enable or disable the scroll bar - * @note This property is currently being used for some applications, so it can't be changed. - */ - ENABLE_SCROLL_BAR, - - /** - * @brief name "scrollBarShowDuration", type float - * @details Sets the duration of scroll bar to show - * @note This property is currently being used for some applications, so it can't be changed. - */ - SCROLL_BAR_SHOW_DURATION, - - /** - * @brief name "scrollBarFadeDuration", type float - * @details Sets the duration of scroll bar to fade out - * @note This property is currently being used for some applications, so it can't be changed. - */ - SCROLL_BAR_FADE_DURATION, - - /** - * @brief The size of font in pixels. - * - * Conversion from Point size to Pixel size : - * Pixel size = Point size * DPI / 72 - * @details name "pixelSize", type float - */ - PIXEL_SIZE, - - /** - * @brief The line count of text. - * @details name "lineCount", type int - * @note this property is read-only. - */ - LINE_COUNT, + SMOOTH_SCROLL = Dali::Toolkit::TextEditor::Property::SMOOTH_SCROLL, + SMOOTH_SCROLL_DURATION = Dali::Toolkit::TextEditor::Property::SMOOTH_SCROLL_DURATION, + ENABLE_SCROLL_BAR = Dali::Toolkit::TextEditor::Property::ENABLE_SCROLL_BAR, + SCROLL_BAR_SHOW_DURATION = Dali::Toolkit::TextEditor::Property::SCROLL_BAR_SHOW_DURATION, + SCROLL_BAR_FADE_DURATION = Dali::Toolkit::TextEditor::Property::SCROLL_BAR_FADE_DURATION, + PIXEL_SIZE = Dali::Toolkit::TextEditor::Property::PIXEL_SIZE, + LINE_COUNT = Dali::Toolkit::TextEditor::Property::LINE_COUNT, + ENABLE_SELECTION = Dali::Toolkit::TextEditor::Property::ENABLE_SELECTION, + PLACEHOLDER = Dali::Toolkit::TextEditor::Property::PLACEHOLDER, + LINE_WRAP_MODE = Dali::Toolkit::TextEditor::Property::LINE_WRAP_MODE, /** * @brief The text to display when the TextEditor is empty and inactive. - * @details name "placeholderText", type string + * @details Name "placeholderText", type Property::STRING. */ PLACEHOLDER_TEXT, /** * @brief The placeholder-text color. - * @details name "placeholderTextColor", type vector4 + * @details Name "placeholderTextColor", type Property::VECTOR4. */ PLACEHOLDER_TEXT_COLOR, - - /** - * @brief Enables Text selection, such as the cursor, handle, clipboard, and highlight color. - * @details name "enableSelection", type bool - */ - ENABLE_SELECTION, - - /** - * @brief Sets the placeholder : text, color, font family, font style, point size, and pixel size. - * - * @code - * Property::Map propertyMap; - * propertyMap["placeholderText"] = "Setting Placeholder Text"; - * propertyMap["placeholderTextFocused"] = "Setting Placeholder Text Focused"; - * propertyMap["placeholderColor"] = Color::RED; - * propertyMap["placeholderFontFamily"] = "Arial"; - * propertyMap["placeholderPointSize"] = 12.0f; - * - * Property::Map fontStyleMap; - * fontStyleMap.Insert( "weight", "bold" ); - * fontStyleMap.Insert( "width", "condensed" ); - * fontStyleMap.Insert( "slant", "italic" ); - * propertyMap["placeholderFontStyle"] = fontStyleMap; - * - * editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER, propertyMap ); - * @endcode - * - * @details name "placeholder", type MAP - */ - PLACEHOLDER, - - /** - * @brief line wrap mode when the text lines over layout width. - * @details name "lineWrapMode", type string. - */ - LINE_WRAP_MODE }; -} // namespace Property - -namespace Scroll -{ - enum Type - { - STARTED, ///< Scrolling is started. - FINISHED ///< Scrolling is finished. - }; -} // namespace Scroll - -typedef Signal< void ( TextEditor, Scroll::Type ) > ScrollStateChangedSignalType; -/** - * @brief This signal is emitted when TextEditor scrolling is started or finished. - * - * A callback of the following type may be connected: - * @code - * void YourCallbackName( ScrollState::Type type ); - * @endcode - * type: Whether the scrolling is started or finished. - * @return The signal to connect to - */ -DALI_IMPORT_API ScrollStateChangedSignalType& ScrollStateChangedSignal( TextEditor textEditor ); +} // namespace Property } // namespace DevelTextEditor diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list index 8965e8c..ed9059d 100644 --- a/dali-toolkit/devel-api/file.list +++ b/dali-toolkit/devel-api/file.list @@ -22,7 +22,6 @@ devel_api_src_files = \ $(devel_api_src_dir)/controls/super-blur-view/super-blur-view.cpp \ $(devel_api_src_dir)/controls/text-controls/text-selection-popup.cpp \ $(devel_api_src_dir)/controls/text-controls/text-selection-toolbar.cpp \ - $(devel_api_src_dir)/controls/text-controls/text-editor-devel.cpp \ $(devel_api_src_dir)/controls/tool-bar/tool-bar.cpp \ $(devel_api_src_dir)/focus-manager/keyinput-focus-manager.cpp \ $(devel_api_src_dir)/focus-manager/keyboard-focus-manager-devel.cpp \ diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index 9602d74..5cb7df1 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -138,18 +138,18 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "emboss", DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputEmboss", MAP, INPUT_EMBOSS ) DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "outline", MAP, OUTLINE ) DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "inputOutline", MAP, INPUT_OUTLINE ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "smoothScroll", BOOLEAN, SMOOTH_SCROLL ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "smoothScrollDuration", FLOAT, SMOOTH_SCROLL_DURATION ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableScrollBar", BOOLEAN, ENABLE_SCROLL_BAR ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "scrollBarShowDuration", FLOAT, SCROLL_BAR_SHOW_DURATION ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "scrollBarFadeDuration", FLOAT, SCROLL_BAR_FADE_DURATION ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "pixelSize", FLOAT, PIXEL_SIZE ) -DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextEditor, "lineCount", INTEGER, LINE_COUNT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "smoothScroll", BOOLEAN, SMOOTH_SCROLL ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "smoothScrollDuration", FLOAT, SMOOTH_SCROLL_DURATION ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableScrollBar", BOOLEAN, ENABLE_SCROLL_BAR ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "scrollBarShowDuration", FLOAT, SCROLL_BAR_SHOW_DURATION ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "scrollBarFadeDuration", FLOAT, SCROLL_BAR_FADE_DURATION ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "pixelSize", FLOAT, PIXEL_SIZE ) +DALI_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextEditor, "lineCount", INTEGER, LINE_COUNT ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableSelection", BOOLEAN, ENABLE_SELECTION ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholder", MAP, PLACEHOLDER ) +DALI_PROPERTY_REGISTRATION( Toolkit, TextEditor, "lineWrapMode", STRING, LINE_WRAP_MODE ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderText", STRING, PLACEHOLDER_TEXT ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderTextColor", VECTOR4, PLACEHOLDER_TEXT_COLOR ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableSelection", BOOLEAN, ENABLE_SELECTION ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholder", MAP, PLACEHOLDER ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "lineWrapMode", STRING, LINE_WRAP_MODE ) DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED ) DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED ) @@ -618,7 +618,7 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P } break; } - case Toolkit::DevelTextEditor::Property::SMOOTH_SCROLL: + case Toolkit::TextEditor::Property::SMOOTH_SCROLL: { const bool enable = value.Get< bool >(); DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor SMOOTH_SCROLL %d\n", enable ); @@ -626,7 +626,7 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P impl.mScrollAnimationEnabled = enable; break; } - case Toolkit::DevelTextEditor::Property::SMOOTH_SCROLL_DURATION: + case Toolkit::TextEditor::Property::SMOOTH_SCROLL_DURATION: { const float duration = value.Get< float >(); DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor SMOOTH_SCROLL_DURATION %f\n", duration ); @@ -638,7 +638,7 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P } break; } - case Toolkit::DevelTextEditor::Property::ENABLE_SCROLL_BAR: + case Toolkit::TextEditor::Property::ENABLE_SCROLL_BAR: { const bool enable = value.Get< bool >(); DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor SHOW_SCROLL_BAR %d\n", enable ); @@ -646,7 +646,7 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P impl.mScrollBarEnabled = enable; break; } - case Toolkit::DevelTextEditor::Property::SCROLL_BAR_SHOW_DURATION: + case Toolkit::TextEditor::Property::SCROLL_BAR_SHOW_DURATION: { const float duration = value.Get< float >(); DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor SCROLL_BAR_SHOW_DURATION %f\n", duration ); @@ -654,7 +654,7 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P impl.mAnimationPeriod.delaySeconds = duration; break; } - case Toolkit::DevelTextEditor::Property::SCROLL_BAR_FADE_DURATION: + case Toolkit::TextEditor::Property::SCROLL_BAR_FADE_DURATION: { const float duration = value.Get< float >(); DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor SCROLL_BAR_FADE_DURATION %f\n", duration ); @@ -662,7 +662,7 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P impl.mAnimationPeriod.durationSeconds = duration; break; } - case Toolkit::DevelTextEditor::Property::PIXEL_SIZE: + case Toolkit::TextEditor::Property::PIXEL_SIZE: { if( impl.mController ) { @@ -702,7 +702,7 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P } break; } - case Toolkit::DevelTextEditor::Property::ENABLE_SELECTION: + case Toolkit::TextEditor::Property::ENABLE_SELECTION: { if( impl.mController ) { @@ -712,7 +712,7 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P } break; } - case Toolkit::DevelTextEditor::Property::PLACEHOLDER: + case Toolkit::TextEditor::Property::PLACEHOLDER: { const Property::Map* map = value.GetMap(); if( map ) @@ -721,7 +721,7 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P } break; } - case Toolkit::DevelTextEditor::Property::LINE_WRAP_MODE: + case Toolkit::TextEditor::Property::LINE_WRAP_MODE: { const std::string& wrapModeStr = value.Get< std::string >(); DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p LINE_WRAP_MODE %s\n", impl.mController.Get(), wrapModeStr.c_str() ); @@ -1037,32 +1037,32 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind GetOutlineProperties( impl.mController, value, Text::EffectStyle::INPUT ); break; } - case Toolkit::DevelTextEditor::Property::SMOOTH_SCROLL: + case Toolkit::TextEditor::Property::SMOOTH_SCROLL: { value = impl.mScrollAnimationEnabled; break; } - case Toolkit::DevelTextEditor::Property::SMOOTH_SCROLL_DURATION: + case Toolkit::TextEditor::Property::SMOOTH_SCROLL_DURATION: { value = impl.mScrollAnimationDuration; break; } - case Toolkit::DevelTextEditor::Property::ENABLE_SCROLL_BAR: + case Toolkit::TextEditor::Property::ENABLE_SCROLL_BAR: { value = impl.mScrollBarEnabled; break; } - case Toolkit::DevelTextEditor::Property::SCROLL_BAR_SHOW_DURATION: + case Toolkit::TextEditor::Property::SCROLL_BAR_SHOW_DURATION: { value = impl.mAnimationPeriod.delaySeconds; break; } - case Toolkit::DevelTextEditor::Property::SCROLL_BAR_FADE_DURATION: + case Toolkit::TextEditor::Property::SCROLL_BAR_FADE_DURATION: { value = impl.mAnimationPeriod.durationSeconds; break; } - case Toolkit::DevelTextEditor::Property::PIXEL_SIZE: + case Toolkit::TextEditor::Property::PIXEL_SIZE: { if( impl.mController ) { @@ -1070,7 +1070,7 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind } break; } - case Toolkit::DevelTextEditor::Property::LINE_COUNT: + case Toolkit::TextEditor::Property::LINE_COUNT: { if( impl.mController ) { @@ -1097,7 +1097,7 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind } break; } - case Toolkit::DevelTextEditor::Property::ENABLE_SELECTION: + case Toolkit::TextEditor::Property::ENABLE_SELECTION: { if( impl.mController ) { @@ -1105,14 +1105,14 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind } break; } - case Toolkit::DevelTextEditor::Property::PLACEHOLDER: + case Toolkit::TextEditor::Property::PLACEHOLDER: { Property::Map map; impl.mController->GetPlaceholderProperty( map ); value = map; break; } - case Toolkit::DevelTextEditor::Property::LINE_WRAP_MODE: + case Toolkit::TextEditor::Property::LINE_WRAP_MODE: { if( impl.mController ) { @@ -1159,7 +1159,7 @@ Toolkit::TextEditor::InputStyleChangedSignalType& TextEditor::InputStyleChangedS return mInputStyleChangedSignal; } -Toolkit::DevelTextEditor::ScrollStateChangedSignalType& TextEditor::ScrollStateChangedSignal() +Toolkit::TextEditor::ScrollStateChangedSignalType& TextEditor::ScrollStateChangedSignal() { return mScrollStateChangedSignal; } @@ -1647,7 +1647,7 @@ void TextEditor::UpdateScrollBar() { mScrollStarted = true; Dali::Toolkit::TextEditor handle( GetOwner() ); - mScrollStateChangedSignal.Emit( handle, DevelTextEditor::Scroll::STARTED ); + mScrollStateChangedSignal.Emit( handle, Toolkit::TextEditor::Scroll::STARTED ); } Actor indicator = mScrollBar.GetScrollIndicator(); @@ -1672,7 +1672,7 @@ void TextEditor::OnScrollIndicatorAnimationFinished( Animation& animation ) { mScrollStarted = false; Dali::Toolkit::TextEditor handle( GetOwner() ); - mScrollStateChangedSignal.Emit( handle, DevelTextEditor::Scroll::FINISHED ); + mScrollStateChangedSignal.Emit( handle, Toolkit::TextEditor::Scroll::FINISHED ); } } diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.h b/dali-toolkit/internal/controls/text-controls/text-editor-impl.h index 6fbced9..f121799 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.h @@ -23,7 +23,6 @@ #include // INTERNAL INCLUDES -#include #include #include #include @@ -97,9 +96,9 @@ public: Toolkit::TextEditor::InputStyleChangedSignalType& InputStyleChangedSignal(); /** - * @copydoc DevelTextEditor::ScrollStateChangedSignal() + * @copydoc TextEditor::ScrollStateChangedSignal() */ - Toolkit::DevelTextEditor::ScrollStateChangedSignalType& ScrollStateChangedSignal(); + Toolkit::TextEditor::ScrollStateChangedSignalType& ScrollStateChangedSignal(); private: // From Control @@ -282,7 +281,7 @@ private: // Data // Signals Toolkit::TextEditor::TextChangedSignalType mTextChangedSignal; Toolkit::TextEditor::InputStyleChangedSignalType mInputStyleChangedSignal; - Toolkit::DevelTextEditor::ScrollStateChangedSignalType mScrollStateChangedSignal; + Toolkit::TextEditor::ScrollStateChangedSignalType mScrollStateChangedSignal; ImfManager mImfManager; Text::ControllerPtr mController; diff --git a/dali-toolkit/internal/text/hidden-text.cpp b/dali-toolkit/internal/text/hidden-text.cpp index b0e92c3..0dc8b9e 100644 --- a/dali-toolkit/internal/text/hidden-text.cpp +++ b/dali-toolkit/internal/text/hidden-text.cpp @@ -19,7 +19,7 @@ #include // INTERNAL INCLUDES -#include +#include using namespace Dali::Toolkit; diff --git a/dali-toolkit/public-api/controls/text-controls/text-editor.cpp b/dali-toolkit/public-api/controls/text-controls/text-editor.cpp index 4098e8b..f02d843 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-editor.cpp +++ b/dali-toolkit/public-api/controls/text-controls/text-editor.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. @@ -69,6 +69,12 @@ TextEditor::InputStyleChangedSignalType& TextEditor::InputStyleChangedSignal() return Dali::Toolkit::GetImpl( *this ).InputStyleChangedSignal(); } + +TextEditor::ScrollStateChangedSignalType& TextEditor::ScrollStateChangedSignal() +{ + return Dali::Toolkit::GetImpl( *this ).ScrollStateChangedSignal(); +} + TextEditor::TextEditor( Internal::TextEditor& implementation ) : Control( implementation ) { diff --git a/dali-toolkit/public-api/controls/text-controls/text-editor.h b/dali-toolkit/public-api/controls/text-controls/text-editor.h index a52b13e..659e339 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-editor.h +++ b/dali-toolkit/public-api/controls/text-controls/text-editor.h @@ -2,7 +2,7 @@ #define __DALI_TOOLKIT_TEXT_EDITOR_H__ /* - * 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. @@ -72,46 +72,379 @@ public: */ enum { - RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "renderingBackend", The type or rendering e.g. bitmap-based, type INT @SINCE_1_1.37 - TEXT, ///< name "text", The text to display in UTF-8 format, type STRING @SINCE_1_1.37 - TEXT_COLOR, ///< name "textColor", The text color, type VECTOR4 @SINCE_1_1.37 - FONT_FAMILY, ///< name "fontFamily", The requested font family, type STRING @SINCE_1_1.37 - FONT_STYLE, ///< name "fontStyle", The requested font style, type STRING or MAP @SINCE_1_2.13 - POINT_SIZE, ///< name "pointSize", The size of font in points (Conversion from Pixel size to Point size : Point size = Pixel size * 72 / DPI), type FLOAT @SINCE_1_1.37 - HORIZONTAL_ALIGNMENT, ///< name "horizontalAlignment", The text horizontal alignment, type STRING, values "BEGIN", "CENTER", "END" @SINCE_1_1.37 - SCROLL_THRESHOLD, ///< name "scrollThreshold" Vertical scrolling will occur if the cursor is this close to the control border, type FLOAT @SINCE_1_1.37 - SCROLL_SPEED, ///< name "scrollSpeed" The scroll speed in pixels per second, type FLOAT @SINCE_1_1.37 - PRIMARY_CURSOR_COLOR, ///< name "primaryCursorColor", The color to apply to the primary cursor, type VECTOR4 @SINCE_1_1.37 - SECONDARY_CURSOR_COLOR, ///< name "secondaryCursorColor", The color to apply to the secondary cursor, type VECTOR4 @SINCE_1_1.37 - ENABLE_CURSOR_BLINK, ///< name "enableCursorBlink", Whether the cursor should blink or not, type BOOLEAN @SINCE_1_1.37 - CURSOR_BLINK_INTERVAL, ///< name "cursorBlinkInterval", The time interval in seconds between cursor on/off states, type FLOAT @SINCE_1_1.37 - CURSOR_BLINK_DURATION, ///< name "cursorBlinkDuration", The cursor will stop blinking after this number of seconds (if non-zero), type FLOAT @SINCE_1_1.37 - CURSOR_WIDTH, ///< name "cursorWidth", The cursor width, type INTEGER @SINCE_1_1.37 - GRAB_HANDLE_IMAGE, ///< name "grabHandleImage", The image to display for the grab handle, type STRING @SINCE_1_1.37 - GRAB_HANDLE_PRESSED_IMAGE, ///< name "grabHandlePressedImage", The image to display when the grab handle is pressed, type STRING @SINCE_1_1.37 - SELECTION_HANDLE_IMAGE_LEFT, ///< name "selectionHandleImageLeft", The image to display for the left selection handle, type MAP @SINCE_1_1.37 - SELECTION_HANDLE_IMAGE_RIGHT, ///< name "selectionHandleImageRight", The image to display for the right selection handle, type MAP @SINCE_1_1.37 - SELECTION_HANDLE_PRESSED_IMAGE_LEFT, ///< name "selectionHandlePressedImageLeft", The image to display when the left selection handle is pressed, type MAP @SINCE_1_1.37 - SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, ///< name "selectionHandlePressedImageRight", The image to display when the right selection handle is pressed, type MAP @SINCE_1_1.37 - SELECTION_HANDLE_MARKER_IMAGE_LEFT, ///< name "selectionHandleMarkerImageLeft", The image to display for the left selection handle marker, type MAP @SINCE_1_1.37 - SELECTION_HANDLE_MARKER_IMAGE_RIGHT, ///< name "selectionHandleMarkerImageRight", The image to display for the right selection handle marker, type MAP @SINCE_1_1.37 - SELECTION_HIGHLIGHT_COLOR, ///< name "selectionHighlightColor", The color of the selection highlight, type VECTOR4 @SINCE_1_1.37 - DECORATION_BOUNDING_BOX, ///< name "decorationBoundingBox", The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE @SINCE_1_1.37 - ENABLE_MARKUP, ///< name "enableMarkup", Whether the mark-up processing is enabled. type BOOLEAN @SINCE_1_1.37 - INPUT_COLOR, ///< name "inputColor", The color of the new input text, type VECTOR4 @SINCE_1_1.37 - INPUT_FONT_FAMILY, ///< name "inputFontFamily", The font's family of the new input text, type STRING @SINCE_1_1.37 - INPUT_FONT_STYLE, ///< name "inputFontStyle", The font's style of the new input text, type STRING or MAP @SINCE_1_2.13 - INPUT_POINT_SIZE, ///< name "inputPointSize", The font's size of the new input text in points, type FLOAT @SINCE_1_1.37 - LINE_SPACING, ///< name "lineSpacing", The default extra space between lines in points, type FLOAT @SINCE_1_1.37 - INPUT_LINE_SPACING, ///< name "inputLineSpacing" The extra space between lines in points. It affects the whole paragraph where the new input text is inserted, type FLOAT @SINCE_1_1.37 - UNDERLINE, ///< name "underline" The default underline parameters, type STRING or MAP @SINCE_1_2.13 - INPUT_UNDERLINE, ///< name "inputUnderline" The underline parameters of the new input text, type STRING or MAP @SINCE_1_2.13 - SHADOW, ///< name "shadow" The default shadow parameters, type STRING or MAP @SINCE_1_2.13 - INPUT_SHADOW, ///< name "inputShadow" The shadow parameters of the new input text, type STRING or MAP @SINCE_1_2.13 - EMBOSS, ///< name "emboss" The default emboss parameters, type STRING or MAP @SINCE_1_2.13 - INPUT_EMBOSS, ///< name "inputEmboss" The emboss parameters of the new input text, type STRING or MAP @SINCE_1_2.13 - OUTLINE, ///< name "outline" The default outline parameters, type STRING or MAP @SINCE_1_2.13 - INPUT_OUTLINE, ///< name "inputOutline" The outline parameters of the new input text, type STRING or MAP @SINCE_1_2.13 + /** + * @brief The type or rendering e.g. bitmap-based. + * @details Name "renderingBackend", type Property::INTEGER. + * @SINCE_1_1.37 + */ + RENDERING_BACKEND = PROPERTY_START_INDEX, + + /** + * @brief The text to display in UTF-8 format. + * @details Name "text", type Property::STRING. + * @SINCE_1_1.37 + */ + TEXT, + + /** + * @brief The text color. + * @details Name "textColor", type Property::VECTOR4. + * @SINCE_1_1.37 + */ + TEXT_COLOR, + + /** + * @brief The requested font family. + * @details Name "fontFamily", type Property::STRING. + * @SINCE_1_1.37 + */ + FONT_FAMILY, + + /** + * @brief The requested font style. + * @details Name "fontStyle", type Property::STRING or Property::MAP. + * @SINCE_1_2.13 + */ + FONT_STYLE, + + /** + * @brief The size of font in points. + * @details Name "pointSize", type Property::FLOAT. + * Conversion from Pixel size to Point size : Point size = Pixel size * 72 / DPI. + * @SINCE_1_1.37 + */ + POINT_SIZE, + + /** + * @brief The text horizontal alignment. + * @details Name "horizontalAlignment", type Property::STRING. + * Values "BEGIN" "CENTER" "END". + * @SINCE_1_1.37 + */ + HORIZONTAL_ALIGNMENT, + + /** + * @brief Vertical scrolling will occur if the cursor is this close to the control border. + * @details Name "scrollThreshold", type Property::FLOAT. + * @SINCE_1_1.37 + */ + SCROLL_THRESHOLD, + + /** + * @brief The scroll speed in pixels per second. + * @details Name "scrollSpeed", type Property::FLOAT. + * @SINCE_1_1.37 + */ + SCROLL_SPEED, + + /** + * @brief The color to apply to the primary cursor. + * @details Name "primaryCursorColor", type Property::VECTOR4. + * @SINCE_1_1.37 + */ + PRIMARY_CURSOR_COLOR, + + /** + * @brief The color to apply to the secondary cursor. + * @details Name "secondaryCursorColor", type Property::VECTOR4. + * @SINCE_1_1.37 + */ + SECONDARY_CURSOR_COLOR, + + /** + * @brief Whether the cursor should blink or not. + * @details Name "enableCursorBlink", type Property::BOOLEAN. + * @SINCE_1_1.37 + */ + ENABLE_CURSOR_BLINK, + + /** + * @brief The time interval in seconds between cursor on/off states. + * @details Name "cursorBlinkInterval", type Property::FLOAT. + * @SINCE_1_1.37 + */ + CURSOR_BLINK_INTERVAL, + + /** + * @brief The cursor will stop blinking after this number of seconds (if non-zero). + * @details Name "cursorBlinkDuration", type Property::FLOAT. + * @SINCE_1_1.37 + */ + CURSOR_BLINK_DURATION, + + /** + * @brief The cursor width. + * @details Name "cursorWidth", type Property::INTEGER. + * @SINCE_1_1.37 + */ + CURSOR_WIDTH, + + /** + * @brief The image to display for the grab handle. + * @details Name "grabHandleImage", type Property::STRING. + * @SINCE_1_1.37 + */ + GRAB_HANDLE_IMAGE, + + /** + * @brief The image to display when the grab handle is pressed. + * @details Name "grabHandlePressedImage", type Property::STRING. + * @SINCE_1_1.37 + */ + GRAB_HANDLE_PRESSED_IMAGE, + + /** + * @brief The image to display for the left selection handle. + * @details Name "selectionHandleImageLeft", type Property::MAP. + * @SINCE_1_1.37 + */ + SELECTION_HANDLE_IMAGE_LEFT, + + /** + * @brief The image to display for the right selection handle. + * @details Name "selectionHandleImageRight", type Property::MAP. + * @SINCE_1_1.37 + */ + SELECTION_HANDLE_IMAGE_RIGHT, + + /** + * @brief The image to display when the left selection handle is pressed. + * @details Name "selectionHandlePressedImageLeft", type Property::MAP. + * @SINCE_1_1.37 + */ + SELECTION_HANDLE_PRESSED_IMAGE_LEFT, + + /** + * @brief The image to display when the right selection handle is pressed. + * @details Name "selectionHandlePressedImageRight", type Property::MAP. + * @SINCE_1_1.37 + */ + SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, + + /** + * @brief The image to display for the left selection handle marker. + * @details Name "selectionHandleMarkerImageLeft", type Property::MAP. + * @SINCE_1_1.37 + */ + SELECTION_HANDLE_MARKER_IMAGE_LEFT, + + /** + * @brief The image to display for the right selection handle marker. + * @details Name "selectionHandleMarkerImageRight", type Property::MAP. + * @SINCE_1_1.37 + */ + SELECTION_HANDLE_MARKER_IMAGE_RIGHT, + + /** + * @brief The color of the selection highlight. + * @details Name "selectionHighlightColor", type Property::VECTOR4. + * @SINCE_1_1.37 + */ + SELECTION_HIGHLIGHT_COLOR, + + /** + * @brief The decorations (handles etc) will positioned within this area on-screen. + * @details Name "decorationBoundingBox", type Property::RECTANGLE. + * @SINCE_1_1.37 + */ + DECORATION_BOUNDING_BOX, + + /** + * @brief Whether the mark-up processing is enabled. + * @details Name "enableMarkup", type Property::BOOLEAN. + * @SINCE_1_1.37 + */ + ENABLE_MARKUP, + + /** + * @brief The color of the new input text. + * @details Name "inputColor", type Property::VECTOR4. + * @SINCE_1_1.37 + */ + INPUT_COLOR, + + /** + * @brief The font's family of the new input text. + * @details Name "inputFontFamily", type Property::STRING. + * @SINCE_1_1.37 + */ + INPUT_FONT_FAMILY, + + /** + * @brief The font's style of the new input text. + * @details Name "inputFontStyle", type Property::MAP. + * @SINCE_1_2.13 + */ + INPUT_FONT_STYLE, + + /** + * @brief The font's size of the new input text in points. + * @details Name "inputPointSize", type Property::FLOAT. + * @SINCE_1_1.37 + */ + INPUT_POINT_SIZE, + + /** + * @brief The default extra space between lines in points. + * @details Name "lineSpacing", type Property::FLOAT. + * @SINCE_1_1.37 + */ + LINE_SPACING, + + /** + * @brief The extra space between lines in points. + * @details Name "inputLineSpacing", type Property::FLOAT. + * @SINCE_1_1.37 + * @note This affects the whole paragraph where the new input text is inserted. + */ + INPUT_LINE_SPACING, + + /** + * @brief The default underline parameters. + * @details Name "underline", type Property::MAP. + * @SINCE_1_2.13 + */ + UNDERLINE, + + /** + * @brief The underline parameters of the new input text. + * @details Name "inputUnderline", type Property::MAP. + * @SINCE_1_2.13 + */ + INPUT_UNDERLINE, + + /** + * @brief The default shadow parameters. + * @details Name "shadow", type Property::MAP. + * @SINCE_1_2.13 + */ + SHADOW, + + /** + * @brief The shadow parameters of the new input text. + * @details Name "inputShadow", type Property::MAP. + * @SINCE_1_2.13 + */ + INPUT_SHADOW, + + /** + * @brief The default emboss parameters. + * @details Name "emboss", type Property::MAP. + * @SINCE_1_2.13 + */ + EMBOSS, + + /** + * @brief The emboss parameters of the new input text. + * @details Name "inputEmboss", type Property::MAP. + * @SINCE_1_2.13 + */ + INPUT_EMBOSS, + + /** + * @brief The default outline parameters. + * @details Name "outline", type Property::MAP. + * @SINCE_1_2.13 + */ + OUTLINE, + + /** + * @brief The outline parameters of the new input text. + * @details Name "inputOutline", type Property::MAP. + * @SINCE_1_2.13 + */ + INPUT_OUTLINE, + + /** + * @brief Enable or disable the smooth scroll animation. + * @details Name "smoothScroll", type Property::BOOLEAN. + * @SINCE_1_2.60 + */ + SMOOTH_SCROLL, + + /** + * @brief Sets the duration of smooth scroll animation. + * @details Name "smoothScrollDuration", type Property::FLOAT. + * @SINCE_1_2.60 + */ + SMOOTH_SCROLL_DURATION, + + /** + * @brief Enable or disable the scroll bar. + * @details Name "enableScrollBar", type Property::BOOLEAN. + * @SINCE_1_2.60 + */ + ENABLE_SCROLL_BAR, + + /** + * @brief Sets the duration of scroll bar to show. + * @details Name "scrollBarShowDuration", type Property::FLOAT. + * @SINCE_1_2.60 + */ + SCROLL_BAR_SHOW_DURATION, + + /** + * @brief Sets the duration of scroll bar to fade out. + * @details Name "scrollBarFadeDuration", type Property::FLOAT. + * @SINCE_1_2.60 + */ + SCROLL_BAR_FADE_DURATION, + + /** + * @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 The line count of text. + * @details Name "lineCount", type Property::INTEGER. + * @SINCE_1_2.60 + * @note This property is read-only. + */ + LINE_COUNT, + + /** + * @brief Enables Text selection, such as the cursor, handle, clipboard, and highlight color. + * @details Name "enableSelection", type Property::BOOLEAN. + * @SINCE_1_2.60 + */ + ENABLE_SELECTION, + + /** + * @brief Sets the placeholder : text, color, font family, font style, point size, and pixel size. + * @details Name "placeholder", type Property::MAP. + * Example: + * @code + * Property::Map propertyMap; + * propertyMap["placeholderText"] = "Setting Placeholder Text"; + * propertyMap["placeholderTextFocused"] = "Setting Placeholder Text Focused"; + * propertyMap["placeholderColor"] = Color::RED; + * propertyMap["placeholderFontFamily"] = "Arial"; + * propertyMap["placeholderPointSize"] = 12.0f; + * + * Property::Map fontStyleMap; + * fontStyleMap.Insert( "weight", "bold" ); + * fontStyleMap.Insert( "width", "condensed" ); + * fontStyleMap.Insert( "slant", "italic" ); + * propertyMap["placeholderFontStyle"] = fontStyleMap; + * + * editor.SetProperty( TextEditor::Property::PLACEHOLDER, propertyMap ); + * @endcode + * + * @SINCE_1_2.60 + */ + PLACEHOLDER, + + /** + * @brief line wrap mode when the text lines over layout width. + * @details Name "lineWrapMode", type Property::STRING. + * @SINCE_1_2.60 + */ + LINE_WRAP_MODE, }; }; @@ -141,6 +474,25 @@ public: }; }; + /** + * @brief Enumerations for the type of scrolling. + * @SINCE_1_2.60 + * @see ScrollStateChangedSignal() + */ + struct Scroll + { + /** + * @brief Enumerations for the type of scrolling. + * @SINCE_1_2.60 + * @see ScrollStateChangedSignal() + */ + enum Type + { + STARTED, ///< Scrolling has started. @SINCE_1_2.60 + FINISHED ///< Scrolling has finished. @SINCE_1_2.60 + }; + }; + // Type Defs /** @@ -156,6 +508,12 @@ public: typedef Signal InputStyleChangedSignalType; /** + * @brief Scroll state changed signal type. + * @SINCE_1_2.60 + */ + typedef Signal< void ( TextEditor, Scroll::Type ) > ScrollStateChangedSignalType; + + /** * @brief Creates the TextEditor control. * * @SINCE_1_1.37 @@ -236,6 +594,20 @@ public: */ InputStyleChangedSignalType& InputStyleChangedSignal(); + /** + * @brief This signal is emitted when TextEditor scrolling is started or finished. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( Scroll::Type type ); + * @endcode + * type: Whether the scrolling is started or finished. + * + * @SINCE_1_2.60 + * @return The signal to connect to + */ + ScrollStateChangedSignalType& ScrollStateChangedSignal(); + public: // Not intended for application developers /// @cond internal