From 9fa737c75eb9ca4442d1abd899436acf7568f830 Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Fri, 16 May 2014 17:33:58 +0100 Subject: [PATCH] TextView - Update programming guide. Change-Id: I3825f3aca4d0f1e2d52d119f2c5868e29ce14ad1 Signed-off-by: Victor Cebollada --- .../internal/controls/text-view/text-view-impl.cpp | 37 +++-- .../internal/controls/text-view/text-view-impl.h | 7 +- .../public-api/controls/text-view/text-view.cpp | 24 ++-- .../markup-processor/markup-processor.cpp | 6 +- .../public-api/controls/text-view/text-view.h | 155 ++++++++------------- .../public-api/markup-processor/markup-processor.h | 52 ++----- 6 files changed, 105 insertions(+), 176 deletions(-) diff --git a/base/dali-toolkit/internal/controls/text-view/text-view-impl.cpp b/base/dali-toolkit/internal/controls/text-view/text-view-impl.cpp index 31c3ba0..16a8305 100644 --- a/base/dali-toolkit/internal/controls/text-view/text-view-impl.cpp +++ b/base/dali-toolkit/internal/controls/text-view/text-view-impl.cpp @@ -49,7 +49,6 @@ namespace Internal namespace { - const char* MULTILINE_POLICY_NAME[] = {"SplitByNewLineChar", "SplitByWord", "SplitByChar"}; const char* EXCEED_POLICY_NAME[] = {"Original", "Truncate", "Fade", "Split","ShrinkToFit","EllipsizeEnd"}; const char* LINE_JUSTIFICATION_NAME[] = {"Left","Center","Right","Justified"}; @@ -140,8 +139,8 @@ Toolkit::TextView TextView::New() // This can only be done after the CustomActor connection has been made... textView->Initialize(); - // Enables by default the offscreen rendering. - textView->SetSnapshotModeEnabled( false ); /// @note Temporary disabled due to some issues with text quality and glyph loading. + // Disables by default the offscreen rendering. + textView->SetSnapshotModeEnabled( false ); return handle; } @@ -192,7 +191,7 @@ void TextView::InsertTextAt( std::size_t position, const std::string& text ) InsertTextAt( position, styledText ); } -void TextView::InsertTextAt( const std::size_t position, const MarkupProcessor::StyledTextArray& text ) +void TextView::InsertTextAt( std::size_t position, const MarkupProcessor::StyledTextArray& text ) { // Creates metadata with the Insert operation. TextViewProcessorMetadata metadata; @@ -213,7 +212,7 @@ void TextView::InsertTextAt( const std::size_t position, const MarkupProcessor:: mRelayoutOperations = RELAYOUT_ALL; } -void TextView::ReplaceTextFromTo( const std::size_t position, const std::size_t numberOfCharacters, const std::string& text ) +void TextView::ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const std::string& text ) { // Creates a styled text with the markup or plain string. MarkupProcessor::StyledTextArray styledText; @@ -223,7 +222,7 @@ void TextView::ReplaceTextFromTo( const std::size_t position, const std::size_t ReplaceTextFromTo( position, numberOfCharacters, styledText ); } -void TextView::ReplaceTextFromTo( const std::size_t position, const std::size_t numberOfCharacters, const MarkupProcessor::StyledTextArray& text ) +void TextView::ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const MarkupProcessor::StyledTextArray& text ) { // Creates metadata with the Insert operation. TextViewProcessorMetadata metadata; @@ -248,7 +247,7 @@ void TextView::ReplaceTextFromTo( const std::size_t position, const std::size_t mRelayoutOperations = RELAYOUT_ALL; } -void TextView::RemoveTextFrom( const std::size_t position, const std::size_t numberOfCharacters ) +void TextView::RemoveTextFrom( std::size_t position, std::size_t numberOfCharacters ) { // Creates metadata with the Remove operation. TextViewProcessorMetadata metadata; @@ -284,7 +283,7 @@ std::string TextView::GetText() const return text; } -void TextView::SetLineHeightOffset( const PointSize offset ) +void TextView::SetLineHeightOffset( PointSize offset ) { if( fabsf( mLayoutParameters.mLineHeightOffset - offset ) > Math::MACHINE_EPSILON_1000 ) { @@ -323,7 +322,7 @@ PointSize TextView::GetLineHeightOffset() const return PointSize( mLayoutParameters.mLineHeightOffset ); } -void TextView::SetStyleToCurrentText( const TextStyle& style, const TextStyle::Mask mask ) +void TextView::SetStyleToCurrentText( const TextStyle& style, TextStyle::Mask mask ) { if( !mCurrentStyledText.empty() ) { @@ -762,7 +761,7 @@ bool TextView::IsMarkupProcessingEnabled() const return mMarkUpEnabled; } -void TextView::SetScrollEnabled( const bool enable ) +void TextView::SetScrollEnabled( bool enable ) { if( enable != mVisualParameters.mScrollEnabled ) { @@ -874,14 +873,14 @@ TextView::LayoutParameters::LayoutParameters() MarkupProcessor::GetStyledTextArray( std::string( "..." ), mEllipsizeText, false ); } -TextView::LayoutParameters::LayoutParameters( const Toolkit::TextView::MultilinePolicy multilinePolicy, - const Toolkit::TextView::ExceedPolicy widthExceedPolicy, - const Toolkit::TextView::ExceedPolicy heightExceedPolicy, - const Toolkit::Alignment::Type alignmentType, - const Toolkit::TextView::LineJustification lineJustification, - const float lineHeightOffset, - const std::string& ellipsizeText, - const bool markUpEnabled ) +TextView::LayoutParameters::LayoutParameters( Toolkit::TextView::MultilinePolicy multilinePolicy, + Toolkit::TextView::ExceedPolicy widthExceedPolicy, + Toolkit::TextView::ExceedPolicy heightExceedPolicy, + Toolkit::Alignment::Type alignmentType, + Toolkit::TextView::LineJustification lineJustification, + float lineHeightOffset, + const std::string& ellipsizeText, + bool markUpEnabled ) : mMultilinePolicy( multilinePolicy ), mWidthExceedPolicy( widthExceedPolicy ), mHeightExceedPolicy( heightExceedPolicy ), @@ -1336,7 +1335,7 @@ void TextView::OptimizeTextViewProcessorOperations() mTextViewProcessorOperations = textViewProcessorOperations; } -void TextView::DoRelayOut( const Size& textViewSize, const RelayoutOperationMask relayoutOperationMask ) +void TextView::DoRelayOut( const Size& textViewSize, RelayoutOperationMask relayoutOperationMask ) { // Traverse the relayout operation vector. It fills the natural size, layout and glyph-actor data structures. if( !mTextViewProcessorOperations.empty() ) diff --git a/base/dali-toolkit/internal/controls/text-view/text-view-impl.h b/base/dali-toolkit/internal/controls/text-view/text-view-impl.h index 7ac5246..e4e7dd4 100644 --- a/base/dali-toolkit/internal/controls/text-view/text-view-impl.h +++ b/base/dali-toolkit/internal/controls/text-view/text-view-impl.h @@ -163,11 +163,6 @@ public: std::string GetText() const; /** - * @copydoc SetFont( const Font newFont ) - */ - void SetFont( const Font newFont ); - - /** * @copydoc SetLineHeightOffset() */ void SetLineHeightOffset( PointSize offset ); @@ -609,7 +604,7 @@ public: Toolkit::TextView::LineJustification lineJustification, float lineHeightOffset, const std::string& ellipsizeText, - const bool markUpEnabled ); + bool markUpEnabled ); /** * Copy constructor diff --git a/base/dali-toolkit/public-api/controls/text-view/text-view.cpp b/base/dali-toolkit/public-api/controls/text-view/text-view.cpp index f785e10..329688d 100644 --- a/base/dali-toolkit/public-api/controls/text-view/text-view.cpp +++ b/base/dali-toolkit/public-api/controls/text-view/text-view.cpp @@ -69,10 +69,10 @@ TextView::CharacterLayoutInfo& TextView::CharacterLayoutInfo::operator=( const T TextView::CharacterLayoutInfo::CharacterLayoutInfo( const Size& size, const Vector3& position, - const bool isNewLineChar, - const bool isRightToLeftCharacter, - const bool isVisible, - const float descender ) + bool isNewLineChar, + bool isRightToLeftCharacter, + bool isVisible, + float descender ) : mSize( size ), mPosition( position ), mIsNewLineChar( isNewLineChar ), @@ -126,7 +126,7 @@ TextView::FadeBoundary::FadeBoundary() { } -TextView::FadeBoundary::FadeBoundary( const PixelSize left, const PixelSize right, const PixelSize top, const PixelSize bottom ) +TextView::FadeBoundary::FadeBoundary( PixelSize left, PixelSize right, PixelSize top, PixelSize bottom ) : mLeft( left ), mRight( right ), mTop( top ), @@ -196,27 +196,27 @@ void TextView::SetText( const MarkupProcessor::StyledTextArray& text ) GetImpl( *this ).SetText( text ); } -void TextView::InsertTextAt( const std::size_t position, const std::string& text ) +void TextView::InsertTextAt( std::size_t position, const std::string& text ) { GetImpl( *this ).InsertTextAt( position, text ); } -void TextView::InsertTextAt( const std::size_t position, const MarkupProcessor::StyledTextArray& text ) +void TextView::InsertTextAt( std::size_t position, const MarkupProcessor::StyledTextArray& text ) { GetImpl( *this ).InsertTextAt( position, text ); } -void TextView::ReplaceTextFromTo( const std::size_t position, const std::size_t numberOfCharacters, const std::string& text ) +void TextView::ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const std::string& text ) { GetImpl( *this ).ReplaceTextFromTo( position, numberOfCharacters, text ); } -void TextView::ReplaceTextFromTo( const std::size_t position, const std::size_t numberOfCharacters, const MarkupProcessor::StyledTextArray& text ) +void TextView::ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const MarkupProcessor::StyledTextArray& text ) { GetImpl( *this ).ReplaceTextFromTo( position, numberOfCharacters, text ); } -void TextView::RemoveTextFrom( const std::size_t position, const std::size_t numberOfCharacters ) +void TextView::RemoveTextFrom( std::size_t position, std::size_t numberOfCharacters ) { GetImpl( *this ).RemoveTextFrom( position, numberOfCharacters ); } @@ -226,7 +226,7 @@ std::string TextView::GetText() const return GetImpl( *this ).GetText(); } -void TextView::SetLineHeightOffset( const PointSize offset ) +void TextView::SetLineHeightOffset( PointSize offset ) { GetImpl( *this ).SetLineHeightOffset( offset ); } @@ -236,7 +236,7 @@ PointSize TextView::GetLineHeightOffset() const return GetImpl( *this ).GetLineHeightOffset(); } -void TextView::SetStyleToCurrentText( const TextStyle& style, const TextStyle::Mask mask ) +void TextView::SetStyleToCurrentText( const TextStyle& style, TextStyle::Mask mask ) { GetImpl( *this ).SetStyleToCurrentText( style, mask ); } diff --git a/base/dali-toolkit/public-api/markup-processor/markup-processor.cpp b/base/dali-toolkit/public-api/markup-processor/markup-processor.cpp index f26a04b..a070bfe 100644 --- a/base/dali-toolkit/public-api/markup-processor/markup-processor.cpp +++ b/base/dali-toolkit/public-api/markup-processor/markup-processor.cpp @@ -1075,7 +1075,7 @@ void GetMarkupString( const StyledTextArray& styledTextArray, std::string& marku } } -void SetTextStyle( StyledTextArray& styledTextArray, const TextStyle& style, const TextStyle::Mask mask ) +void SetTextStyle( StyledTextArray& styledTextArray, const TextStyle& style, TextStyle::Mask mask ) { if( !styledTextArray.empty() ) { @@ -1084,7 +1084,7 @@ void SetTextStyle( StyledTextArray& styledTextArray, const TextStyle& style, con } } -void SetTextStyle( const Text& text, StyledTextArray& styledTextArray, const TextStyle& style, const TextStyle::Mask mask ) +void SetTextStyle( const Text& text, StyledTextArray& styledTextArray, const TextStyle& style, TextStyle::Mask mask ) { if( !text.IsEmpty() ) { @@ -1103,7 +1103,7 @@ void SetTextStyle( const Text& text, StyledTextArray& styledTextArray, const Tex } } -void SetTextStyleToRange( StyledTextArray& styledTextArray, const TextStyle& style, const TextStyle::Mask mask, const std::size_t begin, const std::size_t end ) +void SetTextStyleToRange( StyledTextArray& styledTextArray, const TextStyle& style, TextStyle::Mask mask, std::size_t begin, std::size_t end ) { const size_t size = styledTextArray.size(); DALI_ASSERT_ALWAYS( begin < size ); diff --git a/capi/dali-toolkit/public-api/controls/text-view/text-view.h b/capi/dali-toolkit/public-api/controls/text-view/text-view.h index e5e1cb7..796c18f 100644 --- a/capi/dali-toolkit/public-api/controls/text-view/text-view.h +++ b/capi/dali-toolkit/public-api/controls/text-view/text-view.h @@ -41,79 +41,30 @@ class TextView; } /** - * @brief TextView is a layout container for text with alignment, multi-line wrapping and formatting support. + * @brief The TextView class is a UI Dali::Toolkit::Control designed to extend the capabilities of the basic Dali::TextActor. * - * Different multi-line and exceed policies could be chosen to represent the given text. - * \see Toolkit::TextView::SetMultilinePolicy \see Toolkit::TextView::SetExceedPolicy + * It provides support for multi-line wrapping, multi-language font detection, text alignment, scrolling and styling. * - * Multi-line policies: - * - * - * Exceed policies work in combination with multi-line policies: - * - * - * Text alignment could be set to align the whole text block inside the text view's boundary. \see Toolkit::TextView::SetTextAlignment. - * - * Line justification could be set to align lines inside a text block. \see Toolkit::TextView::SetLineJustification. - * - * A default font could be set through the \see Toolkit::TextView::SetFont method. If any font is set, text view automatically detects a suitable font for every character. - * - * Font priority: - * 1) Use the font specified in text decoration. - * 2) Use automatic font detection. - * - * Integration with other classes (GetSizeAndPositionTable ) - * - * Text decoration ( Color, Font, Size, italic and all features supported in TextActor ) + * See the \link text-view Text View \endlink page of the Programming Guide for more details and examples. */ class TextView : public Control { public: // Signal Names - static const char* const SIGNAL_TEXT_SCROLLED; ///< Signal emitted when the scroll position changes. @see SignalScrolled() + static const char* const SIGNAL_TEXT_SCROLLED; ///< Signal emitted when the scroll position changes. @see ScrolledSignal() // Properties - static const Property::Index PROPERTY_MARKUP_ENABLED; ///< name "markup-enabled", @see SetMarkupProcessingEnabled(), type BOOLEAN - static const Property::Index PROPERTY_TEXT; ///< name "text", type STRING - static const Property::Index PROPERTY_MULTILINE_POLICY; ///< name "multiline-policy", type STRING - static const Property::Index PROPERTY_WIDTH_EXCEED_POLICY; ///< name "width-exceed-policy", type STRING - static const Property::Index PROPERTY_HEIGHT_EXCEED_POLICY; ///< name "height-exceed-policy", type STRING - static const Property::Index PROPERTY_LINE_JUSTIFICATION; ///< name "line-justification", type STRING - static const Property::Index PROPERTY_FADE_BOUNDARY; ///< name "fade-boundary", type VECTOR4 - static const Property::Index PROPERTY_LINE_HEIGHT_OFFSET; ///< name "line-height-offset", type FLOAT - static const Property::Index PROPERTY_HORIZONTAL_ALIGNMENT; ///< name "horizontal-alignment", type STRING - static const Property::Index PROPERTY_VERTICAL_ALIGNMENT; ///< name "vertical-alignment", type STRING + static const Property::Index PROPERTY_MARKUP_ENABLED; ///< name "markup-enabled", @see SetMarkupProcessingEnabled(), type BOOLEAN + static const Property::Index PROPERTY_TEXT; ///< name "text", @see SetText(), type STRING + static const Property::Index PROPERTY_MULTILINE_POLICY; ///< name "multiline-policy", @see SetMultilinePolicy(), type STRING + static const Property::Index PROPERTY_WIDTH_EXCEED_POLICY; ///< name "width-exceed-policy", @see SetWidthExceedPolicy(), type STRING + static const Property::Index PROPERTY_HEIGHT_EXCEED_POLICY; ///< name "height-exceed-policy", @see SetHeightExceedPolicy(), type STRING + static const Property::Index PROPERTY_LINE_JUSTIFICATION; ///< name "line-justification", @see SetLineJustification(), type STRING + static const Property::Index PROPERTY_FADE_BOUNDARY; ///< name "fade-boundary", @see SetFadeBoundary(), type VECTOR4 + static const Property::Index PROPERTY_LINE_HEIGHT_OFFSET; ///< name "line-height-offset", @see SetLineHeightOffset(), type FLOAT + static const Property::Index PROPERTY_HORIZONTAL_ALIGNMENT; ///< name "horizontal-alignment", @see SetTextAlignment(), type STRING + static const Property::Index PROPERTY_VERTICAL_ALIGNMENT; ///< name "vertical-alignment", @see SetTextAlignment(), type STRING /** * @brief Structure used to retrieve Layout info per character. @@ -162,14 +113,14 @@ public: float descender ); Size mSize; ///< Size of the group of characters. - Vector3 mPosition; ///< Position of the group of characters within the text view. - bool mIsNewLineChar:1; ///< Whether this group of characters represent a new line. + Vector3 mPosition; ///< Position of the character within the text view. + bool mIsNewLineChar:1; ///< Whether this character represent a new line. bool mIsRightToLeftCharacter:1; ///< Whether it's a right-to-left character. - bool mIsVisible:1; ///< Whether this group of characters is visible or not. + bool mIsVisible:1; ///< Whether this character is visible or not. float mDescender; ///< The character's descender which is the distance from the baseline to the bottom of the character }; - typedef std::vector CharacterLayoutInfoContainer; ///< Container of Character layouts + typedef std::vector CharacterLayoutInfoContainer; ///< Container of layout info per character. /** * @brief Stores some info about a laid-out line. @@ -181,7 +132,7 @@ public: float mAscender; ///< The max ascender of the current laid-out line. }; - typedef std::vector LineLayoutInfoContainer; ///< Container of line layouts + typedef std::vector LineLayoutInfoContainer; ///< Container of layout info per line. /** * @brief How text is laid out. @@ -210,7 +161,7 @@ public: */ TextLayoutInfo& operator=( const TextLayoutInfo& textLayoutInfo ); - CharacterLayoutInfoContainer mCharacterLayoutInfoTable; ///< The table of character positions and sizes sorted by the characters' visual index. + CharacterLayoutInfoContainer mCharacterLayoutInfoTable; ///< The table of character's positions and sizes sorted by the character's visual index. LineLayoutInfoContainer mLines; ///< For each laid-out line, it stores an index to the first character of the line. std::vector mCharacterLogicalToVisualMap; ///< The map to store the character's logical (input) index according to its visual (reordered) index. std::vector mCharacterVisualToLogicalMap; ///< The map to store the character's visual (reordered) index according to its logical (input) index. @@ -221,7 +172,7 @@ public: /** * @brief This structure represents a fade boundary. * - * If Exceed policy is set to Fade all text which does not fit within the text-view fade boundary is faded out. Text which exceeds the text-view boundary becomes invisible. + * If the Exceed policy is set to Fade all text which does not fit within the text-view fade boundary is faded out. Text which exceeds the text-view boundary becomes invisible. * The \e left, \e right, \e top and \e bottom values are positive, in pixels and set the distances between the text-view and fade boundaries. */ struct FadeBoundary @@ -252,31 +203,31 @@ public: }; /** - * @brief Define how to split the text in lines. + * @brief Define how to wrap the text in lines. * - * SplitByNewLineChar will split the text in lines when a '\\n' character is found. - * SplitByWord has effect only when TextView size is assigned. - * It will split the text in lines when a '\\n' character is found or if a line exceeds the TextView's boundary. This option won't split a word in two. - * SplitByChar has effect only when TextView size is assigned. - * It will split the text in lines when a '\\n' character is found or if a line exceeds the TextView's boundary. This option might split a word in two. - * The default value is SplitByNewLineChar. + * \e SplitByNewLineChar will wrap the text in lines when a '\\n' character or a \
is found. + * \e SplitByWord has effect only when TextView size is assigned. + * It will wrap the text in lines when a '\\n' character or a \
is found or if a line exceeds the TextView's boundary. This option won't split a word in two. + * \e SplitByChar has effect only when TextView size is assigned. + * It will wrap the text in lines when a '\\n' character or a \
is found or if a line exceeds the TextView's boundary. This option might split a word in two. + * The default value is \e SplitByNewLineChar. */ enum MultilinePolicy { - SplitByNewLineChar, ///< Text lines will split when '\\n' character is found. - SplitByWord, ///< Text lines will split by word or if '\\n' character is found. It has effect only when TextView size is assigned. - SplitByChar ///< Text lines will split by char or if '\\n' character is found. It has effect only when TextView size is assigned. + SplitByNewLineChar, ///< Text lines will wrap when '\\n' character is found. + SplitByWord, ///< Text lines will wrap by word or if '\\n' character is found. It has effect only when TextView size is assigned. + SplitByChar ///< Text lines will wrap by char or if '\\n' character is found. It has effect only when TextView size is assigned. }; /** - * @brief Define how to display the text when it doesn't fit inside the TextView. + * @brief Define how to display the text when it doesn't fit inside the TextView after the line wrap. * - * The default value is ShrinkToFit. + * The default value is \e Original. */ enum ExceedPolicy { Original, ///< Will display the text in its original size. If a line, a word or a character is bigger than the TextView size it may exceed its boundary. - Truncate, ///< Will display the text in its original size. It won't display the text which exceeds the TextView boundary. + Truncate, ///< @deprecated. Use Fade instead. Fade, ///< Will display the text in its original size. It won't display the text which exceeds the TextView boundary. It fades the text out. Split, ///< Will split the text in a new line. ShrinkToFit, ///< Will shrink the text to fit the TextView boundary. @@ -286,7 +237,7 @@ public: /** * @brief Define how to justify lines inside the text area. * - * The default value is Left. + * The default value is \e Left. */ enum LineJustification { @@ -298,7 +249,7 @@ public: public: /** - * @brief Create an TextView handle; this can be initialised with TextView::New(). + * @brief Create a TextView handle; this can be initialised with TextView::New(). * * Calling member functions with an uninitialised Dali::Object handle is not allowed. */ @@ -337,7 +288,10 @@ public: static TextView New( const std::string& text ); /** - * @copydoc TextView New( const std::string& text ) + * @brief Create a TextView control with styled text. + * + * @param[in] text The text with style to display. + * @return A handle the TextView control. */ static TextView New( const MarkupProcessor::StyledTextArray& text ); @@ -368,7 +322,7 @@ public: /** * @brief Replace the current text with a new text string with style. * - * @param[in] text with style to display. + * @param[in] text The text with style to display. */ void SetText( const MarkupProcessor::StyledTextArray& text ); @@ -381,7 +335,10 @@ public: void InsertTextAt( std::size_t position, const std::string& text ); /** - * @copydoc InsertTextAt( std::size_t position, const std::string& text ) + * @brief Inserts the given text with style in the specified position. + * + * @param[in] position Where the given text is going to be added. + * @param[in] text The text with style to be added. */ void InsertTextAt( std::size_t position, const MarkupProcessor::StyledTextArray& text ); @@ -397,7 +354,13 @@ public: void ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const std::string& text ); /** - * @copydoc ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const std::string& text ) + * @brief Replaces part of the text. + * + * It removes the specified number of characters from the given position and inserts the given text with style in the same specified position. + * + * @param[in] position of the first character to be removed and Where the given text is going to be added. + * @param[in] numberOfCharacters number of characters to be removed. + * @param[in] text The text with style to be added. */ void ReplaceTextFromTo( std::size_t position, std::size_t numberOfCharacters, const MarkupProcessor::StyledTextArray& text ); @@ -460,14 +423,14 @@ public: Alignment::Type GetTextAlignment() const; /** - * @brief Sets how to split the text in lines policy. + * @brief Sets how to wrap the text in lines policy. * - * @param policy The multi-line policy. SplitByNewLineChar is set by default. + * @param policy The multi-line policy. \e SplitByNewLineChar is set by default. */ void SetMultilinePolicy( MultilinePolicy policy ); /** - * @brief Gets the split in lines policy. + * @brief Gets the wrap in lines policy. * * @return The multi-line policy. */ @@ -541,7 +504,7 @@ public: void SetEllipsizeText( const std::string& ellipsizeText ); /** - * @brief Sets the ellipsize text. + * @brief Sets the ellipsize text with style. * * @param[in] ellipsizeText The new text with its style. */ @@ -578,7 +541,7 @@ public: /** * @brief Sets whether text-view renders text using a previously generated snapshot. * - * Rendering long text using a snapshot may increase performance. The default value is \e true (render using a snapshot). + * Rendering long text using a snapshot may increase performance. The default value is \e false (render without using a snapshot). * * @param[in] enable Whether text-view is using a snapshot to render text. */ @@ -655,7 +618,7 @@ public: typedef SignalV2< void ( TextView textView, Vector2 scrollDelta ) > ScrolledSignalV2; /** - * @brief Signal emitted when the scroll position changes. + * @brief Signal emitted when the text is scrolled inside the text-view. * * A callback with the following prototype can be connected to this signal. * @@ -671,6 +634,7 @@ public: // Not intended for application developers /** * @brief Creates a handle using the Toolkit::Internal implementation. + * @note Not intended for application developers * * @param[in] implementation The Control implementation. */ @@ -678,6 +642,7 @@ public: // Not intended for application developers /** * @brief Allows the creation of this Control from an Internal::CustomActor pointer. + * @note Not intended for application developers * * @param[in] internal A pointer to the internal CustomActor. */ diff --git a/capi/dali-toolkit/public-api/markup-processor/markup-processor.h b/capi/dali-toolkit/public-api/markup-processor/markup-processor.h index 51240db..cafc3da 100644 --- a/capi/dali-toolkit/public-api/markup-processor/markup-processor.h +++ b/capi/dali-toolkit/public-api/markup-processor/markup-processor.h @@ -36,6 +36,8 @@ namespace Toolkit /** * @brief Markup Processor enumerations, structures and functions. + * + * See the \link markup-processor Markup Processor \endlink page in the Programming Guide. */ namespace MarkupProcessor { @@ -86,44 +88,9 @@ typedef std::vector StyledTextArray; /** * @brief Creates a text array with its style from a markup string. * - * The syntax of a markup string is html-ish. It contains open, close - * and empty tags and some of them can contain parameters. - * - *
    - *
  • \e \\ Bold text. - *
  • \e \\ Italic text. - *
  • \e \\ Underlined text. - *
  • \e \
    New line. - *
  • \e \\ Specifies font properties: - *
      - *
    • \e face Font face. - *
    • \e size Font size. - *
    • \e color Font color. - *
    - *
  • \e \\ Specifies shadow properties @see Dali::TextActor::SetShadow(). - *
      - *
    • \e paramx X offset. - *
    • \e paramy Y offset. - *
    • \e color Shadow color. - *
    - *
  • \e \\ Specifies glow properties @see Dali::TextActor::SetGlow(). - *
      - *
    • \e param Glow around the text. - *
    • \e color Glow color. - *
    - *
  • \e \\ Specifies outline properties @see Dali::TextActor::SetOutline(). - *
      - *
    • \e paramx X thickness. - *
    • \e paramy Y thickness. - *
    • \e color Outline color. - *
    - *
  • \e \\ Specify the smooth edge @see Dali::TextActor::SetSmoothEdge(). - *
      - *
    • \e paramx Distance field. - *
    - *
+ * Refer to the \link markup-processor Markup Processor \endlink page in the Programming Guide + * to see the html-ish sintax and some examples. * - * 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 @@ -154,16 +121,19 @@ void GetMarkupString( const StyledTextArray& styledTextArray, std::string& marku * @param[in] style The given style * @param[in] mask The bit mask. */ -void SetTextStyle( StyledTextArray& styledTextArray, const TextStyle& style, const TextStyle::Mask mask = TextStyle::ALL ); +void SetTextStyle( StyledTextArray& styledTextArray, const TextStyle& style, TextStyle::Mask mask = TextStyle::ALL ); /** - * @see SetTextStyle( StyledTextArray& styledTextArray, const TextStyle& style, StyleMask mask ) + * @brief Sets a text style to the given text. + * + * @see SetTextStyle( StyledTextArray& styledTextArray, const TextStyle& style, TextStyle::Mask mask ) + * * @param[in] text The input text. * @param[out] styledTextArray The input text with the given style. * @param[in] style The given style. * @param[in] mask The bit mask. */ -void SetTextStyle( const Text& text, StyledTextArray& styledTextArray, const TextStyle& style, const TextStyle::Mask mask = TextStyle::ALL ); +void SetTextStyle( const Text& text, StyledTextArray& styledTextArray, const TextStyle& style, TextStyle::Mask mask = TextStyle::ALL ); /** * @brief Sets a text style to a range of characters of the given text. @@ -176,7 +146,7 @@ void SetTextStyle( const Text& text, StyledTextArray& styledTextArray, const Tex * @param[in] end The last character of the range. * @note It will assert if begin or end are out of range, or if begin > end. */ -void SetTextStyleToRange( StyledTextArray& styledTextArray, const TextStyle& style, const TextStyle::Mask mask, const std::size_t begin, const std::size_t end ); +void SetTextStyleToRange( StyledTextArray& styledTextArray, const TextStyle& style, TextStyle::Mask mask, std::size_t begin, std::size_t end ); } // namespace MarkupProcessor -- 2.7.4