TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( input, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
TextViewProcessor::CreateTextInfo( inputStyledText,
DEFAULT_LAYOUT_PARAMETERS,
Toolkit::Internal::TextView::RelayoutData relayoutData;
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( std::string( "Hello world\nhello world" ), inputStyledText );
+ MarkupProcessor::GetStyledTextArray( std::string( "Hello world\nhello world" ), inputStyledText, true );
TextViewProcessor::CreateTextInfo( inputStyledText,
DEFAULT_LAYOUT_PARAMETERS,
{
// Creates a styled text with the markup or plain string.
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( input, styledText );
+ MarkupProcessor::GetStyledTextArray( input, styledText, true );
const bool ret = ( result == TextProcessor::BeginsRightToLeftCharacter( styledText ) );
{
// Creates a styled text with the markup or plain string.
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( input, styledText );
+ MarkupProcessor::GetStyledTextArray( input, styledText, true );
const bool ret = ( result == TextProcessor::ContainsRightToLeftCharacter( styledText ) );
{
// Creates a styled text with the markup or plain string.
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( input, styledText );
+ MarkupProcessor::GetStyledTextArray( input, styledText, true );
std::size_t start;
std::size_t end;
{
// Creates a styled text with the markup or plain string.
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( test.inputText, styledText );
+ MarkupProcessor::GetStyledTextArray( test.inputText, styledText, true );
std::vector<MarkupProcessor::StyledTextArray> lines;
{
// Creates a styled text with the markup or plain string.
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( test.inputText, styledText );
+ MarkupProcessor::GetStyledTextArray( test.inputText, styledText, true );
std::vector<MarkupProcessor::StyledTextArray> words;
// Create styled text.
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( test.inputLine, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( test.inputLine, inputStyledText, true );
// Create styled text layout info.
Toolkit::Internal::TextView::RelayoutData relayoutData;
TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( input, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
TextViewProcessor::CreateTextInfo( inputStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& firstResultLayout( firstRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray firstResultStyledText;
- MarkupProcessor::GetStyledTextArray( firstResult, firstResultStyledText );
+ MarkupProcessor::GetStyledTextArray( firstResult, firstResultStyledText, true );
TextViewProcessor::CreateTextInfo( firstResultStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& lastResultLayout( lastRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray lastResultStyledText;
- MarkupProcessor::GetStyledTextArray( lastResult, lastResultStyledText );
+ MarkupProcessor::GetStyledTextArray( lastResult, lastResultStyledText, true );
TextViewProcessor::CreateTextInfo( lastResultStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( input, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
TextViewProcessor::CreateTextInfo( inputStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& firstResultLayout( firstRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray firstResultStyledText;
- MarkupProcessor::GetStyledTextArray( firstResult, firstResultStyledText );
+ MarkupProcessor::GetStyledTextArray( firstResult, firstResultStyledText, true );
TextViewProcessor::CreateTextInfo( firstResultStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& lastResultLayout( lastRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray lastResultStyledText;
- MarkupProcessor::GetStyledTextArray( lastResult, lastResultStyledText );
+ MarkupProcessor::GetStyledTextArray( lastResult, lastResultStyledText, true );
TextViewProcessor::CreateTextInfo( lastResultStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( input, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
TextViewProcessor::CreateTextInfo( inputStyledText,
Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) ),
+ std::string( "..." ),
+ true ),
relayoutData );
// Get the input line
TextViewProcessor::TextLayoutInfo& firstResultLayout( firstRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray firstResultStyledText;
- MarkupProcessor::GetStyledTextArray( firstResult, firstResultStyledText );
+ MarkupProcessor::GetStyledTextArray( firstResult, firstResultStyledText, true );
TextViewProcessor::CreateTextInfo( firstResultStyledText,
Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) ),
+ std::string( "..." ),
+ true ),
firstRelayoutData );
// Get the first result line
TextViewProcessor::TextLayoutInfo& lastResultLayout( lastRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray lastResultStyledText;
- MarkupProcessor::GetStyledTextArray( lastResult, lastResultStyledText );
+ MarkupProcessor::GetStyledTextArray( lastResult, lastResultStyledText, true );
TextViewProcessor::CreateTextInfo( lastResultStyledText,
Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) ),
+ std::string( "..."),
+ true ),
lastRelayoutData );
// Get the last result line
TextViewProcessor::TextLayoutInfo& inputFirstLayout( firstRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputFirstStyledText;
- MarkupProcessor::GetStyledTextArray( inputFirst, inputFirstStyledText );
+ MarkupProcessor::GetStyledTextArray( inputFirst, inputFirstStyledText, true );
TextViewProcessor::CreateTextInfo( inputFirstStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& inputLastLayout( lastRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputLastStyledText;
- MarkupProcessor::GetStyledTextArray( inputLast, inputLastStyledText );
+ MarkupProcessor::GetStyledTextArray( inputLast, inputLastStyledText, true );
TextViewProcessor::CreateTextInfo( inputLastStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray resultStyledText;
- MarkupProcessor::GetStyledTextArray( result, resultStyledText );
+ MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
TextViewProcessor::CreateTextInfo( resultStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& inputFirstLayout( firstRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputFirstStyledText;
- MarkupProcessor::GetStyledTextArray( inputFirst, inputFirstStyledText );
+ MarkupProcessor::GetStyledTextArray( inputFirst, inputFirstStyledText, true );
TextViewProcessor::CreateTextInfo( inputFirstStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& inputLastLayout( lastRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputLastStyledText;
- MarkupProcessor::GetStyledTextArray( inputLast, inputLastStyledText );
+ MarkupProcessor::GetStyledTextArray( inputLast, inputLastStyledText, true );
TextViewProcessor::CreateTextInfo( inputLastStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray resultStyledText;
- MarkupProcessor::GetStyledTextArray( result, resultStyledText );
+ MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
TextViewProcessor::CreateTextInfo( resultStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& inputFirstLayout( firstRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputFirstStyledText;
- MarkupProcessor::GetStyledTextArray( inputFirst, inputFirstStyledText );
+ MarkupProcessor::GetStyledTextArray( inputFirst, inputFirstStyledText, true );
TextViewProcessor::CreateTextInfo( inputFirstStyledText,
Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) ),
+ std::string( "..." ),
+ true ),
firstRelayoutData );
// Get the input word
TextViewProcessor::TextLayoutInfo& inputLastLayout( lastRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputLastStyledText;
- MarkupProcessor::GetStyledTextArray( inputLast, inputLastStyledText );
+ MarkupProcessor::GetStyledTextArray( inputLast, inputLastStyledText, true );
TextViewProcessor::CreateTextInfo( inputLastStyledText,
Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) ),
+ std::string( "..." ),
+ true ),
lastRelayoutData );
// Get the input word
TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray resultStyledText;
- MarkupProcessor::GetStyledTextArray( result, resultStyledText );
+ MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
TextViewProcessor::CreateTextInfo( resultStyledText,
Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) ),
+ std::string( "..." ),
+ true ),
resultRelayoutData );
// Get the result word
TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( input, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
TextViewProcessor::CreateTextInfo( inputStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray resultStyledText;
- MarkupProcessor::GetStyledTextArray( result, resultStyledText );
+ MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
TextViewProcessor::CreateTextInfo( resultStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( input, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
TextViewProcessor::CreateTextInfo( inputStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray resultStyledText;
- MarkupProcessor::GetStyledTextArray( result, resultStyledText );
+ MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
TextViewProcessor::CreateTextInfo( resultStyledText,
DEFAULT_LAYOUT_PARAMETERS,
TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( input, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
TextViewProcessor::CreateTextInfo( inputStyledText,
Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) ),
+ std::string( "..." ),
+ true ),
relayoutData );
// Get the input line
TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray resultStyledText;
- MarkupProcessor::GetStyledTextArray( result, resultStyledText );
+ MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
TextViewProcessor::CreateTextInfo( resultStyledText,
Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) ),
+ std::string( "..." ),
+ true ),
resultRelayoutData );
// Get the result line
TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( input, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
TextViewProcessor::CreateTextInfo( inputStyledText,
Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) ),
+ std::string( "..." ),
+ true ),
relayoutData );
// Create layout info for the result.
TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
MarkupProcessor::StyledTextArray resultStyledText;
- MarkupProcessor::GetStyledTextArray( result, resultStyledText );
+ MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
TextViewProcessor::CreateTextInfo( resultStyledText,
Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) ),
+ std::string( "..." ),
+ true ),
resultRelayoutData );
// Choose operation and call appropiate UpdateTextInfo() method.
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Center,
PointSize( lineHeightOffset ),
- std::string( "..." ) );
+ std::string( "..." ),
+ true );
switch( operation )
{
case Insert:
{
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( inputText, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( inputText, inputStyledText, true );
TextViewProcessor::UpdateTextInfo( position,
inputStyledText,
case Replace:
{
MarkupProcessor::StyledTextArray inputStyledText;
- MarkupProcessor::GetStyledTextArray( inputText, inputStyledText );
+ MarkupProcessor::GetStyledTextArray( inputText, inputStyledText, true );
TextViewProcessor::UpdateTextInfo( position,
numberOfCharacters,
"\n" );
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( text, styledText );
+ MarkupProcessor::GetStyledTextArray( text, styledText, true );
TextViewProcessor::CreateTextInfo( styledText,
DEFAULT_LAYOUT_PARAMETERS,
MarkupProcessor::StyledTextArray styledText01;
MarkupProcessor::StyledTextArray styledText02;
MarkupProcessor::StyledTextArray styledText03;
- MarkupProcessor::GetStyledTextArray( text01, styledText01 );
- MarkupProcessor::GetStyledTextArray( text02, styledText02 );
- MarkupProcessor::GetStyledTextArray( text03, styledText03 );
+ MarkupProcessor::GetStyledTextArray( text01, styledText01, true );
+ MarkupProcessor::GetStyledTextArray( text02, styledText02, true );
+ MarkupProcessor::GetStyledTextArray( text03, styledText03, true );
TextViewProcessor::CreateTextInfo( styledText01,
DEFAULT_LAYOUT_PARAMETERS,
MarkupProcessor::StyledTextArray styledText01;
MarkupProcessor::StyledTextArray styledText02;
MarkupProcessor::StyledTextArray styledText03;
- MarkupProcessor::GetStyledTextArray( text01, styledText01 );
- MarkupProcessor::GetStyledTextArray( text02, styledText02 );
- MarkupProcessor::GetStyledTextArray( text03, styledText03 );
+ MarkupProcessor::GetStyledTextArray( text01, styledText01, true );
+ MarkupProcessor::GetStyledTextArray( text02, styledText02, true );
+ MarkupProcessor::GetStyledTextArray( text03, styledText03, true );
TextViewProcessor::CreateTextInfo( styledText01,
DEFAULT_LAYOUT_PARAMETERS,
std::string text02( "hello world" );
MarkupProcessor::StyledTextArray styledText01;
MarkupProcessor::StyledTextArray styledText02;
- MarkupProcessor::GetStyledTextArray( text01, styledText01 );
- MarkupProcessor::GetStyledTextArray( text02, styledText02 );
+ MarkupProcessor::GetStyledTextArray( text01, styledText01, true );
+ MarkupProcessor::GetStyledTextArray( text02, styledText02, true );
TextViewProcessor::CreateTextInfo( styledText01,
DEFAULT_LAYOUT_PARAMETERS,
{
Toolkit::MarkupProcessor::StyledTextArray styledTextArray;
- GetStyledTextArray( input, styledTextArray );
+ GetStyledTextArray( input, styledTextArray, true );
GetMarkupString( styledTextArray, result );
return expectedResult == result;
std::string markupString;
Toolkit::MarkupProcessor::StyledTextArray styledTextArray;
- GetStyledTextArray( text1, styledTextArray );
+ GetStyledTextArray( text1, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result1, markupString, TEST_LOCATION );
- GetStyledTextArray( text2, styledTextArray );
+ GetStyledTextArray( text2, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result2, markupString, TEST_LOCATION );
- GetStyledTextArray( text3, styledTextArray );
+ GetStyledTextArray( text3, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result3, markupString, TEST_LOCATION );
- GetStyledTextArray( text4, styledTextArray );
+ GetStyledTextArray( text4, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result4, markupString, TEST_LOCATION );
- GetStyledTextArray( text5, styledTextArray );
+ GetStyledTextArray( text5, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result5, markupString, TEST_LOCATION );
- GetStyledTextArray( text6, styledTextArray );
+ GetStyledTextArray( text6, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result6, markupString, TEST_LOCATION );
- GetStyledTextArray( text7, styledTextArray );
+ GetStyledTextArray( text7, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result7, markupString, TEST_LOCATION );
- GetStyledTextArray( text8, styledTextArray );
+ GetStyledTextArray( text8, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result8, markupString, TEST_LOCATION );
- GetStyledTextArray( text9, styledTextArray );
+ GetStyledTextArray( text9, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result9, markupString, TEST_LOCATION );
- GetStyledTextArray( text10, styledTextArray );
+ GetStyledTextArray( text10, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result10, markupString, TEST_LOCATION );
- GetStyledTextArray( text11, styledTextArray );
+ GetStyledTextArray( text11, styledTextArray, true );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result11, markupString, TEST_LOCATION );
std::string markupString;
Toolkit::MarkupProcessor::StyledTextArray styledTextArray;
- GetStyledTextArray( text1, styledTextArray );
+ GetStyledTextArray( text1, styledTextArray, true );
TextStyle style;
style.SetItalics( true );
DALI_TEST_EQUALS( result1, markupString, TEST_LOCATION );
- GetStyledTextArray( text1, styledTextArray );
+ GetStyledTextArray( text1, styledTextArray, true );
SetTextStyleToRange( styledTextArray, style, TextStyle::ALL, 0, text1.size() - 1 );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( result1, markupString, TEST_LOCATION );
- GetStyledTextArray( text1, styledTextArray );
+ GetStyledTextArray( text1, styledTextArray, true );
SetTextStyleToRange( styledTextArray, style, TextStyle::ALL, 10, 19 );
GetMarkupString( styledTextArray, markupString );
DALI_TEST_EQUALS( view1.GetText(), text, TEST_LOCATION );
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( text, styledText );
+ MarkupProcessor::GetStyledTextArray( text, styledText, true );
TextView view2 = TextView::New( styledText );
DALI_TEST_EQUALS( view.GetText(), str, TEST_LOCATION );
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( str, styledText );
+ MarkupProcessor::GetStyledTextArray( str, styledText, true );
view.SetText( styledText );
DALI_TEST_EQUALS( view.GetText(), str, TEST_LOCATION );
Toolkit::MarkupProcessor::StyledTextArray styledTextArray;
- GetStyledTextArray( std::string( "..." ), styledTextArray );
+ GetStyledTextArray( std::string( "..." ), styledTextArray, true );
textView.SetEllipsizeText( styledTextArray );
std::string text("Hello ");
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( text, styledText );
+ MarkupProcessor::GetStyledTextArray( text, styledText, true );
TextView view = TextView::New( "world!" );
*/
Vector2 GetScrollPosition() const;
+ /**
+ * @brief Sets whether markup processing should be carried out.
+ *
+ * @param[in] enable whether markup processing is carried out or not.
+ */
+ void SetMarkupProcessingEnabled( bool enable );
+
+ /**
+ * @brief Returns whether markup processing is enabled or not
+ *
+ * @return true is markup processing is enabled
+ */
+ bool IsMarkupProcessingEnabled() const;
+
+
public: /* Signals */
/// @brief Input Signal.
bool IsSnapshotModeEnabled() const;
/**
+ * @brief Sets whether markup processing should be carried out.
+ *
+ * @param[in] enable whether markup processing is carried out or not.
+ */
+ void SetMarkupProcessingEnabled( bool enable );
+
+ /**
+ * @brief Retrieves whether text-view is processing markup text
+ *
+ * @return \e true if text-view markup processing is enabled, otherwhise it returns \e false.
+ */
+ bool IsMarkupProcessingEnabled() const;
+
+ /**
* @brief Enables or disables the text scroll.
*
* When scroll is enabled, snapshot mode will be enabled automatically. Equally, if scroll is disabled
* It transform any pair CR+LF new line characters into a single LF new line character.
* @param [in] markupString A string with style.
* @param [out] styledTextArray A text array split in characters, each one with its style.
+ * @param [in] scanForMarkup If true will check to see string contains markup, else assume not
*/
-void GetStyledTextArray( const std::string& markupString, StyledTextArray& styledTextArray );
+void GetStyledTextArray( const std::string& markupString, StyledTextArray& styledTextArray, bool scanForMarkup );
/**
* @brief Creates a plain string from a text array (thus stripping the style meta).
mSelectTextOnCommit( false ),
mUnderlinedPriorToPreEdit ( false ),
mCommitByKeyInput( false ),
- mPlaceHolderSet( false )
+ mPlaceHolderSet( false ),
+ mMarkUpEnabled( false )
{
// Updates the line height accordingly with the input style.
UpdateLineHeight();
void TextInput::SetPlaceholderText( const std::string& placeHolderText )
{
// Get the placeholder styled text array from the markup string.
- MarkupProcessor::GetStyledTextArray( placeHolderText, mStyledPlaceHolderText );
+ MarkupProcessor::GetStyledTextArray( placeHolderText, mStyledPlaceHolderText, IsMarkupProcessingEnabled() );
if( mStyledText.empty() )
{
{
DALI_LOG_INFO(gLogFilter, Debug::General, "SetText string[%s]\n", initialText.c_str() );
- GetStyledTextArray( initialText, mStyledText );
+ GetStyledTextArray( initialText, mStyledText, IsMarkupProcessingEnabled() );
if( mStyledText.empty() )
{
return snapshotEnabled;
}
+void TextInput::SetMarkupProcessingEnabled( bool enable )
+{
+ mMarkUpEnabled = enable;
+}
+
+bool TextInput::IsMarkupProcessingEnabled() const
+{
+ return mMarkUpEnabled;
+}
+
void TextInput::SetScrollEnabled( bool enable )
{
if( mDisplayedTextView )
Vector2 GetScrollPosition() const;
/**
+ * @brief Sets whether markup processing should be carried out.
+ *
+ * @param[in] enable whether markup processing is carried out or not.
+ */
+ void SetMarkupProcessingEnabled( bool enable );
+
+ /**
+ * @brief Returns whether markup processing is enabled or not
+ *
+ * @return true is markup processing is enabled
+ */
+ bool IsMarkupProcessingEnabled() const;
+
+ /**
* Insert or replaces the given text in the given position. It checks if the text exceeds the maximum allowed number of characters
* and if it fits in the text-input's boundaries.
*
bool mCommitByKeyInput:1; ///< Set if a commit is done by key input rather than automatically (usually when a space bar or enter is pressed).
bool mPlaceHolderSet:1; ///< Whether the place holder text is set.
+ bool mMarkUpEnabled:1; ///< enable to scan for mark-up
Toolkit::TextInput::InputSignalV2 mInputStartedSignalV2; ///< Signal emitted when input starts
Toolkit::TextInput::InputSignalV2 mInputFinishedSignalV2; ///< Signal emitted when input ends
{
// Creates a styled text with the markup or plain string.
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( text, styledText );
+ MarkupProcessor::GetStyledTextArray( text, styledText, IsMarkupProcessingEnabled() );
// Calls SetText() with the styled text array.
SetText( styledText );
{
// Creates a styled text with the markup or plain string.
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( text, styledText );
+ MarkupProcessor::GetStyledTextArray( text, styledText, IsMarkupProcessingEnabled() );
// Calls InsertTextAt() with the styled text array.
InsertTextAt( position, styledText );
{
// Creates a styled text with the markup or plain string.
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( text, styledText );
+ MarkupProcessor::GetStyledTextArray( text, styledText, IsMarkupProcessingEnabled() );
// Calls ReplaceTextFromTo() with the styled text array.
ReplaceTextFromTo( position, numberOfCharacters, styledText );
{
// Creates a styled text with the markup or plain string.
MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( ellipsizeText, styledText );
+ MarkupProcessor::GetStyledTextArray( ellipsizeText, styledText, IsMarkupProcessingEnabled() );
SetEllipsizeText( styledText );
}
return mVisualParameters.mSnapshotModeEnabled;
}
+void TextView::SetMarkupProcessingEnabled( bool enable )
+{
+ mMarkUpEnabled = enable;
+}
+
+bool TextView::IsMarkupProcessingEnabled() const
+{
+ return mMarkUpEnabled;
+}
+
void TextView::SetScrollEnabled( const bool enable )
{
if( enable != mVisualParameters.mScrollEnabled )
mVerticalAlignment( Toolkit::Alignment::VerticalCenter ),
mLineJustification( Toolkit::TextView::Left ),
mLineHeightOffset( 0.f ),
- mEllipsizeText()
+ mEllipsizeText(),
+ mMarkUpEnabled( false )
{
// Sets ellipsize text
MarkupProcessor::StyledTextArray styledEllipsize;
- MarkupProcessor::GetStyledTextArray( std::string( "..." ), mEllipsizeText );
+ MarkupProcessor::GetStyledTextArray( std::string( "..." ), mEllipsizeText, false );
}
TextView::LayoutParameters::LayoutParameters( const Toolkit::TextView::MultilinePolicy multilinePolicy,
const Toolkit::Alignment::Type alignmentType,
const Toolkit::TextView::LineJustification lineJustification,
const float lineHeightOffset,
- const std::string& ellipsizeText )
+ const std::string& ellipsizeText,
+ const bool markUpEnabled )
: mMultilinePolicy( multilinePolicy ),
mWidthExceedPolicy( widthExceedPolicy ),
mHeightExceedPolicy( heightExceedPolicy ),
mVerticalAlignment(),
mLineJustification( lineJustification ),
mLineHeightOffset( lineHeightOffset ),
- mEllipsizeText()
+ mEllipsizeText(),
+ mMarkUpEnabled( markUpEnabled )
{
// Sets alignment
Toolkit::Alignment::Type horizontalAlignment( ( alignmentType & Toolkit::Alignment::HorizontalLeft ? Toolkit::Alignment::HorizontalLeft :
// Sets ellipsize text
MarkupProcessor::StyledTextArray styledEllipsize;
- MarkupProcessor::GetStyledTextArray( ellipsizeText, mEllipsizeText );
+ MarkupProcessor::GetStyledTextArray( ellipsizeText, mEllipsizeText, mMarkUpEnabled );
}
TextView::LayoutParameters::LayoutParameters( const TextView::LayoutParameters& layoutParameters )
mVerticalAlignment( layoutParameters.mVerticalAlignment ),
mLineJustification( layoutParameters.mLineJustification ),
mLineHeightOffset( layoutParameters.mLineHeightOffset ),
- mEllipsizeText( layoutParameters.mEllipsizeText )
+ mEllipsizeText( layoutParameters.mEllipsizeText ),
+ mMarkUpEnabled( layoutParameters.mMarkUpEnabled )
{
}
mLineJustification = layoutParameters.mLineJustification;
mLineHeightOffset = layoutParameters.mLineHeightOffset;
mEllipsizeText = layoutParameters.mEllipsizeText;
+ mMarkUpEnabled = layoutParameters.mMarkUpEnabled;
return *this;
}
static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
Toolkit::TextView::Left,
PointSize( 0.f ),
- std::string( "..." ) ),
+ std::string( "..." ),
+ false ),
mVisualParameters(),
mRelayoutData(),
mRelayoutOperations( NO_RELAYOUT ),
mRenderTask(),
mPanGestureDetector(),
mLockPreviousSnapshotMode( false ),
- mPreviousSnapshotModeEnabled( false )
+ mPreviousSnapshotModeEnabled( false ),
+ mMarkUpEnabled( false )
{
TextViewProcessor::CreateWordTextInfo( mLayoutParameters.mEllipsizeText,
mRelayoutData.mTextLayoutInfo.mEllipsizeLayoutInfo );
bool IsSnapshotModeEnabled() const;
/**
+ * @brief Sets whether markup processing should be carried out.
+ *
+ * @param[in] enable whether markup processing is carried out or not.
+ */
+ void SetMarkupProcessingEnabled( bool enable );
+
+ /**
+ * @brief Returns whether markup processing is enabled or not
+ *
+ * @return true is markup processing is enabled
+ */
+ bool IsMarkupProcessingEnabled() const;
+
+ /**
* @copydoc SetScrollEnabled()
*/
void SetScrollEnabled( bool enable );
Toolkit::Alignment::Type alignment,
Toolkit::TextView::LineJustification lineJustification,
float lineHeightOffset,
- const std::string& ellipsizeText );
+ const std::string& ellipsizeText,
+ const bool markUpEnabled );
/**
* Copy constructor
Toolkit::Alignment::Type mVerticalAlignment; ///< Stores the vertical alignment for the whole text.
Toolkit::TextView::LineJustification mLineJustification; ///< Stores the line justification.
float mLineHeightOffset; ///< Line height offset to be addded to the font line height (measured in PointSize).
- MarkupProcessor::StyledTextArray mEllipsizeText; ///< Stores the ellipsize text.
+ MarkupProcessor::StyledTextArray mEllipsizeText; ///< Stores the ellipsize text
+ bool mMarkUpEnabled:1; ///< Is markup string scanning enabled
};
/**
bool mLockPreviousSnapshotMode; ///< Whether previous stored snapshot mode should be modified.
bool mPreviousSnapshotModeEnabled:1; ///< Stores the previous snapshot mode value.
+ bool mMarkUpEnabled:1; ///< enable to scan for mark-up
Toolkit::TextView::ScrolledSignalV2 mScrolledSignalV2; ///< Signal emitted when text is scrolled.
return GetImpl(*this).InputTextExceedBoundariesSignal();
}
+void TextInput::SetMarkupProcessingEnabled( bool enable )
+{
+ return GetImpl( *this ).SetMarkupProcessingEnabled( enable );
+}
+
+bool TextInput::IsMarkupProcessingEnabled() const
+{
+ return GetImpl( *this ).IsMarkupProcessingEnabled();
+}
+
+
TextInput::TextInput( Dali::Internal::CustomActor* internal )
: Control( internal )
{
return GetImpl( *this ).ScrolledSignal();
}
+void TextView::SetMarkupProcessingEnabled( bool enable )
+{
+ return GetImpl( *this ).SetMarkupProcessingEnabled( enable );
+}
+
+bool TextView::IsMarkupProcessingEnabled() const
+{
+ return GetImpl( *this ).IsMarkupProcessingEnabled();
+}
+
TextView::TextView( Internal::TextView& implementation )
: Control( implementation )
{
} // namespace
-void GetStyledTextArray( const std::string& markupString, StyledTextArray& styledTextArray )
+static inline bool HasMarkup( const std::string& markupString )
+{
+ // Reset counters
+ unsigned int lessThanCount = 0;
+ unsigned int greaterThanCount = 0;
+
+ // Check to see if any markup command surrounds are of equal number and not zero
+ for ( std::string::const_iterator it = markupString.begin(); it != markupString.end(); ++it )
+ {
+ if ( *it == LESS_THAN )
+ {
+ lessThanCount++;
+ }
+ else
+ {
+ if ( *it == GREATER_THAN )
+ {
+ greaterThanCount++;
+ }
+ else
+ {
+ if ( *it == BACK_SLASH )
+ {
+ return true;
+ }
+ }
+ }
+ }
+ if ( !lessThanCount || !greaterThanCount || lessThanCount != greaterThanCount )
+ {
+ return false;
+ }
+ return true;
+}
+
+void GetStyledTextArray( const std::string& markupString, StyledTextArray& styledTextArray, bool scanForMarkup )
{
styledTextArray.clear();
+ // Scan markup ( if necessary ) to see if the string contains any change in style from default?
+ if ( !scanForMarkup || !HasMarkup( markupString ) )
+ {
+ styledTextArray.push_back( StyledText( Text( markupString ), TextStyle() ) );
+ return;
+ }
+
TextStyle defaultStyle;
std::stack<TextStyle> styleStack;