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;
86 result SetText(const Tizen::Base::String& text);
87 Tizen::Base::String GetText(void) const;
89 result SetTextConfig(int size, LabelTextStyle style);
90 int GetTextSize(void) const;
91 LabelTextStyle GetTextStyle(void) const;
93 result SetTextHorizontalAlignment(HorizontalAlignment alignment);
94 HorizontalAlignment GetTextHorizontalAlignment(void) const;
95 result SetTextVerticalAlignment(VerticalAlignment alignment);
96 VerticalAlignment GetTextVerticalAlignment(void) const;
98 result SetTextColor(const Tizen::Graphics::Color& color);
99 Tizen::Graphics::Color GetTextColor(void) const;
101 result SetBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
102 Tizen::Graphics::Bitmap* GetBackgroundBitmap(void) const;
104 result SetBackgroundEffectBitmap(const Tizen::Graphics::Bitmap& bitmap);
105 Tizen::Graphics::Bitmap* GetBackgroundEffectBitmap(void) const;
107 unsigned long GetFontStyle(void) const;
109 result SetMargin(int topMargin, int leftMargin);
110 int GetTopMargin(void) const;
111 int GetLeftMargin(void) const;
113 Tizen::Graphics::Dimension GetContentSizeInternal(void) const;
116 result SetPresenter(const _LabelPresenter& labelPresenter);
119 void InitializeAccessibilityElement(void);
122 _Label(const _Label& rhs);
123 _Label& operator =(const _Label& rhs);
126 _LabelPresenter* __pLabelPresenter;
128 Tizen::Base::String __text;
131 HorizontalAlignment __horizontalAlignment;
132 VerticalAlignment __verticalAlignment;
134 Tizen::Graphics::Color __textColor;
136 Tizen::Graphics::Bitmap* __pBackgroundBitmap;
137 Tizen::Graphics::Bitmap* __pBackgroundEffectBitmap;
142 Tizen::Ui::_AccessibilityElement* __pTextElement;
145 }}} // Tizen::Ui::Controls
147 #endif // _FUI_CTRL_INTERNAL_LABEL_H_