#include <dali-toolkit/public-api/controls/alignment/alignment.h>
#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
-using namespace std;
using namespace Dali;
// Local Data
// 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()
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 )
StartCursorBlinkTimer();
Toolkit::TextInput handle( GetOwner() );
- mInputStartedSignalV2.Emit( handle );
+ mInputStartedSignal.Emit( handle );
ImfManager imfManager = ImfManager::Get();
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();
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();
VirtualKeyboard::LanguageChangedSignal().Disconnect( this, &TextInput::SetTextDirection );
Toolkit::TextInput handle( GetOwner() );
- mInputFinishedSignalV2.Emit( handle );
+ mInputFinishedSignal.Emit( handle );
mEditModeActive = false;
mPreEditFlag = false;
RemoveHighlight();
mActiveLayer.SetSize(targetSize);
}
-void TextInput::OnRelaidOut( Vector2 size, ActorSizeContainer& container )
+void TextInput::OnRelayout( const Vector2& size, ActorSizeContainer& container )
{
Relayout( mDisplayedTextView, size, container );
Relayout( mPopupPanel.GetRootActor(), size, container );
// Private Internal methods
-void TextInput::OnHandlePan(Actor actor, PanGesture gesture)
+void TextInput::OnHandlePan(Actor actor, const PanGesture& gesture)
{
switch (gesture.state)
{
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())
}
// 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"
}
}
-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" );
{
// Some text is selected so erase it before adding space.
DeleteHighlightedText( true );
- update = true;
}
mCursorPosition = mCursorPosition + InsertAt(Text(keyString), mCursorPosition, 0);
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.
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<float>::max();
}
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;
}
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)
// [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();
++closestIndex;
}
}
- else if( closestIndex == numeric_limits<std::size_t>::max() ) // -1 RTL (after last arabic character on line)
+ else if( closestIndex == std::numeric_limits<std::size_t>::max() ) // -1 RTL (after last arabic character on line)
{
closestIndex = mTextLayoutInfo.mCharacterVisualToLogicalMap.size();
}
{
// emit signal if input style changes.
Toolkit::TextInput handle( GetOwner() );
- mStyleChangedSignalV2.Emit( handle, mInputStyle );
+ mStyleChangedSignal.Emit( handle, mInputStyle );
}
void TextInput::EmitTextModified()
DALI_LOG_INFO(gLogFilter, Debug::General, "EmitMaxInputCharactersReachedSignal \n");
Toolkit::TextInput handle( GetOwner() );
- mMaxInputCharactersReachedSignalV2.Emit( handle );
+ mMaxInputCharactersReachedSignal.Emit( handle );
}
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