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_TextTextUtility.h
20 * @brief This file contains the declarations of TextUtility class.
23 #ifndef _FGRP_INTERNAL_TEXT_UTILITY_H_
24 #define _FGRP_INTERNAL_TEXT_UTILITY_H_
26 #include "../FGrp_Font.h"
27 #include "FGrp_TextCommon.h"
29 namespace Tizen { namespace Graphics
41 static TextElementType GetObjectTypeFromValueType(TextComponentInfoValueType type);
43 static bool CanMerge(TextElement* pCurrentTextElement, TextElement* pNextTextElement);
45 static bool IsSameFontAttribute(const Font* pFontSrc, const Font* pFontTarget);
47 static int GetFontMaxHeight(Font* pFont);
49 static int GetFontMaxHeight(_Font* pFont);
51 static int GetTextLength(const wchar_t* pText);
53 static int GetCharCountInWidth(_Font* pFont, const wchar_t* pText, int textLength, int maxWidth, bool outline, int& width, int& height);
55 static result GetTextExtent(_Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height);
57 static result GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height);
59 static result CopyText(wchar_t* pDstText, const wchar_t* pSrcText, int textLength);
61 static result CopyText(wchar_t* pDstText, const wchar_t* pSrcText);
63 static result DrawText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength);
65 static result DrawOutlineText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength, Color outlineColor);
69 }}} // Tizen::Graphics::_Text
71 #endif // _FGRP_INTERNAL_TEXT_UTILITY_H_