{
// 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 );
}
if( ( textViewSize.width > Math::MACHINE_EPSILON_1000 ) &&
( textViewSize.height > Math::MACHINE_EPSILON_1000 ) )
{
- // Check if the text-view has text-actors.
- const bool hasTextActors = !mRelayoutData.mTextActors.empty();
+ // Check if the text-view has glyph-actors.
+ const bool hasGlyphActors = !mRelayoutData.mGlyphActors.empty();
RelayoutOperationMask mask = NO_RELAYOUT;
if( relayoutSizeAndPositionNeeded )
mask = static_cast<RelayoutOperationMask>( mask | RELAYOUT_VISIBILITY );
}
- if( hasTextActors )
+ if( hasGlyphActors )
{
- // Remove text-actors from the text-view as some text-operation like CreateTextInfo()
+ // Remove glyph-actors from the text-view as some text-operation like CreateTextInfo()
// add them to the text-actor cache.
- TextViewRelayout::RemoveTextActors( GetRootActor(), mRelayoutData.mTextActors );
- mRelayoutData.mTextActors.clear();
+ TextViewRelayout::RemoveGlyphActors( GetRootActor(), mRelayoutData.mGlyphActors );
+ mRelayoutData.mGlyphActors.clear();
}
- // Relays-out but doesn't add text-actors to the text-view.
+ // Relays-out but doesn't add glyph-actors to the text-view.
DoRelayOut( textViewSize.GetVectorXY(), mask );
- if( hasTextActors )
+ if( hasGlyphActors )
{
mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_VIEW );
mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
{
mVisualParameters.mSortModifier = depthOffset;
- for( std::vector<TextActor>::iterator it = mRelayoutData.mTextActors.begin(), endIt = mRelayoutData.mTextActors.end();
+ for( std::vector<RenderableActor>::iterator it = mRelayoutData.mGlyphActors.begin(), endIt = mRelayoutData.mGlyphActors.end();
it != endIt;
++it )
{
{
if( enable != mVisualParameters.mSnapshotModeEnabled )
{
- // Remove first all text-actors
- if( !mRelayoutData.mTextActors.empty() )
+ // Remove first all glyph-actors
+ if( !mRelayoutData.mGlyphActors.empty() )
{
- TextViewRelayout::RemoveTextActors( GetRootActor(), mRelayoutData.mTextActors );
+ TextViewRelayout::RemoveGlyphActors( GetRootActor(), mRelayoutData.mGlyphActors );
}
mVisualParameters.mSnapshotModeEnabled = enable;
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;
}
mTextLayoutInfo(),
mCharacterLogicalToVisualMap(),
mCharacterVisualToLogicalMap(),
- mTextActors(),
+ mGlyphActors(),
mCharacterLayoutInfoTable(),
mLines(),
mTextSizeForRelayoutOption()
mTextLayoutInfo( relayoutData.mTextLayoutInfo ),
mCharacterLogicalToVisualMap( relayoutData.mCharacterLogicalToVisualMap ),
mCharacterVisualToLogicalMap( relayoutData.mCharacterVisualToLogicalMap ),
- mTextActors( relayoutData.mTextActors ),
+ mGlyphActors( relayoutData.mGlyphActors ),
mCharacterLayoutInfoTable( relayoutData.mCharacterLayoutInfoTable ),
mLines( relayoutData.mLines ),
mTextSizeForRelayoutOption( relayoutData.mTextSizeForRelayoutOption )
mTextLayoutInfo = relayoutData.mTextLayoutInfo;
mCharacterLogicalToVisualMap = relayoutData.mCharacterLogicalToVisualMap;
mCharacterVisualToLogicalMap = relayoutData.mCharacterVisualToLogicalMap;
- mTextActors = relayoutData.mTextActors;
+ mGlyphActors = relayoutData.mGlyphActors;
mCharacterLayoutInfoTable = relayoutData.mCharacterLayoutInfoTable;
mLines = relayoutData.mLines;
mTextSizeForRelayoutOption = relayoutData.mTextSizeForRelayoutOption;
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 );
{
// There are SetText, Inserts or Removes to do. It means the current layout info is not updated.
- if( !mRelayoutData.mTextActors.empty() )
+ if( !mRelayoutData.mGlyphActors.empty() )
{
- // Remove text-actors from the text-view as some text-operation like CreateTextInfo()
+ // Remove glyph-actors from the text-view as some text-operation like CreateTextInfo()
// add them to the text-actor cache.
- TextViewRelayout::RemoveTextActors( GetRootActor(), mRelayoutData.mTextActors );
- mRelayoutData.mTextActors.clear();
+ TextViewRelayout::RemoveGlyphActors( GetRootActor(), mRelayoutData.mGlyphActors );
+ mRelayoutData.mGlyphActors.clear();
mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_VIEW );
mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
// Check if the given width is different than the current one.
const bool differentWidth = ( fabsf( width - mRelayoutData.mTextViewSize.width ) > Math::MACHINE_EPSILON_1000 );
- // Check if the text-view has text-actors.
- const bool hasTextActors = !mRelayoutData.mTextActors.empty();
+ // Check if the text-view has glyph-actors.
+ const bool hasGlyphActors = !mRelayoutData.mGlyphActors.empty();
// Check which layout operations need to be done.
const bool relayoutSizeAndPositionNeeded = ( mRelayoutOperations & RELAYOUT_SIZE_POSITION ) || differentWidth;
if( relayoutSizeAndPositionNeeded )
{
- if( hasTextActors )
+ if( hasGlyphActors )
{
- // Remove text-actors from the text-view as some text-operation like CreateTextInfo()
+ // Remove glyph-actors from the text-view as some text-operation like CreateTextInfo()
// add them to the text-actor cache.
- TextViewRelayout::RemoveTextActors( GetRootActor(), mRelayoutData.mTextActors );
- mRelayoutData.mTextActors.clear();
+ TextViewRelayout::RemoveGlyphActors( GetRootActor(), mRelayoutData.mGlyphActors );
+ mRelayoutData.mGlyphActors.clear();
}
// Use the given width.
const Vector2 textViewSize( width, GetControlSize().height );
- // Relays-out but doesn't add text-actors to the text-view.
+ // Relays-out but doesn't add glyph-actors to the text-view.
DoRelayOut( textViewSize, RELAYOUT_SIZE_POSITION );
}
mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_SIZE_POSITION );
}
- if( hasTextActors )
+ if( hasGlyphActors )
{
mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_VIEW );
mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
}
- if( differentWidth || hasTextActors )
+ if( differentWidth || hasGlyphActors )
{
RelayoutRequest();
}
if( size != mRelayoutData.mTextViewSize )
{
- // if new size is different than the prevoius one, set positions and maybe sizes of all text-actor is needed.
+ // if new size is different than the prevoius one, set positions and maybe sizes of all glyph-actor is needed.
if( RELAYOUT_ALL != mRelayoutOperations )
{
mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations |
}
}
- // Remove text-actors from text-view
- if( !mRelayoutData.mTextActors.empty() && ( mRelayoutOperations & RELAYOUT_REMOVE_TEXT_ACTORS ) )
+ // Remove glyph-actors from text-view
+ if( !mRelayoutData.mGlyphActors.empty() && ( mRelayoutOperations & RELAYOUT_REMOVE_TEXT_ACTORS ) )
{
- TextViewRelayout::RemoveTextActors( GetRootActor(), mRelayoutData.mTextActors );
- mRelayoutData.mTextActors.clear();
+ TextViewRelayout::RemoveGlyphActors( GetRootActor(), mRelayoutData.mGlyphActors );
+ mRelayoutData.mGlyphActors.clear();
}
if( NO_RELAYOUT != mRelayoutOperations )
{
- // Relays-out and add text-actors to the text-view.
+ // Relays-out and add glyph-actors to the text-view.
DoRelayOut( size, mRelayoutOperations );
ProcessSnapshot( size );
}
void TextView::DoRelayOut( const Size& textViewSize, const RelayoutOperationMask relayoutOperationMask )
{
- // Traverse the relayout operation vector. It fills the natural size, layout and text-actor data structures.
+ // Traverse the relayout operation vector. It fills the natural size, layout and glyph-actor data structures.
if( !mTextViewProcessorOperations.empty() )
{
PerformTextViewProcessorOperations();
if( mOffscreenRootActor )
{
- // If there is a render-task it needs to be refreshed. Therefore text-actors need to be
+ // If there is a render-task it needs to be refreshed. Therefore glyph-actors need to be
// set to visible.
mOffscreenRootActor.SetVisible( true );
}