Tizen 2.1 base
[framework/osp/uifw.git] / src / graphics / inc / FGrp_TextTextElement.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_TextTextElement.h
20  * @brief       This is the header file for the TextElement class.
21  *
22  * This header file contains the declarations of the %TextElement class.
23  */
24
25 #ifndef _FGRP_INTERNAL_TEXT_COMPONENT_H_
26 #define _FGRP_INTERNAL_TEXT_COMPONENT_H_
27
28 // Includes
29 #include <FBaseObject.h>
30 #include "FGrp_TextCommon.h"
31
32 namespace Tizen { namespace Graphics
33 {
34 class _CanvasImpl;
35
36 namespace _Text
37 {
38
39 class _OSP_EXPORT_ TextElement
40         : public Tizen::Base::Object
41 {
42 public:
43         TextElement(void);
44
45         virtual ~TextElement(void);
46
47 public:
48         virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
49                         int& actualLength, int& width,  int& height);
50
51         virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex,
52                         int textLength, const TextObjectAlignment alignment, const TextObjectActionType action);
53
54         virtual TextElement* CloneN(TextComponentInfoValueType type, unsigned int value);
55
56         virtual TextElement* CopyN(int textStart, int textLength);
57
58         virtual void CopyMembers(TextElement* pTargetTextElement);
59
60         virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const;
61
62         virtual result GetBlockRegion(int textIndex, int textLength, int& width, int& height) const;
63
64         virtual int GetHeight(void) const;
65
66         virtual int GetTextLength(void) const;
67
68         virtual void SetTextLength(int length);
69
70         virtual unsigned int GetValue(TextComponentInfoValueType type) const;
71
72         virtual result SetValue(TextComponentInfoValueType type, unsigned int value);
73
74         virtual TextElementType GetType(void) const;
75
76         virtual TextElementSourceType GetSourceType(void) const;
77
78         virtual bool SetFocused(bool hasFocus);
79
80         virtual bool GetFocused(void) const;
81
82         virtual void SetAlternateLookEnabled(bool enable);
83
84         virtual bool IsAlternateLookEnabled(void) const;
85
86         virtual void SetAlternativeForegroundColor(const Color& foregroundColor);
87
88         virtual Color GetAlternativeForegroundColor(void) const;
89
90         virtual int GetBaseline(void) const;
91
92         virtual void SetForegroundColor(const Color& color);
93
94         virtual Color GetForegroundColor(void) const;
95
96         virtual void SetBackgroundColor(const Color& color);
97
98         virtual Color GetBackgroundColor(void) const;
99
100         virtual void SetBackGroundDrawingModeEnabled(bool enable);
101
102         virtual bool IsBackGroundDrawingModeEnable(void) const;
103
104 protected:
105         TextElementType _type;
106         TextElementSourceType _sourceType;
107         Color _alternativeColor;
108         int _length;
109         bool _hasFocus;
110         bool _isAlternateLookEnabled;
111
112 private:
113         TextElement(const TextElement& other); // NOT IMPLMENTED
114
115         TextElement& operator =(const TextElement& rhs); // NOT IMPLMENTED
116
117 }; // TextElement
118
119 }}} // Tizen::Graphics::_Text
120
121 #endif // _FGRP_INTERNAL_TEXT_COMPONENT_H_