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.
18 * @file FUiCtrl_Label.h
19 * @brief This is the header file for the _Label class.
21 * This header file contains the declarations of the %_Label class.
23 #ifndef _FUI_CTRL_INTERNAL_LABEL_H_
24 #define _FUI_CTRL_INTERNAL_LABEL_H_
26 #include <FUiCtrlLabel.h>
27 #include "FUi_Control.h"
29 namespace Tizen { namespace Ui
31 class _AccessibilityElement;
34 namespace Tizen { namespace Ui { namespace Controls
36 class _LabelPresenter;
48 class _OSP_EXPORT_ _Label
49 : public Tizen::Ui::_Control
50 , virtual public Tizen::Base::Runtime::IEventListener
51 , virtual public Tizen::Ui::_IUiEventListener
52 , virtual public Tizen::Ui::_IUiEventPreviewer
54 DECLARE_CLASS_BEGIN(_Label, _Control);
55 DECLARE_PROPERTY("text", GetPropertyText, SetPropertyText);
56 DECLARE_PROPERTY("textColor", GetPropertyTextColor, SetPropertyTextColor);
57 DECLARE_PROPERTY("textSize", GetPropertyTextSize, SetPropertyTextSize);
60 result SetPropertyText(const Variant& text);
61 Variant GetPropertyText(void) const;
62 result SetPropertyTextColor(const Variant& color);
63 Variant GetPropertyTextColor(void) const;
64 result SetPropertyTextSize(const Variant& textSize);
65 Variant GetPropertyTextSize(void) const;
68 virtual ~_Label(void);
71 static _Label* CreateLabelN(void);
73 virtual void OnDraw(void);
74 virtual result OnAttachedToMainTree(void);
75 virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
76 virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
77 virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
78 virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo);
79 virtual void OnTouchMoveHandled(const _Control& control);
80 virtual void OnBoundsChanged(void);
81 virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
82 virtual void OnFontInfoRequested(unsigned long& style, int& size);
83 virtual Tizen::Graphics::Dimension GetContentSize(void) const;
84 virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const;
87 result SetText(const Tizen::Base::String& text);
88 Tizen::Base::String GetText(void) const;
90 result SetTextConfig(int size, LabelTextStyle style);
91 result SetTextConfig(float size, LabelTextStyle style);
92 int GetTextSize(void) const;
93 float GetTextSizeF(void) const;
94 LabelTextStyle GetTextStyle(void) const;
96 result SetTextHorizontalAlignment(HorizontalAlignment alignment);
97 HorizontalAlignment GetTextHorizontalAlignment(void) const;
98 result SetTextVerticalAlignment(VerticalAlignment alignment);
99 VerticalAlignment GetTextVerticalAlignment(void) const;
101 result SetTextColor(const Tizen::Graphics::Color& color);
102 Tizen::Graphics::Color GetTextColor(void) const;
104 result SetBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
105 Tizen::Graphics::Bitmap* GetBackgroundBitmap(void) const;
107 result SetBackgroundEffectBitmap(const Tizen::Graphics::Bitmap& bitmap);
108 Tizen::Graphics::Bitmap* GetBackgroundEffectBitmap(void) const;
110 unsigned long GetFontStyle(void) const;
112 result SetMargin(int topMargin, int leftMargin);
113 result SetMargin(int leftMargin, int topMargin, int rightMargin, int bottomMargin);
114 int GetLeftMargin(void) const;
115 int GetTopMargin(void) const;
116 int GetRightMargin(void) const;
117 int GetBottomMargin(void) const;
119 result SetMargin(float topMargin, float leftMargin);
120 result SetMargin(float leftMargin, float topMargin, float rightMargin, float bottomMargin);
121 float GetLeftMarginF(void) const;
122 float GetTopMarginF(void) const;
123 float GetRightMarginF(void) const;
124 float GetBottomMarginF(void) const;
126 Tizen::Graphics::FloatDimension GetContentSizeInternalF(void) const;
129 result SetPresenter(const _LabelPresenter& labelPresenter);
132 void InitializeAccessibilityElement(void);
135 _Label(const _Label& rhs);
136 _Label& operator =(const _Label& rhs);
139 _LabelPresenter* __pLabelPresenter;
141 Tizen::Base::String __text;
144 HorizontalAlignment __horizontalAlignment;
145 VerticalAlignment __verticalAlignment;
147 Tizen::Graphics::Color __textColor;
149 Tizen::Graphics::Bitmap* __pBackgroundBitmap;
150 Tizen::Graphics::Bitmap* __pBackgroundEffectBitmap;
155 float __bottomMargin;
157 Tizen::Ui::_AccessibilityElement* __pTextElement;
159 static const float SENSITIVE = 0.08f;
162 }}} // Tizen::Ui::Controls
164 #endif // _FUI_CTRL_INTERNAL_LABEL_H_