X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Ftext-input%2Ftext-input-impl.cpp;h=cbda7fb578b81f50cf5795c278d69c15c39c20e8;hp=0264adc5ca56707aa884c5c5be3a9c4e9e46c09a;hb=7e315a440bad7033d19fefa8f9952d625ee6f076;hpb=8a7823e6d838e4420c632141592b3433a49000a5 diff --git a/base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp b/base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp index 0264adc..cbda7fb 100644 --- a/base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp +++ b/base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp @@ -15,21 +15,28 @@ * */ -#include - +// CLASS HEADER #include -#include -#include -#include -#include - -#include +// EXTERNAL INCLUDES #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include + +// INTERNAL INCLUDES +#include +#include +#include +#include -using namespace std; using namespace Dali; // Local Data @@ -531,24 +538,24 @@ const Vector4& TextInput::GetMaterialDiffuseColor() const // Signals -Toolkit::TextInput::InputSignalV2& TextInput::InputStartedSignal() +Toolkit::TextInput::InputSignalType& TextInput::InputStartedSignal() { - return mInputStartedSignalV2; + return mInputStartedSignal; } -Toolkit::TextInput::InputSignalV2& TextInput::InputFinishedSignal() +Toolkit::TextInput::InputSignalType& TextInput::InputFinishedSignal() { - return mInputFinishedSignalV2; + return mInputFinishedSignal; } -Toolkit::TextInput::InputSignalV2& TextInput::CutAndPasteToolBarDisplayedSignal() +Toolkit::TextInput::InputSignalType& TextInput::CutAndPasteToolBarDisplayedSignal() { - return mCutAndPasteToolBarDisplayedV2; + return mCutAndPasteToolBarDisplayed; } -Toolkit::TextInput::StyleChangedSignalV2& TextInput::StyleChangedSignal() +Toolkit::TextInput::StyleChangedSignalType& TextInput::StyleChangedSignal() { - return mStyleChangedSignalV2; + return mStyleChangedSignal; } Toolkit::TextInput::TextModifiedSignalType& TextInput::TextModifiedSignal() @@ -556,14 +563,14 @@ Toolkit::TextInput::TextModifiedSignalType& TextInput::TextModifiedSignal() return mTextModifiedSignal; } -Toolkit::TextInput::MaxInputCharactersReachedSignalV2& TextInput::MaxInputCharactersReachedSignal() +Toolkit::TextInput::MaxInputCharactersReachedSignalType& TextInput::MaxInputCharactersReachedSignal() { - return mMaxInputCharactersReachedSignalV2; + return mMaxInputCharactersReachedSignal; } -Toolkit::TextInput::InputTextExceedBoundariesSignalV2& TextInput::InputTextExceedBoundariesSignal() +Toolkit::TextInput::InputTextExceedBoundariesSignalType& TextInput::InputTextExceedBoundariesSignal() { - return mInputTextExceedBoundariesSignalV2; + return mInputTextExceedBoundariesSignal; } bool TextInput::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) @@ -1023,7 +1030,7 @@ void TextInput::OnKeyInputFocusGained() StartCursorBlinkTimer(); Toolkit::TextInput handle( GetOwner() ); - mInputStartedSignalV2.Emit( handle ); + mInputStartedSignal.Emit( handle ); ImfManager imfManager = ImfManager::Get(); @@ -1035,7 +1042,7 @@ void TextInput::OnKeyInputFocusGained() imfManager.Activate(); // When window gain lost focus, the imf manager is deactivated. Thus when window gain focus again, the imf manager must be activated. - imfManager.SetRestoreAferFocusLost( true ); + imfManager.SetRestoreAfterFocusLost( true ); imfManager.SetCursorPosition( mCursorPosition ); imfManager.NotifyCursorPosition(); @@ -1069,7 +1076,7 @@ void TextInput::OnKeyInputFocusLost() if ( imfManager ) { // The text editing is finished. Therefore the imf manager don't have restore activation. - imfManager.SetRestoreAferFocusLost( false ); + imfManager.SetRestoreAfterFocusLost( false ); // Notify that the text editing finish. imfManager.Deactivate(); @@ -1080,7 +1087,7 @@ void TextInput::OnKeyInputFocusLost() VirtualKeyboard::LanguageChangedSignal().Disconnect( this, &TextInput::SetTextDirection ); Toolkit::TextInput handle( GetOwner() ); - mInputFinishedSignalV2.Emit( handle ); + mInputFinishedSignal.Emit( handle ); mEditModeActive = false; mPreEditFlag = false; RemoveHighlight(); @@ -1199,7 +1206,7 @@ float TextInput::GetHeightForWidth( float width ) // Private Internal methods -void TextInput::OnHandlePan(Actor actor, PanGesture gesture) +void TextInput::OnHandlePan(Actor actor, const PanGesture& gesture) { switch (gesture.state) { @@ -1324,7 +1331,7 @@ bool TextInput::OnHandleTwoTouched(Dali::Actor actor, const TouchEvent& touch) return false; } -void TextInput::OnDoubleTap(Dali::Actor actor, Dali::TapGesture tap) +void TextInput::OnDoubleTap(Dali::Actor actor, const Dali::TapGesture& tap) { // If text exists then select nearest word. if ( !mStyledText.empty()) @@ -1389,7 +1396,7 @@ void TextInput::OnDoubleTap(Dali::Actor actor, Dali::TapGesture tap) } // TODO: Change the function name to be more general. -void TextInput::OnTextTap(Dali::Actor actor, Dali::TapGesture tap) +void TextInput::OnTextTap(Dali::Actor actor, const Dali::TapGesture& tap) { DALI_LOG_INFO( gLogFilter, Debug::General, "OnTap mPreEditFlag[%s] mEditOnTouch[%s] mEditModeActive[%s] ", (mPreEditFlag)?"true":"false" , (mEditOnTouch)?"true":"false" @@ -1511,7 +1518,7 @@ void TextInput::OnTextTap(Dali::Actor actor, Dali::TapGesture tap) } } -void TextInput::OnLongPress(Dali::Actor actor, Dali::LongPressGesture longPress) +void TextInput::OnLongPress(Dali::Actor actor, const Dali::LongPressGesture& longPress) { DALI_LOG_INFO( gLogFilter, Debug::General, "OnLongPress\n" ); @@ -1759,7 +1766,6 @@ bool TextInput::OnKeyDownEvent(const KeyEvent& event) { // Some text is selected so erase it before adding space. DeleteHighlightedText( true ); - update = true; } mCursorPosition = mCursorPosition + InsertAt(Text(keyString), mCursorPosition, 0); @@ -3520,7 +3526,6 @@ void TextInput::GetVisualTextSelection( std::vector& selectedVisualText, s TextInput::HighlightInfo TextInput::CalculateHighlightInfo() { // At the moment there is no public API to modify the block alignment option. - const bool blockAlignEnabled = true; mNewHighlightInfo.mQuadList.clear(); // clear last quad information. @@ -3589,7 +3594,7 @@ TextInput::HighlightInfo TextInput::CalculateHighlightInfo() float rowTop = rowBottom - rowSize.height; // Still selected, and block-align mode then set rowRight to max, so it can be clamped afterwards - if(charSelected && blockAlignEnabled) + if(charSelected) { rowRight = std::numeric_limits::max(); } @@ -3601,7 +3606,7 @@ TextInput::HighlightInfo TextInput::CalculateHighlightInfo() if( charSelected ) { // if block-align mode then set rowLeft to min, so it can be clamped afterwards - rowLeft = blockAlignEnabled ? 0.0f : charInfo.mPosition.x - mTextLayoutInfo.mScrollOffset.x; + rowLeft = 0.0f; rowRight = ( charInfo.mPosition.x - mTextLayoutInfo.mScrollOffset.x ) + charInfo.mSize.width; selectionState = SelectionStarted; } @@ -3646,8 +3651,6 @@ TextInput::HighlightInfo TextInput::CalculateHighlightInfo() mNewHighlightInfo.Clamp2D( topLeft, bottomRight ); // For block-align align Further Clamp quads to max left and right extents - if(blockAlignEnabled) - { // BlockAlign: Will adjust highlight to block: // i.e. // H[ello] (top row right = max of all rows right) @@ -3662,9 +3665,7 @@ TextInput::HighlightInfo TextInput::CalculateHighlightInfo() // [is some] // [text] // (common in regular text editors/web browser selection) - mNewHighlightInfo.Clamp2D( Vector2(maxRowLeft, topLeft.y), Vector2(maxRowRight, bottomRight.y ) ); - } // Finally clamp quads again so they don't exceed the boundry of the control. const Vector3& controlSize = GetControlSize(); @@ -4175,7 +4176,7 @@ bool TextInput::ReturnClosestIndex(const Vector2& source, std::size_t& closestIn ++closestIndex; } } - else if( closestIndex == numeric_limits::max() ) // -1 RTL (after last arabic character on line) + else if( closestIndex == std::numeric_limits::max() ) // -1 RTL (after last arabic character on line) { closestIndex = mTextLayoutInfo.mCharacterVisualToLogicalMap.size(); } @@ -5506,7 +5507,7 @@ void TextInput::EmitStyleChangedSignal() { // emit signal if input style changes. Toolkit::TextInput handle( GetOwner() ); - mStyleChangedSignalV2.Emit( handle, mInputStyle ); + mStyleChangedSignal.Emit( handle, mInputStyle ); } void TextInput::EmitTextModified() @@ -5523,7 +5524,7 @@ void TextInput::EmitMaxInputCharactersReachedSignal() DALI_LOG_INFO(gLogFilter, Debug::General, "EmitMaxInputCharactersReachedSignal \n"); Toolkit::TextInput handle( GetOwner() ); - mMaxInputCharactersReachedSignalV2.Emit( handle ); + mMaxInputCharactersReachedSignal.Emit( handle ); } void TextInput::EmitInputTextExceedsBoundariesSignal() @@ -5531,7 +5532,7 @@ void TextInput::EmitInputTextExceedsBoundariesSignal() // Emit a signal when the input text exceeds the boundaries of the text input. Toolkit::TextInput handle( GetOwner() ); - mInputTextExceedBoundariesSignalV2.Emit( handle ); + mInputTextExceedBoundariesSignal.Emit( handle ); } } // namespace Internal