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-view-word-processor.h;h=82f36f0e14fb00711b0d1bcbaa6da054504187d8;hp=a942dc8b0f387ca94399b0eb66abec832e18aa0c;hb=c11191b4322a0687606b3e7f05db0a31f85403cc;hpb=64485a966f60d59a33610e3439703dc7e7c19c32 diff --git a/base/dali-toolkit/internal/controls/text-view/text-view-word-processor.h b/base/dali-toolkit/internal/controls/text-view/text-view-word-processor.h index a942dc8..82f36f0 100644 --- a/base/dali-toolkit/internal/controls/text-view/text-view-word-processor.h +++ b/base/dali-toolkit/internal/controls/text-view/text-view-word-processor.h @@ -36,40 +36,52 @@ namespace TextViewProcessor /** * Creates a data structure with info to layout the word, and data structures with useful info to modify the layout data structure if characters are added or removed. * - * @param[in] word The styled word. + * @param[in] paragraphText The paragraph's text. + * @param[in] textStyles The styles for each character of the paragraph. * @param[out] wordLayoutInfo Layout info for all characters of the word. */ -void CreateWordTextInfo( const MarkupProcessor::StyledTextArray& word, +void CreateWordTextInfo( const Text& paragraphText, + Vector& textStyles, WordLayoutInfo& wordLayoutInfo ); /** + * Updates the word size and ascender. + * + * It's called after deleting some characters, split a word in two, + * or when a new word is created when right to left text is reordered. + * + * @param[in] wordLayout The word layout info. + */ +void UpdateLayoutInfo( WordLayoutInfo& wordLayout ); + +/** * Removes a given number of characters from the given word. * * It calls the RemoveCharactersFromWord() function to remove characters from the word. * * If the word is a white space \e mergeWords will return \e true and \e textInfoMergeIndicesBegin and \e textInfoMergeIndicesEnd will be set to merge the two adjacent words. - * If the word is a new line character \e mergeLines will return \e true and \e textInfoMergeIndicesBegin and \e textInfoMergeIndicesEnd will be set to merge the two lines. + * If the word is a new paragraph character \e mergeParagraphs will return \e true and \e textInfoMergeIndicesBegin and \e textInfoMergeIndicesEnd will be set to merge the two paragraphs. * * @param[in,out] relayoutData Natural size (metrics), layout, text-actor info. * @param[in] numberOfCharacters The number of characters to be deleted. * @param[out] mergeWords Whether adjacent words need to be merged. - * @param[out] mergeLines Whether current line need to be merged with the next one. - * @param[in,out] textInfoIndicesBegin Indices to the line, word and characters from where to delete characters. It returns from where words need to be removed. - * @param[out] textInfoIndicesEnd If lines or words need to be merged it returns info to delete them (If a word is merged, it has to be removed. Equal for lines). - * @param[out] textInfoMergeIndicesBegin The indices to the first part of the line and word to be merged. - * @param[out] textInfoMergeIndicesEnd The indices to the last part of the line and word to be merged. - * @param[in,out] lineLayout Layout info of the line where the word is located. + * @param[out] mergeParagraphs Whether current paragraph need to be merged with the next one. + * @param[in,out] textInfoIndicesBegin Indices to the paragraph, word and characters from where to delete characters. It returns from where words need to be removed. + * @param[out] textInfoIndicesEnd If paragraphs or words need to be merged it returns info to delete them (If a word is merged, it has to be removed. Equal for paragraphs). + * @param[out] textInfoMergeIndicesBegin The indices to the first part of the paragraph and word to be merged. + * @param[out] textInfoMergeIndicesEnd The indices to the last part of the paragraph and word to be merged. + * @param[in,out] paragraphLayout Layout info of the paragraph where the word is located. * @param[out] removedTextActors Stores handles of temoved text-actors. */ void RemoveCharactersFromWordInfo( TextView::RelayoutData& relayoutData, std::size_t numberOfCharacters, bool& mergeWords, - bool& mergeLines, + bool& mergeParagraphs, TextInfoIndices& textInfoIndicesBegin, TextInfoIndices& textInfoIndicesEnd, TextInfoIndices& textInfoMergeIndicesBegin, TextInfoIndices& textInfoMergeIndicesEnd, - LineLayoutInfo& lineLayout, + ParagraphLayoutInfo& paragraphLayout, std::vector& removedTextActors ); /** * Removes a given number of characters from the given word. @@ -106,7 +118,7 @@ void SplitWord( std::size_t position, * * @note Does nothing if last part of the word is empty. * @note If the first part of the word is empty it just copy the last part to it. - * @note It asserts if the first or the last word is a word separator (white space) or a line separator (new line character) + * @note It asserts if the first or the last word is a word separator (white space) or a paragraph separator (new paragraph character) * * @param[in,out] firstWordLayoutInfo The input is the layout info of the first word. The output is the layout info of the merged word. * @param[in] lastWordLayoutInfo Layout info of the last word. @@ -142,14 +154,14 @@ CharacterLayoutInfo GetLastCharacterLayoutInfo( const WordLayoutInfo& wordLayout void CollectTextActors( std::vector& textActors, const WordLayoutInfo& word, std::size_t characterIndexBegin, std::size_t characterIndexEnd ); /** - * Collects text-actors from the given line, within the given indices, and stores them into the text-actor vector. + * Collects text-actors from the given paragraph, within the given indices, and stores them into the text-actor vector. * - * @param[out] textActors Stores the text-actors of the given line. - * @param[in] line The line with the words. + * @param[out] textActors Stores the text-actors of the given paragraph. + * @param[in] paragraph The paragraph with the words. * @param[in] wordIndexBegin Index to the first word. * @param[in] wordIndexEnd Index to the last word. */ -void CollectTextActorsFromWords( std::vector& textActors, const LineLayoutInfo& line, std::size_t wordIndexBegin, std::size_t wordIndexEnd ); +void CollectTextActorsFromWords( std::vector& textActors, const ParagraphLayoutInfo& paragraph, std::size_t wordIndexBegin, std::size_t wordIndexEnd ); } //namespace TextViewProcessor