X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-editor-impl.cpp;h=cc8804d39f372cfd5ec79877db3e83e0f2f59972;hp=a75e21c015d9ef83f686adbcc0d816e3c8e781fd;hb=refs%2Fchanges%2F16%2F269516%2F7;hpb=d52cfe949a764d4ab0584b99d1322f06c8acd92f 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 a75e21c..cc8804d 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -166,6 +166,7 @@ DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "inputFiltered", SIGNAL_IN DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "cursorPositionChanged", SIGNAL_CURSOR_POSITION_CHANGED) DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "selectionChanged", SIGNAL_SELECTION_CHANGED ) DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "selectionCleared", SIGNAL_SELECTION_CLEARED ) +DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "selectionStarted", SIGNAL_SELECTION_STARTED ) DALI_TYPE_REGISTRATION_END() // clang-format on @@ -404,6 +405,11 @@ DevelTextEditor::SelectionClearedSignalType& TextEditor::SelectionClearedSignal( return mSelectionClearedSignal; } +DevelTextEditor::SelectionStartedSignalType& TextEditor::SelectionStartedSignal() +{ + return mSelectionStartedSignal; +} + Text::ControllerPtr TextEditor::GetTextController() { return mController; @@ -472,6 +478,14 @@ bool TextEditor::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* editorImpl.SelectionClearedSignal().Connect(tracker, functor); } } + else if(0 == strcmp(signalName.c_str(), SIGNAL_SELECTION_STARTED)) + { + if(editor) + { + Internal::TextEditor& editorImpl(GetImpl(editor)); + editorImpl.SelectionStartedSignal().Connect(tracker, functor); + } + } else { // signalName does not match any signal @@ -718,6 +732,11 @@ void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container) EmitCursorPositionChangedSignal(); } + if(mSelectionStarted) + { + EmitSelectionStartedSignal(); + } + if(mSelectionChanged) { EmitSelectionChangedSignal(); @@ -975,6 +994,13 @@ void TextEditor::EmitSelectionClearedSignal() mSelectionCleared = false; } +void TextEditor::EmitSelectionStartedSignal() +{ + Dali::Toolkit::TextEditor handle(GetOwner()); + mSelectionStartedSignal.Emit(handle); + mSelectionStarted = false; +} + void TextEditor::SelectionChanged(uint32_t oldStart, uint32_t oldEnd, uint32_t newStart, uint32_t newEnd) { if(((oldStart != newStart) || (oldEnd != newEnd)) && !mSelectionChanged) @@ -983,6 +1009,13 @@ void TextEditor::SelectionChanged(uint32_t oldStart, uint32_t oldEnd, uint32_t n { mSelectionCleared = true; } + else + { + if(oldStart == oldEnd) + { + mSelectionStarted = true; + } + } mSelectionChanged = true; mOldSelectionStart = oldStart; @@ -1282,7 +1315,8 @@ TextEditor::TextEditor() mSelectionCleared(false), mOldPosition(0u), mOldSelectionStart(0u), - mOldSelectionEnd(0u) + mOldSelectionEnd(0u), + mSelectionStarted(false) { }