Handle Emoji clustering for cursor handling 32/272432/9
authorssabah <s.sabah@samsung.com>
Wed, 16 Mar 2022 14:32:21 +0000 (17:32 +0300)
committershrouq Sabah <s.sabah@samsung.com>
Sun, 27 Mar 2022 08:50:27 +0000 (08:50 +0000)
commit5d397f414305c86782668ecd154d8967ee8396b0
tree0a1e7bb91d11b5d3add128c8e97d614988eb827e
parent297bb57457856f35d1a72c2879be26c32ae329ff
Handle Emoji clustering for cursor handling

Checked cases:
  - cursor movement (arrows): it works fine
  - line-breaking: it works fine
Resolved cases:
  - deletion: this patch handled delete cases when the cursor is before or after Emoji
    :: Before: when use delete key and cursor is before Emoji
    :: After: when use backspace key and cursor is after Emoji
  - Emoji layoutted at the end of line: this patch handle the below scenario
    1) When there is Emoji contains multi unicodes and it is layoutted at the end of line (LineWrap case , is not new line case)
    2) Try to click at the center or at the end of Emoji then the cursor appears inside Emoji
    3) Example:"FamilyManWomanGirlBoy &#x1F468;&#x200D;&#x1F469;&#x200D;&#x1F467;&#x200D;&#x1F466;"

 Sample code to test:
 ============================================================================
    TextEditor textEditor = TextEditor::New();
    textEditor.SetBackgroundColor(Dali::Color::GRAY);
    textEditor.SetProperty(Dali::Toolkit::TextEditor::Property::TEXT, "AB&#x1F468;&#x200D;&#x1F469;&#x200D;&#x1F467;&#x200D;&#x1F466;AB&#x1F469;&#x1F3FB;&#x200D;&#x1F52C;B&#x1F468;&#x200D;&#x1F469;&#x200D;&#x1F467;&#x200D;&#x1F466;AA&#x262a;&#xfe0e;B&#x262a;&#xfe0f;AB");
    textEditor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
    textEditor.SetProperty(Dali::Actor::Property::POSITION, Vector2(10, 30));
    textEditor.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
    textEditor.SetProperty(Dali::Toolkit::TextEditor::Property::ENABLE_MARKUP, true);
    textEditor.SetProperty(Dali::Toolkit::DevelTextEditor::Property::LINE_WRAP_MODE, Dali::Toolkit::DevelText::LineWrap::WORD);

 ============================================================================

Change-Id: I6d142c58c5cdef5e900404cca8b777a02c8488d1
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Characters.cpp [new file with mode: 0755]
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Cursor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
dali-toolkit/internal/file.list
dali-toolkit/internal/text/characters-helper-functions.cpp [new file with mode: 0644]
dali-toolkit/internal/text/characters-helper-functions.h [new file with mode: 0644]
dali-toolkit/internal/text/cursor-helper-functions.cpp
dali-toolkit/internal/text/text-controller-text-updater.cpp