+ /**
+ * @brief Helper to check whether active place-holder text is available.
+ */
+ bool IsFocusedPlaceholderAvailable() const
+ {
+ return ( mEventData && !mEventData->mPlaceholderTextActive.empty() );
+ }
+
+ bool IsShowingRealText() const
+ {
+ return ( !IsShowingPlaceholderText() &&
+ 0u != mLogicalModel->mText.Count() );
+ }
+
+ /**
+ * @brief Called when placeholder-text is hidden
+ */
+ void PlaceholderCleared()
+ {
+ if( mEventData )
+ {
+ mEventData->mIsShowingPlaceholderText = false;
+
+ // Remove mPlaceholderTextColor
+ mVisualModel->SetTextColor( mTextColor );
+ }
+ }
+
+ void ClearPreEditFlag()
+ {
+ if( mEventData )
+ {
+ mEventData->mPreEditFlag = false;
+ mEventData->mPreEditStartPosition = 0;
+ mEventData->mPreEditLength = 0;
+ }
+ }
+
+ void ResetImfManager()
+ {
+ if( mEventData )
+ {
+ // Reset incase we are in a pre-edit state.
+ if( mEventData->mImfManager )
+ {
+ mEventData->mImfManager.Reset(); // Will trigger a message ( commit, get surrounding )
+ }
+
+ ClearPreEditFlag();
+ }
+ }
+
+ /**
+ * @brief Helper to notify IMF manager with surrounding text & cursor changes.
+ */
+ void NotifyImfManager();
+
+ /**
+ * @brief Retrieve the current cursor position.
+ *
+ * @return The cursor position.
+ */
+ CharacterIndex GetLogicalCursorPosition() const;
+
+ /**
+ * @brief Retrieves the number of consecutive white spaces starting from the given @p index.
+ *
+ * @param[in] index The character index from where to count the number of consecutive white spaces.
+ *
+ * @return The number of consecutive white spaces.
+ */
+ Length GetNumberOfWhiteSpaces( CharacterIndex index ) const;
+
+ /**
+ * @brief Retrieve any text previously set starting from the given @p index.
+ *
+ * @param[in] index The character index from where to retrieve the text.
+ * @param[out] text A string of UTF-8 characters.
+ *
+ * @see Dali::Toolkit::Text::Controller::GetText()
+ */
+ void GetText( CharacterIndex index, std::string& text ) const;
+
+ bool IsClipboardEmpty()
+ {
+ bool result( mClipboard && mClipboard.NumberOfItems() );
+ return !result; // If NumberOfItems greater than 0, return false
+ }
+
+ /**
+ * @brief Calculates the start character index of the first paragraph to be updated and
+ * the end character index of the last paragraph to be updated.
+ *
+ * @param[out] numberOfCharacters The number of characters to be updated.
+ */
+ void CalculateTextUpdateIndices( Length& numberOfCharacters );
+
+ /**
+ * @brief Helper to clear completely the parts of the model specified by the given @p operations.
+ *
+ * @note It never clears the text stored in utf32.
+ */
+ void ClearFullModelData( OperationsMask operations );
+
+ /**
+ * @brief Helper to clear completely the parts of the model related with the characters specified by the given @p operations.
+ *
+ * @note It never clears the text stored in utf32.
+ *
+ * @param[in] startIndex Index to the first character to be cleared.
+ * @param[in] endIndex Index to the last character to be cleared.
+ * @param[in] operations The operations required.
+ */
+ void ClearCharacterModelData( CharacterIndex startIndex, CharacterIndex endIndex, OperationsMask operations );
+
+ /**
+ * @brief Helper to clear completely the parts of the model related with the glyphs specified by the given @p operations.
+ *
+ * @note It never clears the text stored in utf32.
+ * @note Character indices are transformed to glyph indices.
+ *
+ * @param[in] startIndex Index to the first character to be cleared.
+ * @param[in] endIndex Index to the last character to be cleared.
+ * @param[in] operations The operations required.
+ */
+ void ClearGlyphModelData( CharacterIndex startIndex, CharacterIndex endIndex, OperationsMask operations );
+
+ /**
+ * @brief Helper to clear the parts of the model specified by the given @p operations and from @p startIndex to @p endIndex.
+ *
+ * @note It never clears the text stored in utf32.
+ *
+ * @param[in] startIndex Index to the first character to be cleared.
+ * @param[in] endIndex Index to the last character to be cleared.
+ * @param[in] operations The operations required.
+ */
+ void ClearModelData( CharacterIndex startIndex, CharacterIndex endIndex, OperationsMask operations );
+
+ /**
+ * @brief Updates the logical and visual models. Updates the style runs in the visual model when the text's styles changes.
+ *
+ * When text or style changes the model is set with some operations pending.
+ * When i.e. the text's size or a relayout is required this method is called
+ * with a given @p operationsRequired parameter. The operations required are
+ * matched with the operations pending to perform the minimum number of operations.
+ *
+ * @param[in] operationsRequired The operations required.
+ *
+ * @return @e true if the model has been modified.
+ */
+ bool UpdateModel( OperationsMask operationsRequired );
+
+ /**
+ * @brief Retreieves the default style.
+ *
+ * @param[out] inputStyle The default style.
+ */
+ void RetrieveDefaultInputStyle( InputStyle& inputStyle );
+
+ /**
+ * @brief Retrieve the line height of the default font.
+ */
+ float GetDefaultFontLineHeight();