2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FGrp_TextTextWidthManager.h
20 * @brief This is the header file for the TextWidthManager class.
22 * This header file contains the declarations of the %TextWidthManager class.
25 #ifndef _FGRP_INTERNAL_TEXT_WIDTH_MANAGER_H_
26 #define _FGRP_INTERNAL_TEXT_WIDTH_MANAGER_H_
28 #include "FGrp_TextCommon.h"
29 #include "FGrp_TextTextElement.h"
30 #include "FGrp_TextTextSimpleList.h"
32 namespace Tizen { namespace Graphics
38 struct TextWidthCommonInfo;
39 struct WordTextWidthInfo;
41 struct TextLineComposeInfo
49 class TextWidthManager
52 TextWidthManager(TextComposite* pCompositeText);
54 virtual ~TextWidthManager(void);
57 bool Initialize(int textLength);
61 bool StartCompose(int textIndex);
63 bool GetCurrentLineInfo(int lineWidth, TextLineComposeInfo& textLineComposeInfo);
65 bool EndCompose(void);
67 bool InformTextInsert(int textIndex, int textLength);
69 bool InformTextRemove(int textIndex, int textLength);
72 SimpleNode* SplitWidthInfo(SimpleNode* pOrginalTextWidhtInfoNode, int splitStartIndex, TextWidthCommonInfo* pTextWidthInfo);
74 WordTextWidthInfo* SplitCurrentWordWidthInfo(int limitWidth, bool& isNextKoreanStart);
76 WordTextWidthInfo* SplitWordWidthInfo(SimpleNode* pCurrentWordWidthInfoNode, TextElement* pCurrentTextElement, int strCurrentRelIndex, int strCurrentLength, int limitWidth, bool& isNextKoreanStart);
78 bool Seek(int textLength);
80 bool AnalyzeCurrentUnKnownTextWidthInfo(int limitWidth);
82 SimpleNode* AnalyzeUnKnownTextWidthInfo(SimpleNode* pCurrentWordWidthInfoNode, TextElement* pCurrentTextElement, int strCurrentRelIndex, int strCurrentLength, int limitWidth);
84 bool AnalyzeNextTextWidthInfo(int limitWidth, bool& wordoverWidth, int& widthAnlyzed, int& strLengthAalyzed, int& heightAnalzyed, bool& isnextKorean, bool& meetCutlink);
86 bool UpdateCachedTextWidhtInfo(int widthInfoTextOffset, SimpleNode* pTextWidthInfoNode);
88 SimpleNode* SearchTextWidthInfo(int textIndex, int& widthInfoTextOffset);
90 bool IsKorean(wchar_t strChar);
92 int GetTextWidthInfoLength(TextWidthCommonInfo* pTextWidthCommonInfo);
95 TextComposite* __pCompositeText;
96 TextElement* __pCurrentComposeTextElement;
97 TextElementType __currentTextElementType;
98 int __currentComposeTextElementIndex;
99 SimpleNode* __pCurrentWordWidthInfoNode;
100 SimpleNode* __pCachedWordWidthInfoNode;
101 SimpleList* __pTextWidthInfoList;
102 bool __isInitialized;
105 int __currentTextIndex;
106 int __strCurrentRelIndex;
107 int __currentTextElementLength;
108 int __textOffsetOfCurrentWidthInfo;
109 int __textOffsetOfCachedWidthInfo;
112 TextWidthManager(const TextWidthManager& other); // NOT IMPLMENTED
114 TextWidthManager& operator =(const TextWidthManager& rhs); // NOT IMPLMENTED
116 }; // TextWidthManager
118 }}} // Tizen::Graphics::_Text
120 #endif // _FGRP_INTERNAL_TEXT_WIDTH_MANAGER_H_