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.h
20 * @brief This is the header file for the TextElement class.
22 * This header file contains the declarations of the %TextElement class.
25 #ifndef _FGRP_INTERNAL_TEXT_COMPONENT_H_
26 #define _FGRP_INTERNAL_TEXT_COMPONENT_H_
29 #include <FBaseObject.h>
30 #include "FGrp_TextCommon.h"
32 namespace Tizen { namespace Graphics
39 class _OSP_EXPORT_ TextElement
40 : public Tizen::Base::Object
45 virtual ~TextElement(void);
48 virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
49 int& actualLength, int& width, int& height);
51 virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex,
52 int textLength, const TextObjectAlignment alignment, const TextObjectActionType action);
54 virtual TextElement* CloneN(TextComponentInfoValueType type, unsigned int value);
56 virtual TextElement* CopyN(int textStart, int textLength);
58 virtual void CopyMembers(TextElement* pTargetTextElement);
60 virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const;
62 virtual result GetBlockRegion(int textIndex, int textLength, int& width, int& height) const;
64 virtual int GetHeight(void) const;
66 virtual int GetTextLength(void) const;
68 virtual void SetTextLength(int length);
70 virtual unsigned int GetValue(TextComponentInfoValueType type) const;
72 virtual result SetValue(TextComponentInfoValueType type, unsigned int value);
74 virtual TextElementType GetType(void) const;
76 virtual TextElementSourceType GetSourceType(void) const;
78 virtual bool SetFocused(bool hasFocus);
80 virtual bool GetFocused(void) const;
82 virtual void SetAlternateLookEnabled(bool enable);
84 virtual bool IsAlternateLookEnabled(void) const;
86 virtual void SetAlternativeForegroundColor(const Color& foregroundColor);
88 virtual Color GetAlternativeForegroundColor(void) const;
90 virtual int GetBaseline(void) const;
92 virtual void SetForegroundColor(const Color& color);
94 virtual Color GetForegroundColor(void) const;
96 virtual void SetBackgroundColor(const Color& color);
98 virtual Color GetBackgroundColor(void) const;
100 virtual void SetBackGroundDrawingModeEnabled(bool enable);
102 virtual bool IsBackGroundDrawingModeEnable(void) const;
105 TextElementType _type;
106 TextElementSourceType _sourceType;
107 Color _alternativeColor;
110 bool _isAlternateLookEnabled;
113 TextElement(const TextElement& other); // NOT IMPLMENTED
115 TextElement& operator =(const TextElement& rhs); // NOT IMPLMENTED
119 }}} // Tizen::Graphics::_Text
121 #endif // _FGRP_INTERNAL_TEXT_COMPONENT_H_