Tizen 2.1 base
[framework/osp/uifw.git] / src / graphics / text / FGrp_TextTextUtility.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_TextTextUtility.h
20  * @brief       This file contains the declarations of TextUtility class.
21  */
22
23 #ifndef _FGRP_INTERNAL_TEXT_UTILITY_H_
24 #define _FGRP_INTERNAL_TEXT_UTILITY_H_
25
26 #include "../FGrp_Font.h"
27 #include "FGrp_TextCommon.h"
28
29 namespace Tizen { namespace Graphics
30 {
31
32 namespace _Text
33 {
34
35 class TextElement;
36 class TextSimple;
37
38 class TextUtility
39 {
40 public:
41         static TextElementType GetObjectTypeFromValueType(TextComponentInfoValueType type);
42
43         static bool CanMerge(TextElement* pCurrentTextElement, TextElement* pNextTextElement);
44
45         static bool IsSameFontAttribute(const Font* pFontSrc, const Font* pFontTarget);
46
47         static int GetFontMaxHeight(Font* pFont);
48
49         static int GetFontMaxHeight(_Font* pFont);
50
51         static int GetTextLength(const wchar_t* pText);
52
53         static int GetCharCountInWidth(_Font* pFont, const wchar_t* pText, int textLength, int maxWidth, bool outline, int& width, int& height);
54
55         static result GetTextExtent(_Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height);
56
57         static result GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height);
58
59         static result CopyText(wchar_t* pDstText, const wchar_t* pSrcText, int textLength);
60
61         static result CopyText(wchar_t* pDstText, const wchar_t* pSrcText);
62
63         static result DrawText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength);
64
65         static result DrawOutlineText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength, Color outlineColor);
66
67 }; // TextUtility
68
69 }}} // Tizen::Graphics::_Text
70
71 #endif // _FGRP_INTERNAL_TEXT_UTILITY_H_