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_ButtonImpl.h
19 * @brief This is the header file for the _ButtonImpl class.
21 * This header file contains the declarations of the %_ButtonImpl class.
23 #ifndef _FUI_CTRL_INTERNAL_BUTTON_IMPL_H_
24 #define _FUI_CTRL_INTERNAL_BUTTON_IMPL_H_
26 #include <FUiCtrlButton.h>
27 #include <FGrpColor.h>
28 #include "FUi_ControlImpl.h"
29 #include "FUiCtrl_Button.h"
30 #include "FUiCtrl_IActionEventListener.h"
31 #include "FUiCtrl_PublicActionEvent.h"
33 namespace Tizen { namespace Graphics
38 namespace Tizen { namespace Ui { namespace Controls
43 , public _IActionEventListener
44 , virtual public Tizen::Base::Runtime::IEventListener
47 class ButtonSizeInfo : public _ControlImpl::SizeInfo
49 virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const;
50 virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const;
54 virtual ~_ButtonImpl(void);
55 static _ButtonImpl* CreateButtonImplN(Button* pControl, const Tizen::Graphics::Rectangle& bounds);
56 static _ButtonImpl* CreateButtonImplN(Button* pControl, const Tizen::Graphics::FloatRectangle& bounds);
58 virtual const char* GetPublicClassName(void) const;
59 virtual const Button& GetPublic(void) const;
60 virtual Button& GetPublic(void);
61 virtual const _Button& GetCore(void) const;
62 virtual _Button& GetCore(void);
65 result SetText(const Tizen::Base::String& text);
66 Tizen::Base::String GetText(void) const;
68 result SetColor(ButtonStatus status, const Tizen::Graphics::Color& color);
69 Tizen::Graphics::Color GetColor(ButtonStatus status) const;
71 result AddActionEventListener(Tizen::Ui::IActionEventListener& listener);
72 result RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener);
74 result SetActionId(int actionId);
75 int GetActionId(void) const;
77 result SetTextHorizontalAlignment(HorizontalAlignment alignment);
78 HorizontalAlignment GetTextHorizontalAlignment(void) const;
79 result SetTextVerticalAlignment(VerticalAlignment alignment);
80 VerticalAlignment GetTextVerticalAlignment(void) const;
82 result SetTextColor(const Tizen::Graphics::Color& color);
83 Tizen::Graphics::Color GetTextColor(void) const;
84 result SetDisabledTextColor(const Tizen::Graphics::Color& color);
85 Tizen::Graphics::Color GetDisabledTextColor(void) const;
86 result SetPressedTextColor(const Tizen::Graphics::Color& color);
87 Tizen::Graphics::Color GetPressedTextColor(void) const;
88 result SetHighlightedTextColor(const Tizen::Graphics::Color& color);
89 Tizen::Graphics::Color GetHighlightedTextColor(void) const;
91 result SetNormalBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap);
92 result SetDisabledBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap);
93 result SetPressedBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap);
94 result SetHighlightedBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap);
96 result SetNormalBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap);
97 result SetDisabledBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap);
98 result SetPressedBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap);
99 result SetHighlightedBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap);
101 result SetNormalBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
102 result SetDisabledBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
103 result SetPressedBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
104 result SetHighlightedBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
106 result SetTextSize(int size);
107 int GetTextSize(void) const;
109 result SetTextSize(float size);
110 float GetTextSizeF(void) const;
112 virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
113 virtual result OnAttachedToMainTree(void);
115 virtual bool OnTouchPressed(const _ControlImpl& source, const _TouchInfo& touchinfo);
116 virtual bool OnTouchReleased(const _ControlImpl& source, const _TouchInfo& touchinfo);
117 virtual bool OnTouchMoved(const _ControlImpl& source, const _TouchInfo& touchinfo);
118 virtual bool OnTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchinfo);
120 virtual Tizen::Graphics::Dimension GetContentSize(void) const;
121 virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const;
124 static const Tizen::Graphics::Color GetColorOnError(void);
126 static _ButtonImpl* GetInstance(Button& button);
127 static const _ButtonImpl* GetInstance(const Button& button);
130 _ButtonStatus ConvertStatus(ButtonStatus status) const;
133 _ButtonImpl(Button* pPublic, _Button* pCore);
135 _ButtonImpl(const _ButtonImpl& rhs);
136 _ButtonImpl& operator =(const _ButtonImpl& rhs);
138 _PublicActionEvent* __pPublicActionEvent;
142 }}} // Tizen::Ui::Controls
144 #endif //_FUI_CTRL_INTERNAL_BUTTON_IMPL_H_