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_TextTextElement.cpp
20 * @brief This is the implementation file for TextElement class.
24 #include <FBaseSysLog.h>
25 #include "FGrp_TextTextElement.h"
27 namespace Tizen { namespace Graphics
33 TextElement::TextElement(void)
35 _type = TEXT_ELEMENT_TYPE_NONE;
36 _sourceType = TEXT_ELEMENT_SOURCE_TYPE_INTERNAL;
39 _isAlternateLookEnabled = false;
40 _alternativeColor = Color::GetColor(COLOR_ID_GREY);
43 TextElement::~TextElement(void)
49 TextElement::CopyMembers(TextElement* pTargetTextElement)
53 , , E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
55 pTargetTextElement->SetFocused(_hasFocus);
56 pTargetTextElement->SetAlternateLookEnabled(_isAlternateLookEnabled);
57 pTargetTextElement->SetAlternativeForegroundColor(_alternativeColor);
61 TextElement::SetTextLength(int length)
67 TextElement::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
68 int& actualLength, int& width, int& height)
74 TextElement::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex,
75 int textLength, const TextObjectAlignment alignment, const TextObjectActionType action)
81 TextElement::CloneN(TextComponentInfoValueType type, unsigned int value)
87 TextElement::CopyN(int textStart, int textLength)
93 TextElement::GetRegion(int textIndex, int textLength, int& width, int& height) const
99 TextElement::GetBlockRegion(int textIndex, int textLength, int& width, int& height) const
105 TextElement::GetHeight(void) const
111 TextElement::GetTextLength(void) const
117 TextElement::GetValue(TextComponentInfoValueType type) const
123 TextElement::SetValue(TextComponentInfoValueType type, unsigned int value)
129 TextElement::GetType(void) const
134 TextElementSourceType
135 TextElement::GetSourceType(void) const
141 TextElement::SetFocused(bool hasFocus)
143 _hasFocus = hasFocus;
148 TextElement::GetFocused(void) const
154 TextElement::SetAlternateLookEnabled(bool enable)
156 _isAlternateLookEnabled = enable;
160 TextElement::IsAlternateLookEnabled(void) const
162 return _isAlternateLookEnabled;
166 TextElement::SetAlternativeForegroundColor(const Color& foregroundColor)
168 _alternativeColor = foregroundColor;
172 TextElement::GetAlternativeForegroundColor(void) const
174 return _alternativeColor;
178 TextElement::GetBaseline(void) const
183 TextElement::SetForegroundColor(const Color& color)
189 TextElement::GetForegroundColor(void) const
191 return Color::GetColor(COLOR_ID_BLACK);
195 TextElement::SetBackgroundColor(const Color& color)
201 TextElement::GetBackgroundColor(void) const
203 return Color::GetColor(COLOR_ID_WHITE);
207 TextElement::SetBackGroundDrawingModeEnabled(bool enable)
213 TextElement::IsBackGroundDrawingModeEnable(void) const
218 }}} // Tizen::Graphics::_Text