Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_KeypadImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17 /**
18 * @file                 FUiCtrl_KeypadImpl.h
19 * @brief                This is the header file for the _KeypadImpl class.
20 *
21 * This header file contains the declarations of the _KeypadImpl class.
22 */
23
24 #ifndef _FUI_CTRL_INTERNAL_KEYPAD_IMPL_H_
25 #define _FUI_CTRL_INTERNAL_KEYPAD_IMPL_H_
26
27 #include <FUiCtrlKeypad.h>
28 #include "FUi_WindowImpl.h"
29 #include "FUiCtrl_ITextEventListener.h"
30 #include "FUiCtrl_Keypad.h"
31
32 namespace Tizen { namespace Base { namespace Runtime
33 {
34 class IEvent;
35 }}} // Tizen::Base::Runtime
36
37 namespace Tizen { namespace  Ui { namespace Controls
38 {
39 class _PublicTextEvent;
40
41 class _KeypadImpl
42         : virtual public Tizen::Base::Runtime::IEventListener
43         , public _WindowImpl
44         , public _ITextEventListener
45 {
46
47 public:
48         virtual ~_KeypadImpl(void);
49
50         static _KeypadImpl* CreateKeypadImplN(Keypad* pControl);
51         static _KeypadImpl* GetInstance(Keypad& pKeypad);
52         static const _KeypadImpl* GetInstance(const Keypad& pKeypad);
53
54         virtual const char* GetPublicClassName(void) const;
55         virtual const Keypad& GetPublic(void) const;
56         virtual Keypad& GetPublic(void);
57         virtual const _Keypad& GetCore(void) const;
58         virtual _Keypad& GetCore(void);
59
60         result Initialize(KeypadStyle keypadStyle, KeypadInputModeCategory category, int limitLength, bool enabledTextPrediction = true);
61
62         void SetTextPredictionEnabled(bool enable);
63
64         bool IsTextPredictionEnabled(void) const;
65
66         result SetSingleLineEnabled(bool enabled);
67
68         bool IsSingleLineEnabled(void) const;
69
70         result AddTextEventListener(Tizen::Ui::ITextEventListener& listener);
71
72         result RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener);
73
74         Tizen::Base::String GetText(void) const;
75
76         void SetText(const Tizen::Base::String& text);
77
78         virtual result OnAttachedToMainTree(void);
79
80         virtual void OnTextValueChanged(const Tizen::Ui::_Control& source);
81
82         virtual void OnTextValueChangeCanceled(const Tizen::Ui::_Control& source);
83
84 private:
85         _KeypadImpl(Keypad* pPublic, _Keypad* pCore);
86         _KeypadImpl(const _KeypadImpl&);
87         _KeypadImpl& operator =(const _KeypadImpl&);
88
89 private:
90         _Keypad* __pKeypad;
91         _KeypadStyleInfo __keypadStyleInfo;
92         int __limitLength;
93         Tizen::Base::Runtime::IEvent* __pTextEvent;
94         _PublicTextEvent* __pPublicTextEvent;
95 }; // _KeypadImpl
96
97 } } } // OSp::Ui::Controls;
98
99 #endif  // _FUI_CTRL_INTERNAL_KEYPAD_IMPL_H_