summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
54be5f4)
TextInput emits signal when text is modified, developer can query number of characters on
receiving this signal and behaviour accordingly.
Change-Id: Ie4794493ec3d724e522475bc53ae43a5dbea8697
RemoveHighlight();
DrawCursor();
RemoveHighlight();
DrawCursor();
}
void TextInput::SetText( const MarkupProcessor::StyledTextArray& styleText )
}
void TextInput::SetText( const MarkupProcessor::StyledTextArray& styleText )
Toolkit::Alignment::VerticalTop ) );
mDisplayedTextView.SetLineJustification( leftToRight ? Toolkit::TextView::Left : Toolkit::TextView::Right);
}
Toolkit::Alignment::VerticalTop ) );
mDisplayedTextView.SetLineJustification( leftToRight ? Toolkit::TextView::Left : Toolkit::TextView::Right);
}
}
void TextInput::SetMaxCharacterLength(std::size_t maxChars)
}
void TextInput::SetMaxCharacterLength(std::size_t maxChars)
return mStyleChangedSignalV2;
}
return mStyleChangedSignalV2;
}
+Toolkit::TextInput::TextModifiedSignalType& TextInput::TextModifiedSignal()
+{
+ return mTextModifiedSignal;
+}
+
Toolkit::TextInput::MaxInputCharactersReachedSignalV2& TextInput::MaxInputCharactersReachedSignal()
{
return mMaxInputCharactersReachedSignalV2;
Toolkit::TextInput::MaxInputCharactersReachedSignalV2& TextInput::MaxInputCharactersReachedSignal()
{
return mMaxInputCharactersReachedSignalV2;
RemovePreEditStyle();
const std::size_t numberOfCharactersDeleted = DeletePreEdit();
InsertAt( mPreEditString, mPreEditStartPosition, numberOfCharactersDeleted );
RemovePreEditStyle();
const std::size_t numberOfCharactersDeleted = DeletePreEdit();
InsertAt( mPreEditString, mPreEditStartPosition, numberOfCharactersDeleted );
}
ImfManager imfManager = ImfManager::Get();
}
ImfManager imfManager = ImfManager::Get();
ShowGrabHandleAndSetVisibility( false );
ShowGrabHandleAndSetVisibility( false );
HidePopup();
}
else if(name == OPTION_CLIPBOARD)
HidePopup();
}
else if(name == OPTION_CLIPBOARD)
// Received key String
mCursorPosition = mCursorPosition + InsertAt( Text( keyString ), mCursorPosition, 0 );
update = true;
// Received key String
mCursorPosition = mCursorPosition + InsertAt( Text( keyString ), mCursorPosition, 0 );
update = true;
mCursorPosition = toDelete;
mNumberOfSurroundingCharactersDeleted = numberOfCharacters;
mCursorPosition = toDelete;
mNumberOfSurroundingCharactersDeleted = numberOfCharacters;
DALI_LOG_INFO( gLogFilter, Debug::General, "ImfEventReceived - deleteSurrounding post-delete range mCursorPosition[%u] \n", mCursorPosition);
break;
}
DALI_LOG_INFO( gLogFilter, Debug::General, "ImfEventReceived - deleteSurrounding post-delete range mCursorPosition[%u] \n", mCursorPosition);
break;
}
mDisplayedTextView.RemoveTextFrom( mPreEditStartPosition, numberOfCharactersToReplace );
}
GetTextLayoutInfo();
mDisplayedTextView.RemoveTextFrom( mPreEditStartPosition, numberOfCharactersToReplace );
}
GetTextLayoutInfo();
mCursorPosition = mPreEditStartPosition + std::min( cursorOffset, mPreEditLength );
ApplyPreEditStyle( mPreEditStartPosition, mPreEditLength );
DALI_LOG_INFO(gLogFilter, Debug::General, "PreEditReceived mCursorPosition[%u] \n", mCursorPosition);
mCursorPosition = mPreEditStartPosition + std::min( cursorOffset, mPreEditLength );
ApplyPreEditStyle( mPreEditStartPosition, mPreEditLength );
DALI_LOG_INFO(gLogFilter, Debug::General, "PreEditReceived mCursorPosition[%u] \n", mCursorPosition);
}
// cursor update to keyboard is not done here as the keyboard knows the cursor position and provides the 'cursorOffset'.
DrawCursor();
}
// cursor update to keyboard is not done here as the keyboard knows the cursor position and provides the 'cursorOffset'.
DrawCursor();
mCursorPosition = mPreEditStartPosition + std::min( cursorOffset, mPreEditLength );
ApplyPreEditStyle( mPreEditStartPosition, mPreEditLength );
DALI_LOG_INFO(gLogFilter, Debug::General, "PreEditReceived mCursorPosition[%u] mPreEditStartPosition[%u]\n", mCursorPosition, mPreEditStartPosition);
mCursorPosition = mPreEditStartPosition + std::min( cursorOffset, mPreEditLength );
ApplyPreEditStyle( mPreEditStartPosition, mPreEditLength );
DALI_LOG_INFO(gLogFilter, Debug::General, "PreEditReceived mCursorPosition[%u] mPreEditStartPosition[%u]\n", mCursorPosition, mPreEditStartPosition);
// cursor update to keyboard is not done here as the keyboard knows the cursor position and provides the 'cursorOffset'.
DrawCursor();
// cursor update to keyboard is not done here as the keyboard knows the cursor position and provides the 'cursorOffset'.
DrawCursor();
if ( mSelectTextOnCommit )
{
SelectText(mRequestedSelection.mStartOfSelection, mRequestedSelection.mEndOfSelection );
if ( mSelectTextOnCommit )
{
SelectText(mRequestedSelection.mStartOfSelection, mRequestedSelection.mEndOfSelection );
mCursorPosition = mCursorPosition + InsertAt( Text( keyString ), mCursorPosition, mNumberOfSurroundingCharactersDeleted );
update = true;
mNumberOfSurroundingCharactersDeleted = 0;
mCursorPosition = mCursorPosition + InsertAt( Text( keyString ), mCursorPosition, mNumberOfSurroundingCharactersDeleted );
update = true;
mNumberOfSurroundingCharactersDeleted = 0;
void TextInput::EmitStyleChangedSignal()
{
// emit signal if input style changes.
void TextInput::EmitStyleChangedSignal()
{
// emit signal if input style changes.
Toolkit::TextInput handle( GetOwner() );
mStyleChangedSignalV2.Emit( handle, mInputStyle );
}
Toolkit::TextInput handle( GetOwner() );
mStyleChangedSignalV2.Emit( handle, mInputStyle );
}
+void TextInput::EmitTextModified()
+{
+ // emit signal when text changes.
+ Toolkit::TextInput handle( GetOwner() );
+ mTextModifiedSignal.Emit( handle );
+}
+
+
void TextInput::EmitMaxInputCharactersReachedSignal()
{
// emit signal if max characters is reached during text input.
void TextInput::EmitMaxInputCharactersReachedSignal()
{
// emit signal if max characters is reached during text input.
Toolkit::TextInput::StyleChangedSignalV2& StyleChangedSignal();
/**
Toolkit::TextInput::StyleChangedSignalV2& StyleChangedSignal();
/**
+ * @copydoc Toolkit::TextInput::TextModifiedSignal()
+ */
+ Toolkit::TextInput::TextModifiedSignalType& TextModifiedSignal();
+
+ /**
* @copydoc Toolkit::TextInput::MaxInputCharactersReachedSignal()
*/
Toolkit::TextInput::MaxInputCharactersReachedSignalV2& MaxInputCharactersReachedSignal();
* @copydoc Toolkit::TextInput::MaxInputCharactersReachedSignal()
*/
Toolkit::TextInput::MaxInputCharactersReachedSignalV2& MaxInputCharactersReachedSignal();
void EmitStyleChangedSignal();
/**
void EmitStyleChangedSignal();
/**
+ * Emit signal when text is modified.
+ */
+ void EmitTextModified();
+
+ /**
* Emits max input characters reached signal.
*/
void EmitMaxInputCharactersReachedSignal();
* Emits max input characters reached signal.
*/
void EmitMaxInputCharactersReachedSignal();
Toolkit::TextInput::InputSignalV2 mInputStartedSignalV2; ///< Signal emitted when input starts
Toolkit::TextInput::InputSignalV2 mInputFinishedSignalV2; ///< Signal emitted when input ends
Toolkit::TextInput::StyleChangedSignalV2 mStyleChangedSignalV2; ///< Signal emitted when style changes.
Toolkit::TextInput::InputSignalV2 mInputStartedSignalV2; ///< Signal emitted when input starts
Toolkit::TextInput::InputSignalV2 mInputFinishedSignalV2; ///< Signal emitted when input ends
Toolkit::TextInput::StyleChangedSignalV2 mStyleChangedSignalV2; ///< Signal emitted when style changes.
+ Toolkit::TextInput::TextModifiedSignalType mTextModifiedSignal; ///< Signal emitted when text modified.
Toolkit::TextInput::MaxInputCharactersReachedSignalV2 mMaxInputCharactersReachedSignalV2; ///< Signal emitted when max input characters is reached.
Toolkit::TextInput::InputSignalV2 mCutAndPasteToolBarDisplayedV2; ///< Signal emitted when toolbar displayed
Toolkit::TextInput::InputTextExceedBoundariesSignalV2 mInputTextExceedBoundariesSignalV2; ///< Signal emitted when input text exceeds the boundaries of the text-input.
Toolkit::TextInput::MaxInputCharactersReachedSignalV2 mMaxInputCharactersReachedSignalV2; ///< Signal emitted when max input characters is reached.
Toolkit::TextInput::InputSignalV2 mCutAndPasteToolBarDisplayedV2; ///< Signal emitted when toolbar displayed
Toolkit::TextInput::InputTextExceedBoundariesSignalV2 mInputTextExceedBoundariesSignalV2; ///< Signal emitted when input text exceeds the boundaries of the text-input.
return GetImpl(*this).StyleChangedSignal();
}
return GetImpl(*this).StyleChangedSignal();
}
+TextInput::TextModifiedSignalType& TextInput::TextModifiedSignal()
+{
+ return GetImpl(*this).TextModifiedSignal();
+}
+
TextInput::MaxInputCharactersReachedSignalV2& TextInput::MaxInputCharactersReachedSignal()
{
return GetImpl(*this).MaxInputCharactersReachedSignal();
TextInput::MaxInputCharactersReachedSignalV2& TextInput::MaxInputCharactersReachedSignal()
{
return GetImpl(*this).MaxInputCharactersReachedSignal();
/// @brief Input style changed signal.
typedef SignalV2< void ( TextInput textInput, const TextStyle& style ) > StyleChangedSignalV2;
/// @brief Input style changed signal.
typedef SignalV2< void ( TextInput textInput, const TextStyle& style ) > StyleChangedSignalV2;
+ /// @brief Text modified signal.
+ typedef SignalV2< void ( TextInput textInput ) > TextModifiedSignalType;
+
/// @brief Max input characters reached signal.
typedef SignalV2< void ( TextInput textInput ) > MaxInputCharactersReachedSignalV2;
/// @brief Max input characters reached signal.
typedef SignalV2< void ( TextInput textInput ) > MaxInputCharactersReachedSignalV2;
StyleChangedSignalV2& StyleChangedSignal();
/**
StyleChangedSignalV2& StyleChangedSignal();
/**
+ * @brief Signal emitted when text changes.
+ *
+ * @return The signal to connect to.
+ */
+ TextModifiedSignalType& TextModifiedSignal();
+
+ /**
* @brief Signal emitted when max input characters are reached during text input.
*
* @return The signal to connect to
* @brief Signal emitted when max input characters are reached during text input.
*
* @return The signal to connect to