Removed some redundant methods from TextController & Moved some code to other files
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / shaper.h
1 #ifndef DALI_TOOLKIT_TEXT_SHAPER_H
2 #define DALI_TOOLKIT_TEXT_SHAPER_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/common/dali-vector.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/text/font-run.h>
26 #include <dali-toolkit/internal/text/script-run.h>
27
28 namespace Dali
29 {
30 namespace Toolkit
31 {
32 namespace Text
33 {
34 class LogicalModel;
35 class VisualModel;
36
37 /**
38  * Shapes the whole text.
39  *
40  * @param[in] text Vector of UTF-32 characters.
41  * @param[in] lineBreakInfo The line break info.
42  * @param[in] scripts Vector containing the script runs for the whole text.
43  * @param[in] fonts Vector with validated fonts.
44  * @param[in] startCharacterIndex The character from where the text is shaped.
45  * @param[in] startGlyphIndex The glyph from where the text is shaped.
46  * @param[in] numberOfCharacters The number of characters to be shaped.
47  * @param[out] glyphs Vector of glyphs in the visual order.
48  * @param[out] glyphToCharacterMap Vector containing the first character in the logical model that each glyph relates to.
49  * @param[out] charactersPerGlyph Vector containing the number of characters per glyph.
50  * @param[out] newParagraphGlyphs Vector containing the indices to the new paragraph glyphs.
51  */
52 void ShapeText(const Vector<Character>&     text,
53                const Vector<LineBreakInfo>& lineBreakInfo,
54                const Vector<ScriptRun>&     scripts,
55                const Vector<FontRun>&       fonts,
56                CharacterIndex               startCharacterIndex,
57                GlyphIndex                   startGlyphIndex,
58                Length                       numberOfCharacters,
59                Vector<GlyphInfo>&           glyphs,
60                Vector<CharacterIndex>&      glyphToCharacterMap,
61                Vector<Length>&              charactersPerGlyph,
62                Vector<GlyphIndex>&          newParagraphGlyphs);
63
64 } // namespace Text
65
66 } // namespace Toolkit
67
68 } // namespace Dali
69
70 #endif // DALI_TOOLKIT_TEXT_SHAPER_H