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_TextTextSimple.h
20 * @brief This is the header file for the TextSimple class.
22 * This header file contains the declarations of the TextSimple class.
25 #ifndef _FGRP_INTERNAL_TEXT_SIMPLE_H_
26 #define _FGRP_INTERNAL_TEXT_SIMPLE_H_
29 #include "FGrp_TextCommon.h"
30 #include "FGrp_TextTextElement.h"
32 namespace Tizen { namespace Graphics
47 class _OSP_EXPORT_ TextSimple
51 TextSimple(const wchar_t* pText, int length, TextElementSourceType sourceType = TEXT_ELEMENT_SOURCE_TYPE_INTERNAL, Font* pFont = null,
52 const Color& foregroundColor = Color::GetColor(COLOR_ID_BLACK), const Color& backgroundColor = Color::GetColor(COLOR_ID_WHITE),
53 const Color& outlineColor = 0);
55 virtual ~TextSimple(void);
58 virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength,
59 const TextObjectAlignment alignment, const TextObjectActionType action);
61 virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
62 int& actualLength, int& width, int& height);
64 virtual TextElement* CloneN(TextComponentInfoValueType type, unsigned int value);
66 virtual TextElement* CopyN(int startTextIndex, int textLength);
68 virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const;
70 virtual result GetBlockRegion(int textIndex, int textLength, int& width, int& height) const;
72 virtual int GetHeight(void) const;
74 virtual unsigned int GetValue(TextComponentInfoValueType type) const;
76 virtual result SetValue(TextComponentInfoValueType type, unsigned int value);
78 virtual result ChangeTextOffset(wchar_t* pText, int gap);
80 virtual result SetTextOffset(int offset);
82 virtual int GetBaseline(void) const;
84 int GetTextOffset(void) const;
86 result SetFont(const Font* pFont);
88 const Font* GetFont(void) const;
90 virtual void SetForegroundColor(const Color& color);
92 virtual Color GetForegroundColor(void) const;
94 virtual void SetBackgroundColor(const Color& color);
96 virtual Color GetBackgroundColor(void) const;
98 void SetOutlineColor(const Color& color);
100 Color GetOutlineColor(void) const;
102 virtual void SetBackGroundDrawingModeEnabled(bool enable);
104 virtual bool IsBackGroundDrawingModeEnable(void) const;
106 const wchar_t* GetTextSource(void) const;
108 const wchar_t* GetText(void) const;
110 bool IsSame(wchar_t* pText, Font* pFont, const Color& foregroundColor,
111 const Color& backgroundColor, const Color& outlineColor);
113 void SetUserWrap(TextObjectWrapType userWrap);
115 int GetWordLength(int textIndex, int& wordLength) const;
117 result SetBitmap(const Bitmap& bitmap);
119 const Bitmap* GetBitmap(void) const;
122 static int ConvertEnterToSpace(wchar_t* pDstText, const wchar_t* pSrcText, int textLength);
124 bool IsKorean(const wchar_t* ch) const;
126 bool IsChinese(const wchar_t* ch) const;
128 int GetSentenceLength(const wchar_t* pText, int textLength, int& actualLength) const;
130 int GetWordWrapLength(const wchar_t* pText, int textLength, int& actualLength) const;
132 int GetWordWrapLengthEx(const wchar_t* pText, int textLength, int& actualLength) const;
135 virtual Font* GetCurrentFont(void) const;
137 virtual Color GetCurrentForegroundColor(void) const;
139 virtual Color GetCurrentBackgroundColor(void) const;
141 virtual Color GetCurrentOutlineColor(void) const;
144 const wchar_t* _pText;
146 TextObjectWrapType _userWrap;
147 Color _foregroundColor;
148 Color _backgroundColor;
152 bool _isBackgroundDrawingModeEnabled;
155 const Bitmap* __pBitmap;
158 TextSimple(const TextSimple& other); // NOT IMPLMENTED
160 TextSimple& operator =(const TextSimple& rhs); // NOT IMPLMENTED
164 }}} // Tizen::Graphics::_Text
166 #endif // _FGRP_INTERNAL_TEXT_SIMPLE_H_