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_ButtonPresenter.h
19 * @brief This is the header file for the _ButtonPresenter class.
21 * This header file contains the declarations of the %_ButtonPresenter class.
23 #ifndef _FUI_CTRL_INTERNAL_BUTTON_PRESENTER_H_
24 #define _FUI_CTRL_INTERNAL_BUTTON_PRESENTER_H_
26 #include <FBaseObject.h>
27 #include <FGrp_TextTextObject.h>
28 #include "FUi_Control.h"
30 namespace Tizen { namespace Ui { namespace Animations
33 }}} // Tizen::Ui::Animations
35 namespace Tizen { namespace Ui { namespace Controls
41 * @class _ButtonPresenter
49 class _ButtonPresenter
50 : public Tizen::Base::Object
53 _ButtonPresenter(void);
54 virtual ~_ButtonPresenter(void);
57 virtual result Construct(const _Button& button);
58 virtual result Install(void);
60 virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
61 virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
62 virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
63 virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo);
64 virtual void OnTouchMoveHandled(const _Control& control);
68 void OnFontChanged(Tizen::Graphics::Font* pFont);
69 void OnFontInfoRequested(unsigned long& style, int& size);
70 void SetTextSize(int size, unsigned long fontStyle = Tizen::Graphics::FONT_STYLE_PLAIN);
71 void SetFontInfo(unsigned long style, int size);
73 Tizen::Graphics::_Text::TextObject* GetTextObject(void) const;
74 result InitTextObject(void);
77 result SetModel(const _ButtonModel& buttonModel);
80 _ButtonPresenter(const _ButtonPresenter& rhs);
81 _ButtonPresenter& operator =(const _ButtonPresenter& rhs);
83 void DrawBackground(void);
84 void DrawToolbarItemBackground(void);
85 void DrawBitmap(void);
87 void DrawToolbarSelectedBitmap(void);
89 bool IsEnabledStateChanged(void);
93 _ButtonModel* __pButtonModel;
95 bool __previousEnabledState;
96 bool __touchMoveHandled;
98 Tizen::Graphics::Font* __pFont;
99 Tizen::Graphics::_Text::TextObject* __pTextObject;
101 Tizen::Ui::Animations::_VisualElement* __pBase;
102 unsigned long __fontStyle;
104 }; // _ButtonPresenter
106 }}} // Tizen::Ui::Controls
108 #endif // _FUI_CTRL_INTERNAL_BUTTON_PRESENTER_H_