Tizen 2.1 base
[framework/osp/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 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_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         bool GetEditable(void) const;
68
69         void SetEditModeEnable(bool enable);
70
71         bool IsEditModeEnable(void) const;
72
73         Tizen::Base::Utility::LinkType GetCutLinkType(void) const;
74
75         void SetSelect(bool isSelected);
76
77         bool GetSelect(void) const;
78
79         void SetUserColor(const Color& color, const Color& colorInSelect);
80
81         void ResetUserColor(void);
82
83 private:
84         virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align,
85                                                 const TextObjectActionType action);
86
87         virtual Font* GetCurrentFont(void) const;
88
89         virtual Color GetCurrentForegroundColor(void) const;
90
91         virtual Color GetCurrentBackgroundColor(void) const;
92
93         virtual Color GetCurrentOutlineColor(void) const;
94
95 private:
96         Tizen::Base::Utility::LinkType __linkType;
97         bool __isSelected;
98         Color __linkColor;
99         Color __linkSelectedColor;
100         bool __isColorDefined;
101         bool __isEditable;
102         bool __isEdited;
103         Font* __pLinkFont;
104
105 private:
106         TextCutLink(const TextCutLink& other); // NOT IMPLMENTED
107
108         TextCutLink& operator =(const TextCutLink& rhs); // NOT IMPLMENTED
109
110 }; // TextCutLink
111
112 }}} // Tizen::Graphics::_Text
113
114 #endif // _FGRP_INTERNAL_TEXT_CUTLINK_H_