X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Ftext-view%2Ftext-processor.h;h=9814c096ddca57d22cf0da5d445cdb91fb3b8fae;hp=63248050933193e0195513ff12e1feefc16e7236;hb=c11191b4322a0687606b3e7f05db0a31f85403cc;hpb=59fdf81f3cc2d004cca1b182dee09e42492d51c5 diff --git a/base/dali-toolkit/internal/controls/text-view/text-processor.h b/base/dali-toolkit/internal/controls/text-view/text-processor.h index 6324805..9814c09 100644 --- a/base/dali-toolkit/internal/controls/text-view/text-processor.h +++ b/base/dali-toolkit/internal/controls/text-view/text-processor.h @@ -32,6 +32,8 @@ namespace Internal namespace TextProcessor { +// Forward declarations. +struct BidirectionalParagraphInfo; /** * Splits the given text in paragraphs. @@ -39,60 +41,22 @@ namespace TextProcessor * @note Assumes the StyledTextArray has 1 Character per Text element. (which is the case for text in TextInput, but * not necessarily the case for text in TextView) * - * @param [in] text The given text. + * @param [in] styledTextArray The given text. * @param [out] paragraphs The text split in paragraphs. + * @param [out] styles The styles of each character of each paragraph. */ -void SplitInParagraphs( const MarkupProcessor::StyledTextArray& text, - std::vector& paragraphs ); +void SplitInParagraphs( const MarkupProcessor::StyledTextArray& styledTextArray, + std::vector& paragraphs, + std::vector< Vector >& styles ); /** - * Splits the given paragraph in words. - * - * @note Assumes the StyledTextArray has 1 Character per Text element. (which is the case for text in TextInput, but - * not necessarily the case for text in TextView) + * Finds the position of all word separators (currently white spaces and new paragraph characters '\n') in the given text. * * @param [in] paragraph The given paragraph. - * @param [out] words The paragraph split in words. - */ -void SplitInWords( const MarkupProcessor::StyledTextArray& paragraph, - std::vector& words ); - -/** - * Whether the text begins with right-to-left (bidirectional) character. - * @param [in] text The given text. - * @return \e true if the text begins right-to-left character. - */ -bool BeginsRightToLeftCharacter( const Text& text ); - -/** - * @copydoc BeginsRightToLeftCharacter( const Text& text ) - */ -bool BeginsRightToLeftCharacter( const MarkupProcessor::StyledTextArray& text ); - -/** - * Whether the text contains any right-to-left (bidirectional) character. - * @param [in] text The given text. - * @return \e true if the text contains right-to-left character. - */ -bool ContainsRightToLeftCharacter( const Text& text ); - -/** - * @copydoc ContainsRightToLeftCharacter( const Text& text ) - */ -bool ContainsRightToLeftCharacter( const MarkupProcessor::StyledTextArray& text ); - -/** - * Convert the text as specified by the Unicode Bidirectional Algorithm. - * The text is converted only if it is bidirectional. - * @param[in] line The line of text to be converted. - * @param[out] convertedText The text converted. - * @param[out] logicalToVisualMap The character position map from the logical input text to the visual output text. - * @param[out] visualToLogicalMap The character position map from the visual output text to the logical input text. + * @param [out] positions Positions within the paragraph of all word sepatators. */ - void ConvertBidirectionalText( const MarkupProcessor::StyledTextArray& line, - MarkupProcessor::StyledTextArray& convertedText, - std::vector& logicalToVisualMap, - std::vector& visualToLogicalMap ); +void SplitInWords( const Text& paragraph, + Vector& positions ); /** * Finds the nearest word in a string to a specified