Tizen 2.1 base
[framework/osp/uifw.git] / src / graphics / inc / FGrp_TextTextImage.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_TextTextImage.h
20  * @brief       This is the header file for the TextImage class.
21  *
22  * This header file contains the declarations of the %TextImage class.
23  */
24
25 #ifndef _FGRP_INTERNAL_TEXT_IMAGE_H_
26 #define _FGRP_INTERNAL_TEXT_IMAGE_H_
27
28 // Includes
29 #include "FGrp_TextCommon.h"
30 #include "FGrp_TextTextElement.h"
31
32 namespace Tizen { namespace Graphics
33 {
34 class Bitmap;
35
36 class _CanvasImpl;
37
38 namespace _Text
39 {
40
41 /**
42  * @class TextImage
43  * @brief
44  * @since       2.0
45  */
46 class _OSP_EXPORT_ TextImage
47         : public TextElement
48 {
49 public:
50         TextImage(Bitmap& bitmap, TextElementSourceType sourceType = TEXT_ELEMENT_SOURCE_TYPE_INTERNAL, Rectangle* pRect = null,
51                         TextObjectAlignment align = TextObjectAlignment(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP));
52
53         virtual ~TextImage(void);
54
55 public:
56         virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
57                                         int& actualLength, int& width, int& height);
58
59         virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength,
60                         const TextObjectAlignment align, const TextObjectActionType action);
61
62         virtual TextElement* CloneN(TextComponentInfoValueType type, unsigned int value);
63
64         virtual TextElement* CopyN(int textStart, int textLength);
65
66         virtual result GetRegion(int textIndex, int startTextIndex, int& width, int& height) const;
67
68         virtual result GetBlockRegion(int textIndex, int textLength, int& width, int& height) const;
69
70         virtual int GetHeight(void) const;
71
72         virtual result SetValue(TextComponentInfoValueType type, unsigned int value);
73
74         virtual unsigned int GetValue(TextComponentInfoValueType type) const;
75
76         virtual void SetTextLength(int length);
77
78         virtual int GetBaseline(void) const;
79
80         result SetBounds(const Rectangle& rect);
81
82         Rectangle GetBounds(void) const;
83
84         result SetAlignment(TextObjectAlignment alignment);
85
86         TextObjectAlignment GetAlignment(void) const;
87
88         const Bitmap* GetBitmap(void) const;
89
90 private:
91         Bitmap* __pBitmap;
92         Rectangle __rect;
93         TextObjectAlignment __align;
94
95 private:
96         TextImage(void); // NOT IMPLMENTED
97
98         TextImage(const TextImage& other); // NOT IMPLMENTED
99
100         TextImage& operator =(const TextImage& rhs); // NOT IMPLMENTED
101
102 }; // TextImage
103
104 }}} // Tizen::Graphics::_Text
105
106 #endif // _FGRP_INTERNAL_TEXT_IMAGE_H_