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_Keypad.h
19 * @brief This is the header file for the _Keypad class.
21 * This header file contains the declarations of the _Keypad class.
23 #ifndef _FUI_CTRL_INTERNAL_KEYPAD_H_
24 #define _FUI_CTRL_INTERNAL_KEYPAD_H_
26 #include <FUiCtrlEditTypes.h>
27 #include "FUi_Window.h"
28 #include "FUiCtrl_Button.h"
29 #include "FUiCtrl_Edit.h"
30 #include "FUiCtrl_IActionEventListener.h"
31 #include "FUiCtrl_IKeypadEventListener.h"
32 #include "FUiCtrl_ITextEventListener.h"
33 #include "FUiCtrl_TextEvent.h"
35 namespace Tizen { namespace Ui { namespace Controls
38 struct _KeypadStyleInfo
40 KeypadStyle keypadStyle;
41 bool textPredictionEnabled;
42 bool isNormalNumberStyle;
43 bool enterActionEnabled;
44 bool isLowerCaseModeEnabled;
47 class _OSP_EXPORT_ _Keypad
48 : virtual public Tizen::Base::Runtime::IEventListener
49 , virtual public Tizen::Ui::_IUiEventListener
50 , virtual public Tizen::Ui::_IUiEventPreviewer
51 , public Tizen::Ui::_Window
52 , public _IActionEventListener
53 , public _IKeypadEventListener
55 DECLARE_CLASS_BEGIN(_Keypad, _Control);
56 DECLARE_PROPERTY("singleLineEnabled", GetPropertySingleLineEnabled, SetPropertySingleLineEnabled);
57 DECLARE_PROPERTY("text", GetPropertyText, SetPropertyText);
60 result SetPropertySingleLineEnabled(const Tizen::Ui::Variant& enabled);
61 Tizen::Ui::Variant GetPropertySingleLineEnabled(void) const;
63 result SetPropertyText(const Tizen::Ui::Variant& text);
64 Tizen::Ui::Variant GetPropertyText(void) const;
67 static _Keypad* CreateKeypadN(void);
68 virtual ~_Keypad(void);
70 result Initialize(int editStyle, _KeypadStyleInfo styleInfo, int limitLength, _Edit* pCallerEdit = null);
71 virtual void OnDraw(void);
73 result SetSingleLineEnabled(bool enabled);
74 bool IsSingleLineEnabled(void) const;
76 Tizen::Base::String GetText(void) const;
77 void SetText(const Tizen::Base::String& text);
79 result AddTextEventListener(const _ITextEventListener& listener);
80 result RemoveTextEventListener(const _ITextEventListener& listener);
82 virtual result OnAttachedToMainTree(void);
83 virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
84 virtual void OnKeypadWillOpen(void);
85 virtual void OnKeypadOpened(void);
86 virtual void OnKeypadClosed(void);
87 virtual void OnKeypadBoundsChanged(void);
88 virtual void OnKeypadActionPerformed(CoreKeypadAction keypadAction);
89 virtual void OnChangeLayout(_ControlOrientation orientation);
90 virtual void OnNativeWindowActivated(void);
92 #if defined(MULTI_WINDOW)
93 virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
94 virtual bool IsLayoutChangable(void) const;
100 _Keypad(const _Keypad&);
101 _Keypad& operator =(const _Keypad&);
103 result Dispose(void);
104 result ChangeLayoutInternal(void);
105 Tizen::Graphics::Rectangle GetIndicatorBounds(void) const;
106 _Button* CreateButtonItemN(int actionId, const Tizen::Base::String& text);
107 _Toolbar* CreateHeaderForSIP(void);
110 bool __isInitialized;
111 bool __isSingleLineEnabled;
113 _Edit* __pCallerEdit;
115 _Toolbar* __pHeaderForSIP;
116 Tizen::Base::String __text;
117 _TextEvent* __pTextEvent;
118 bool __isCommandButtonPressed;
119 bool __isPredictionWindowOpendInUSBMode;
122 } } } // Tizen::Ui::Controls
123 #endif // _FUI_CTRL_INTERNAL_KEYPAD_H_