Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_LabelPresenter.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  * @file                FUiCtrl_LabelPresenter.h
19  * @brief               This is the header file for the _LabelPresenter class.
20  *
21  * This header file contains the declarations of the %_LabelPresenter class.
22  */
23 #ifndef _FUI_CTRL_INTERNAL_LABEL_PRESENTER_H_
24 #define _FUI_CTRL_INTERNAL_LABEL_PRESENTER_H_
25
26 #include <FBaseObject.h>
27 #include <FGrp_TextTextObject.h>
28 #include <FUiCtrlLabel.h>
29 #include "FUi_Control.h"
30
31 namespace Tizen { namespace Ui { namespace Animations
32 {
33 class _VisualElement;
34 }}} // Tizen::Ui::Animations
35
36 namespace Tizen { namespace Ui { namespace Controls
37 {
38 class _Label;
39 class _LabelModel;
40
41 /**
42  * @class _LabelPresenter
43  * @brief
44  * @since       1.0
45  *
46  *
47  *
48  *
49  */
50 class _LabelPresenter
51         : public Tizen::Base::Object
52 {
53 public:
54         _LabelPresenter(void);
55         virtual ~_LabelPresenter(void);
56
57 public:
58         virtual result Construct(const _Label& label);
59         virtual result Install(void);
60
61         void Draw(void);
62
63         void OnFontChanged(Tizen::Graphics::Font* pFont);
64         void OnFontInfoRequested(unsigned long& style, int& size);
65         void SetFontInfo(unsigned long style, int size);
66         result SetTextConfig(int size, LabelTextStyle style);
67         LabelTextStyle GetTextStyle(void) const;
68
69         virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
70         virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
71         virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
72         virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo);
73         virtual void OnTouchMoveHandled(const _Control& control);
74
75         Tizen::Graphics::_Text::TextObject* GetTextObject(void) const;
76         result InitTextObject(void);
77
78 protected:
79         result SetModel(const _LabelModel& labelModel);
80
81 private:
82         _LabelPresenter(const _LabelPresenter& rhs);
83         _LabelPresenter& operator =(const _LabelPresenter& rhs);
84
85         void DrawBackground(void);
86         void DrawText(void);
87         bool IsEnabledStateChanged(void);
88
89 private:
90         _Label* __pLabel;
91         _LabelModel* __pLabelModel;
92
93         bool __previousEnabledState;
94
95         Tizen::Graphics::Font* __pFont;
96         Tizen::Graphics::_Text::TextObject* __pTextObject;
97
98         Tizen::Ui::Animations::_VisualElement* __pBase;
99         LabelTextStyle __textStyle;
100         unsigned long __fontStyle;
101         int __fontSize;
102 }; // _LabelPresenter
103
104 }}} // Tizen::Ui::Controls
105
106 #endif  // _FUI_CTRL_INTERNAL_LABEL_PRESENTER_H_