Spannable-Core: Add SetSpannedText API 07/282807/15
authorssabah <s.sabah@samsung.com>
Tue, 11 Oct 2022 22:30:29 +0000 (01:30 +0300)
committerBowon Ryu <bowon.ryu@samsung.com>
Tue, 8 Nov 2022 02:24:14 +0000 (11:24 +0900)
commitd4938b4b2872ea432f45fcdedbc13e85af0d08df
treead1e61dfd09a08fa5fdc49e4edc01cc6ede23f91
parent83902cc72796cacafb20815aeeef5dc1846f9f0a
Spannable-Core: Add SetSpannedText API

  Copy text from Spanned-Text into TextController and apply styles on it.

  void SetSpannedText(TextController textController, const Spanned& spannedText);

  TextController: TextLabel, TextEditor or TextField

  This patch should be preceded by the patch below:
  https://review.tizen.org/gerrit/c/platform/core/uifw/dali-toolkit/+/282806

//Example:

    Dali::Toolkit::Text::SpannableString ss = Dali::Toolkit::Text::SpannableString::New("Hello مرحبا");

    auto isAddedBlue = ss.AttachSpan(
      Dali::Toolkit::Text::ForegroundColorSpan::New(Color::BLUE),
      Dali::Toolkit::Text::Range::New(2u, 4u));

    Dali::Toolkit::Text::SetSpannedText(textLabel, ss);

Change-Id: I03202eb27376d78403050a284a1448f01c4ac120
22 files changed:
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-TextSpannable.cpp [new file with mode: 0644]
dali-toolkit/devel-api/controls/text-controls/text-spannable.cpp [new file with mode: 0644]
dali-toolkit/devel-api/controls/text-controls/text-spannable.h [new file with mode: 0644]
dali-toolkit/devel-api/file.list
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/file.list
dali-toolkit/internal/text/controller/text-controller-spannable-handler.cpp [new file with mode: 0644]
dali-toolkit/internal/text/controller/text-controller-spannable-handler.h [new file with mode: 0644]
dali-toolkit/internal/text/controller/text-controller-text-updater.cpp
dali-toolkit/internal/text/controller/text-controller.cpp
dali-toolkit/internal/text/controller/text-controller.h
dali-toolkit/internal/text/logical-model-impl.cpp
dali-toolkit/internal/text/logical-model-impl.h
dali-toolkit/internal/text/spannable/spans/base-span-impl.h
dali-toolkit/internal/text/spannable/spans/foreground-color-span-impl.cpp
dali-toolkit/internal/text/spannable/spans/foreground-color-span-impl.h