X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-editor-impl.cpp;h=ea5f43c04a6eb37ab0713152db18a27b05654d21;hb=e4025736c4d5e85ab7408f9d6932cc7b3e9c9fef;hp=890b22c5a6d82fcf0fa529980e8b36eeb9e32923;hpb=8d70765e9e608bda15d8e04720687f3a0ddc0e81;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git 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 890b22c..ea5f43c 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -233,10 +233,10 @@ Toolkit::TextEditor::InputStyle::Mask ConvertInputStyle(Text::InputStyle::Mask i } // namespace -Toolkit::TextEditor TextEditor::New() +Toolkit::TextEditor TextEditor::New(ControlBehaviour additionalBehaviour) { // Create the implementation, temporarily owned by this handle on stack - IntrusivePtr impl = new TextEditor(); + IntrusivePtr impl = new TextEditor(additionalBehaviour); // Pass ownership to CustomActor handle Toolkit::TextEditor handle(*impl); @@ -369,6 +369,21 @@ Rect TextEditor::GetLineBoundingRectangle(const uint32_t lineIndex) const return mController->GetLineBoundingRectangle(lineIndex); } +Rect TextEditor::GetCharacterBoundingRectangle(const uint32_t charIndex) const +{ + return mController->GetCharacterBoundingRectangle(charIndex); +} + +int TextEditor::GetCharacterIndexAtPosition(float visualX, float visualY) const +{ + return mController->GetCharacterIndexAtPosition(visualX, visualY); +} + +void TextEditor::SetSpannedText(const Text::Spanned& spannedText) +{ + mController->SetSpannedText(spannedText); +} + string TextEditor::GetSelectedText() const { string selectedText = ""; @@ -899,7 +914,7 @@ void TextEditor::OnTap(const TapGesture& gesture) mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top); Dali::Toolkit::KeyboardFocusManager keyboardFocusManager = Dali::Toolkit::KeyboardFocusManager::Get(); - if (keyboardFocusManager) + if(keyboardFocusManager) { keyboardFocusManager.SetCurrentFocusActor(Self()); } @@ -939,7 +954,7 @@ bool TextEditor::OnKeyEvent(const KeyEvent& event) if(event.GetState() == KeyEvent::UP) { Dali::Toolkit::KeyboardFocusManager keyboardFocusManager = Dali::Toolkit::KeyboardFocusManager::Get(); - if (keyboardFocusManager) + if(keyboardFocusManager) { keyboardFocusManager.ClearFocus(); } @@ -1356,8 +1371,8 @@ void TextEditor::OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type typ mController->ChangedLayoutDirection(); } -TextEditor::TextEditor() -: Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT)), +TextEditor::TextEditor(ControlBehaviour additionalBehaviour) +: Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT | additionalBehaviour)), mAnimationPeriod(0.0f, 0.0f), mIdleCallback(NULL), mAlignmentOffset(0.f),