Merge "fixed bug (TapGesture improvement)" into tizen_2.1
[platform/framework/native/uifw.git] / src / graphics / inc / FGrp_TextTextCutLink.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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_TextTextCutLink.h
20  * @brief       This is the header file for the TextCutLink class.
21  *
22  * This header file contains the declarations of the %TextCutLink class.
23  */
24
25 #ifndef _FGRP_INTERNAL_TEXT_CUTLINK_H_
26 #define _FGRP_INTERNAL_TEXT_CUTLINK_H_
27
28 // Includes
29 #include "FGrp_TextCommon.h"
30 #include "FGrp_TextTextSimple.h"
31
32 namespace Tizen { namespace Graphics
33 {
34 class _CanvasImpl;
35
36 namespace _Text
37 {
38
39 /**
40  * @class TextCutLink
41  * @brief
42  * @since       2.0
43  */
44 class _OSP_EXPORT_ TextCutLink
45         : public TextSimple
46 {
47 public:
48         TextCutLink(bool isEditable, Tizen::Base::Utility::LinkType cutLinkType, const wchar_t* pText, int length,
49                         TextElementSourceType sourceType = TEXT_ELEMENT_SOURCE_TYPE_INTERNAL, Font* pFont = null,
50                         const Color& foregroundColor = 0, const Color& backgroundColor = 0, const Color& outlineColor = 0);
51
52         virtual ~TextCutLink(void);
53
54 public:
55         virtual TextElement* CloneN(TextComponentInfoValueType type, unsigned int value);
56
57         virtual TextElement* CopyN(int startTextIndex, int textLength);
58
59         virtual result ChangeTextOffset(wchar_t* pText, int gap);
60
61         virtual unsigned int GetValue(TextComponentInfoValueType type) const;
62
63         virtual result SetValue(TextComponentInfoValueType type, unsigned int value);
64
65         virtual result SetTextOffset(int offset);
66
67         virtual const Font* GetFont(void) const;
68
69         bool GetEditable(void) const;
70
71         void SetEditModeEnable(bool enable);
72
73         bool IsEditModeEnable(void) const;
74
75         Tizen::Base::Utility::LinkType GetCutLinkType(void) const;
76
77         void SetSelect(bool isSelected);
78
79         bool GetSelect(void) const;
80
81         void SetUserColor(const Color& color, const Color& colorInSelect);
82
83         void ResetUserColor(void);
84
85 private:
86         virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align,
87                                                 const TextObjectActionType action);
88
89         virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align,
90                                                 const TextObjectActionType action);
91
92         virtual Font* GetCurrentFont(void) const;
93
94         virtual Color GetCurrentForegroundColor(void) const;
95
96         virtual Color GetCurrentBackgroundColor(void) const;
97
98         virtual Color GetCurrentOutlineColor(void) const;
99
100 private:
101         Tizen::Base::Utility::LinkType __linkType;
102         bool __isSelected;
103         Color __linkColor;
104         Color __linkSelectedColor;
105         bool __isColorDefined;
106         bool __isEditable;
107         bool __isEdited;
108         Font* __pLinkFont;
109
110 private:
111         TextCutLink(const TextCutLink& other); // NOT IMPLMENTED
112
113         TextCutLink& operator =(const TextCutLink& rhs); // NOT IMPLMENTED
114
115 }; // TextCutLink
116
117 }}} // Tizen::Graphics::_Text
118
119 #endif // _FGRP_INTERNAL_TEXT_CUTLINK_H_