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_TextTextColumn.h
20 * @brief This file contains the declarations of TextColumn class.
23 #ifndef _FGRP_INTERNAL_TEXT_COLUMN_H_
24 #define _FGRP_INTERNAL_TEXT_COLUMN_H_
26 #include "FGrp_TextCommon.h"
27 #include "FGrp_TextTextSimpleList.h"
29 namespace Tizen { namespace Graphics
37 struct ChangeActionEventInfo;
44 TEXT_CHANGE_INSERT = 0,
50 enum ActionProcessResult
55 MERGE_AND_BEFORE_ACTION,
56 MERGE_AND_AFTER_ACTION,
69 TextColumn(TextComposite* pCompositeText = null);
71 virtual ~TextColumn(void);
74 virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex,
75 int textLength, const TextObjectAlignment alignment, const TextObjectActionType action);
77 virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const;
79 virtual int GetHeight(int textIndex) const;
81 virtual int GetTextLength(void) const;
83 virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
84 int& actualLength, int& width, int& height);
86 result Append(TextLine* pTextLine);
88 result AddLineDuringCompose(TextLine* pTextLine);
90 result Remove(TextLine* pTextLine);
92 result RemoveAllLines(void);
94 result PrepareCompose(void);
96 result FinishCompose(bool isUpdateSweepInfo = true);
98 bool IsComposeDone(void);
100 int GetTotalHeight(void) const;
102 int GetLineHeightAt(int index) const;
104 int GetTotalLineCount(void) const;
106 int GetLineIndexAtTextIndex(int textIndex) const;
108 int GetLineIndexAtPositionY(int y);
110 TextLine* GetTextLine(int lineIndex) const;
112 SimpleNode* GetTextLineNode(int lineIndex) const;
114 void SetFirstDisplayLineIndex(int lineIndex);
116 int GetFirstDisplayLineIndex(void) const;
118 void SetDisplayLineCount(int displayLineCount);
120 int GetDisplayLineCount(void) const;
122 void SetDisplayHeight(int height);
124 int GetDisplayHeight(void) const;
126 void SetFirstDisplayPositionY(int y);
128 int GetFirstDisplayPositionY(void) const;
130 int GetTextLengthAt(int lineIndex) const;
132 int GetFirstTextIndexAt(int lineIndex) const;
134 result SetSlidingDimension(Tizen::Graphics::Dimension& slidingDimension);
136 Tizen::Graphics::Dimension GetSlidingDimension(void) const;
138 void SetSlidingPosition(int slidingPosition);
140 int GetSlidingPosition(void) const;
142 TextLine* GetPrevLineChangedStartLine(void) const;
144 int GetChangeActionEventCount(void) const;
146 void SetChangedStartLineIndex(int changedStartLineIndex);
148 int GetChangedStartLineIndex(void) const;
150 void SetChangedLastLineIndex(int changedLastLineIndex);
152 int GetChangedLastLineIndex(void) const;
154 int GetChangedStrStartIndex(void) const;
156 result SetChangeAction(ChangeAction changeAction, int textIndex, int textLength);
158 result RemoveAllKeepLines(void);
160 TextObjectSweepType GetTextSweepType(void);
162 result UpdateSweepInfo(void);
164 result UpdateSweepInfoFirstLine(void);
166 result SetKeyInputLine(int changedStartlineIndex, int lineCount);
168 result CompareDeletedLine(void);
171 result RemoveLines(int lineIndex, int lineCount);
173 result RemoveLinesFrom(int lineIndex);
175 void RemoveAllChangeActions(void);
177 result UpdateCompositionInfo(int changedStartTextIndex, int changedEndTextIndex, int changedTextLength, bool existUnkownAction);
179 result GetTextChangedInfo(int& changedStartTextIndex, int& changedEndTextIndex, int& changedTextLength, bool& existUnkownAction) const;
181 ActionProcessResult DoProcessTextAction(ChangeAction inputAction, int textIndex, int textLength,
182 ChangeActionEventInfo* pCurrentStrActionEventInfo, int& changedStartTextIndex,
183 int& strOutputChangedNum);
185 ActionProcessResult DoProcessUnknownThroughUnknown(int textIndex, ChangeActionEventInfo* pCurrentActionEventInfo);
187 ActionProcessResult DoProcessUnkownThroughInsert(int textIndex, ChangeActionEventInfo* pCurrentActionEventInfo,
188 int& strOutputStartIndex);
190 ActionProcessResult DoProcessUnkownThroughRemove(int textIndex, ChangeActionEventInfo* pCurrentActionEventInfo,
191 int& changedStartTextIndex);
193 ActionProcessResult DoProcessInsertThroughUnkown(int textIndex, ChangeActionEventInfo* pCurrentActionEventInfo);
195 ActionProcessResult DoProcessInsertThroughInsert(int textIndex, int textLength,
196 ChangeActionEventInfo* pCurrentActionEventInfo, int& changedStartTextIndex);
198 ActionProcessResult DoProcessInsertThroughRemove(int textIndex, ChangeActionEventInfo* pCurrentActionEventInfo,
199 int& changedStartTextIndex);
201 ActionProcessResult DoProcessRemoveThroughUnkown(int textIndex, ChangeActionEventInfo* pCurrentActionEventInfo);
203 ActionProcessResult DoProcessRemoveThroughInsert(int textIndex, int textLength,
204 ChangeActionEventInfo* pCurrentActionEventInfo, int& changedStartTextIndex,
205 int& strOutputChangedNum);
207 ActionProcessResult DoProcessRemoveThroughRemove(int textIndex, ChangeActionEventInfo* pCurrentActionEventInfo,
208 int& changedStartTextIndex);
210 result KeepLines(int lineIndex, int lineCount);
213 TextComposite* __pCompositeText;
214 SimpleList* __pLines;
215 SimpleList* __pTextChangeActionList;
216 int __totalLineCount;
217 int __firstDisplayLineIndex;
218 int __firstDisplayPositionY;
219 int __displayLineCount;
221 Tizen::Graphics::Dimension __slidingDimension;
222 int __slidingPosition;
223 bool __setChangeAction;
224 ChangeAction __textChangeAction;
225 int __chagedStartTextIndex;
226 int __changedTextLength;
227 int __changedStartLineIndex;
228 int __changedLastLineIndex;
229 int __prevLineIndexBeforeChangedStartLine;
230 int __nextLineIndexAfterChangedLastLine;
231 int __textOffsetOfNextLineAfterChangedLine;
232 int __currentLineIndexToAddDuringCompose;
233 bool __isComposeDone;
234 SimpleNode* __pCachedLineNode;
235 int __cachedLineIndex;
236 int __cachedLinePositionY;
238 SimpleList* __pKeepLines;
240 int __insertedLineCountDuringCompose;
243 TextColumn(const TextColumn& other); // NOT IMPLMENTED
245 TextColumn& operator =(const TextColumn& rhs); // NOT IMPLMENTED
249 }}} // Tizen::Graphics::_Text
251 #endif // _FGRP_INTERNAL_TEXT_COLUMN_H_