Tizen 2.1 base
[framework/osp/uifw.git] / src / graphics / text / FGrp_TextTextLine.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /*
19  * @file        FGrp_TextTextLine.h
20  * @brief       This is the header file for the TextLine class.
21  *
22  * This header file contains the declarations of the %TextLine class.
23  */
24
25 #ifndef _FGRP_INTERNAL_TEXT_LINE_H_
26 #define _FGRP_INTERNAL_TEXT_LINE_H_
27
28 #include "FGrp_TextCommon.h"
29
30 namespace Tizen { namespace Graphics
31 {
32
33 class _CanvasImpl;
34
35 namespace _Text
36 {
37
38 class TextComposite;
39
40 class TextLine
41 {
42 public:
43         TextLine(TextComposite* pCompositeText = null);
44
45         virtual ~TextLine(void);
46
47 public:
48         virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength,
49                         const TextObjectAlignment align, const TextObjectActionType action);
50
51         virtual result DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLength, Rectangle& displayRect);
52
53         virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
54                                                                                 int& actualLength, int& width, int& height);
55
56         virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const;
57
58         virtual int GetHeight(int textIndex) const;
59
60         virtual int GetTextLength(void) const;
61
62         virtual void SetTextLength(int length);
63
64         void SetIndex(int index);
65
66         int GetIndex(void) const;
67
68         result SetTextOffset(int textOffset);
69
70         int GetTextOffset(void) const;
71
72         result SetBounds(const Rectangle& rect);
73
74         Rectangle GetBounds(void) const;
75
76         void SetEndType(int endType);
77
78         int GetEndType(void) const;
79
80         void SetRegion(int width, int height);
81
82         TextLine* CopyN(void);
83
84         void SetBaseline(int baseline);
85
86         int GetBaseline(void) const;
87
88         result ResetSweepInfo(void);
89
90         void SetSweepComposeInfo(TextObjectSweepComposeLineInfo& textSweepComposeLineInfo);
91
92         TextObjectSweepComposeLineInfo GetSweepComposeInfo(void) const;
93
94         void SetSweepIn(int sweepIn);
95
96         int GetSweepIn(void) const;
97
98         void SetSweepOut(int sweepOut);
99
100         int GetSweepOut(void) const;
101
102         void SetKeyInputResult(int keyInputResult);
103
104         int GetKeyInputResult(void) const;
105
106         void NotifyLineChanged(bool isChanged);
107
108         bool isChanged(void) const;
109
110         void SetKeyInputOffset(int keyInputTextIndex);
111
112         int GetKeyInputOffset(void) const;
113
114         void SetKeyInputLength(int keyInputTextLength);
115
116         int GetKeyInputLength(void);
117
118 // Attribute
119 private:
120         TextComposite* __pCompositeText;
121         Rectangle __rect;
122         int __endType;
123         int __index;
124         int __textOffset;
125         int __textLength;
126         int __width;
127         int __height;
128         int __baseline;
129         TextObjectSweepComposeLineInfo __sweepComposeLineInfo;
130         int __sweepIn;
131         int __sweepOut;
132         int __sweepType;
133         bool __isKeyInputChanged;
134         int __keyInputTextIndex;
135         int __keyInputTextLength;
136
137 private:
138         TextLine(const TextLine& other); // NOT IMPLMENTED
139
140         TextLine& operator =(const TextLine& rhs); // NOT IMPLMENTED
141
142 }; // TextLine
143
144 }}} // Tizen::Graphics::_Text
145
146 #endif // _FGRP_INTERNAL_TEXT_LINE_H_