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.
19 * @file FUiCtrl_InputPadPresenter.h
20 * @brief This is the header file for the _InputPadPresenter class.
22 * This header file contains the declarations of the %_InputPadPresenter class.
25 #ifndef _FUI_CTRL_INTERNAL_INPUTPAD_PRESENTER_H_
26 #define _FUI_CTRL_INTERNAL_INPUTPAD_PRESENTER_H_
28 #include <FGrp_TextTextObject.h>
30 #include "FUi_Control.h"
31 #include "FUiCtrl_IInputPadEventListener.h"
32 #include "FUiCtrl_DateTimeDefine.h"
34 namespace Tizen { namespace Graphics {
38 namespace Tizen { namespace Ui { namespace Controls
43 class _InputPadPresenter
44 : public Tizen::Base::Object
47 _InputPadPresenter(_InputPad* pInputPad);
48 virtual ~_InputPadPresenter(void);
50 result Construct(const Tizen::Graphics::Rectangle& bounds);
52 result LoadProperties(Tizen::Ui::_ControlOrientation orientation);
53 result LoadResource(void);
54 result InitializeTextObjects(void);
56 void SetInputPadEventListener(const _IInputPadEventListener& listener);
57 result SetInputPadStyle(const _InputPadStyle style);
59 _InputPadStyle GetInputPadStyle(void) const;
60 Tizen::Graphics::Rectangle GetButtonBounds(int index) const;
61 int GetReturnValue(int index) const;
65 void EnableLayoutChangedFlag(void);
67 void SetFont(Tizen::Graphics::Font* pFont);
69 virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
70 virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
71 virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
74 result DrawAllButtons(Tizen::Graphics::Canvas& canvas);
75 result DrawButton(Tizen::Graphics::Canvas& canvas, int index);
76 result RefreshButton(int index);
77 int GetIndexFromTouchedPosition(const Tizen::Graphics::Point& point) const;
79 _InputPadPresenter(const _InputPadPresenter&);
80 _InputPadPresenter& operator =(const _InputPadPresenter&);
83 _InputPad* __pInputPad;
84 _IInputPadEventListener* __pInputPadEventListener;
86 Tizen::Graphics::Font* __pFont;
88 Tizen::Graphics::Bitmap* __pKeypadBackgroundBitmap;
90 Tizen::Graphics::Bitmap* __pKeypadButtonNormalPlainBitmap;
91 Tizen::Graphics::Bitmap* __pKeypadButtonPressedPlainBitmap;
93 Tizen::Graphics::Bitmap* __pKeypadButtonNormalEffectBitmap;
94 Tizen::Graphics::Bitmap* __pKeypadButtonPressedEffectBitmap;
96 Tizen::Graphics::_Text::TextObject __textObject;
97 Tizen::Graphics::_Text::TextObject __guideTextObject;
99 _InputPadStyle __inputPadStyle;
109 bool __isLayoutChanged;
111 static const int INPUTPAD_BUTTON_MAX = 12;
112 static const int INPUTPAD_BUTTON_COLUMN_MAX = 3;
113 static const int INPUTPAD_BUTTON_ROW_MAX = 4;
115 static const int INPUTPAD_NUMBER_1 = 0;
116 static const int INPUTPAD_NUMBER_9 = 8;
117 static const int INPUTPAD_NUMBER_0 = 10;
118 }; // _InputPadPresenter
120 }}} // Tizen::Ui::Controls
122 #endif // _FUI_CTRL_INTERNAL_INPUTPAD_PRESENTER_H_