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_Keypad.h
20 * @brief This is the header file for the _Keypad class.
22 * This header file contains the declarations of the _Keypad class.
24 #ifndef _FUI_CTRL_INTERNAL_KEYPAD_H_
25 #define _FUI_CTRL_INTERNAL_KEYPAD_H_
27 #include <FUiCtrlEditTypes.h>
28 #include "FUi_Window.h"
29 #include "FUiCtrl_Button.h"
30 #include "FUiCtrl_Edit.h"
31 #include "FUiCtrl_IActionEventListener.h"
32 #include "FUiCtrl_IKeypadEventListener.h"
33 #include "FUiCtrl_ITextEventListener.h"
34 #include "FUiCtrl_TextEvent.h"
36 namespace Tizen { namespace Ui { namespace Controls
39 struct _KeypadStyleInfo
41 KeypadStyle keypadStyle;
42 bool textPredictionEnabled;
43 bool isNormalNumberStyle;
44 bool enterActionEnabled;
45 bool isLowerCaseModeEnabled;
48 class _OSP_EXPORT_ _Keypad
49 : virtual public Tizen::Base::Runtime::IEventListener
50 , virtual public Tizen::Ui::_IUiEventListener
51 , virtual public Tizen::Ui::_IUiEventPreviewer
52 , public Tizen::Ui::_Window
53 , public _IActionEventListener
54 , public _IKeypadEventListener
56 DECLARE_CLASS_BEGIN(_Keypad, _Control);
57 DECLARE_PROPERTY("singleLineEnabled", GetPropertySingleLineEnabled, SetPropertySingleLineEnabled);
58 DECLARE_PROPERTY("text", GetPropertyText, SetPropertyText);
61 result SetPropertySingleLineEnabled(const Tizen::Ui::Variant& enabled);
62 Tizen::Ui::Variant GetPropertySingleLineEnabled(void) const;
64 result SetPropertyText(const Tizen::Ui::Variant& text);
65 Tizen::Ui::Variant GetPropertyText(void) const;
68 static _Keypad* CreateKeypadN(void);
69 virtual ~_Keypad(void);
71 result Initialize(int editStyle, _KeypadStyleInfo styleInfo, int limitLength, _Edit* pCallerEdit = null);
72 virtual void OnDraw(void);
74 result SetSingleLineEnabled(bool enabled);
75 bool IsSingleLineEnabled(void) const;
77 Tizen::Base::String GetText(void) const;
78 void SetText(const Tizen::Base::String& text);
79 void SetEditTextFilter(IEditTextFilter* pFilter);
80 void SendOpaqueCommand (const Tizen::Base::String& command);
82 result AddTextEventListener(const _ITextEventListener& listener);
83 result RemoveTextEventListener(const _ITextEventListener& listener);
85 virtual result OnAttachedToMainTree(void);
86 virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
87 virtual void OnKeypadWillOpen(void);
88 virtual void OnKeypadOpened(void);
89 virtual void OnKeypadClosed(void);
90 virtual void OnKeypadBoundsChanged(void);
91 virtual void OnKeypadActionPerformed(CoreKeypadAction keypadAction);
92 virtual void OnChangeLayout(_ControlOrientation orientation);
93 virtual void OnNativeWindowActivated(void);
97 _Keypad(const _Keypad&);
98 _Keypad& operator =(const _Keypad&);
100 result Dispose(void);
101 result ChangeLayoutInternal(void);
102 Tizen::Graphics::FloatRectangle GetIndicatorBounds(void) const;
103 _Button* CreateButtonItemN(int actionId, const Tizen::Base::String& text);
104 _Button* CreateFooterBackButton(_Toolbar* pFooter);
105 _Toolbar* CreateFooter(void);
108 bool __isInitialized;
109 bool __isSingleLineEnabled;
111 _Edit* __pCallerEdit;
114 Tizen::Base::String __text;
115 _TextEvent* __pTextEvent;
116 bool __isCommandButtonPressed;
117 bool __isPredictionWindowOpendInUSBMode;
120 } } } // Tizen::Ui::Controls
121 #endif // _FUI_CTRL_INTERNAL_KEYPAD_H_