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 FUi_InputConnectionImpl.h
19 * @brief This is the implementation file for the _InputConnectionImpl class.
22 #ifndef _FUI_INTERNAL_INPUT_CONNECTION_IMPL_H_
23 #define _FUI_INTERNAL_INPUT_CONNECTION_IMPL_H_
26 #include <Ecore_IMF_Evas.h>
27 #include <FBaseColLinkedListT.h>
28 #include <FGrpRectangle.h>
29 #include <FLclLocale.h>
30 #include <FUiIInputConnectionEventListener.h>
31 #include <FUiIInputConnectionEventListenerF.h>
32 #include <FUiIInputConnectionProvider.h>
33 #include "FUi_Control.h"
35 namespace Tizen { namespace Ui {
37 class InputConnection;
40 * @class _InputConnectionImpl
41 * @brief This class is a based input method implements the behavior
45 class _InputConnectionImpl
46 : public Tizen::Base::Object
47 , public _IKeyEventListener
50 virtual ~_InputConnectionImpl(void);
51 static _InputConnectionImpl* CreateInputConnectionImplN(InputConnection* pInputConnection);
53 result Initialize(const Tizen::Ui::_Control& control, const IInputConnectionEventListener& listener, const IInputConnectionProvider& provider);
54 result Initialize(const Tizen::Ui::_Control& control, const IInputConnectionEventListenerF& listener, const IInputConnectionProvider& provider);
55 result BindInputMethod(void);
56 result UnbindInputMethod(void);
57 result ShowInputPanel(void);
58 result HideInputPanel(void);
59 result SetInputPanelStyle(InputPanelStyle style);
60 InputPanelStyle GetInputPanelStyle(void) const;
61 result SetAutoCapitalizationMode(AutoCapitalizationMode autoCapitalizationMode);
62 AutoCapitalizationMode GetAutoCapitalizationMode(void) const;
63 InputPanelShowState GetInputPanelShowState(void) const;
64 result SetInputPanelShowState(InputPanelShowState showState);
65 result FinishTextComposition(void);
66 result SetInputPanelAction(InputPanelAction inputPanelAction);
67 InputPanelAction GetInputPanelAction(void) const;
68 result SetInputPanelActionEnabled(bool enabled);
69 bool IsInputPanelActionEnabled(void) const;
70 result SetCursorPosition(int position);
71 result SetCursorBounds(const Tizen::Graphics::Rectangle& rect);
72 result SetCursorBounds(const Tizen::Graphics::FloatRectangle& rect);
73 Tizen::Graphics::Rectangle GetInputPanelBounds(void) const;
74 Tizen::Graphics::FloatRectangle GetInputPanelBoundsF(void) const;
75 Tizen::Graphics::Rectangle GetPredictionBounds(void) const;
76 Tizen::Graphics::FloatRectangle GetPredictionBoundsF(void) const;
77 result SetTextPredictionEnabled(bool enable);
78 bool IsTextPredictionEnabled(void) const;
79 result SetCapsLockEnabled(bool enable);
80 bool IsCapsLockEnabled(void) const;
82 result SetInputPanelLanguage(Tizen::Locales::LanguageCode languageCode);
83 Tizen::Locales::LanguageCode GetInputPanelLanguage(void) const;
84 InputConnection* GetInputConnection(void) const;
85 IInputConnectionEventListener* GetInputConnectionListener(void) const;
86 IInputConnectionEventListenerF* GetInputConnectionListenerF(void) const;
87 IInputConnectionProvider* GetInputConnectionProvider(void) const;
88 bool CheckContextEvent(Ecore_IMF_Event_Type type, void* pEventInfo);
89 int CheckUSBKeyboardStatus(void);
90 void SendOpaqueCommand (const Tizen::Base::String& command);
92 static _InputConnectionImpl* GetInstance(InputConnection& inputConnection);
93 static const _InputConnectionImpl* GetInstance(const InputConnection& inputConnection);
95 virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
96 virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
99 void SetKeyEventSkipped(bool enabled);
102 _InputConnectionImpl(InputConnection* pInputConnection);
103 _InputConnectionImpl(const _InputConnectionImpl& rhs);
104 _InputConnectionImpl& operator=(const _InputConnectionImpl& rhs);
106 void AddInputPanelCallback(void);
107 void AddEcoreEventCallback(void);
108 void AddEvasObjectEventCallback(void);
109 void RemoveInputPanelCallback(void);
110 void RemoveEcoreEventCallback(void);
111 void RemoveEvasObjectEventCallback(void);
113 result FilterKeyOnUSBMode(InputPanelStyle style, const char* key, bool commit = false);
116 Ecore_IMF_Context* __pContext;
117 _ControlHandle __controlHandle;
119 IInputConnectionEventListener* __pListener;
120 IInputConnectionEventListenerF* __pListenerF;
121 IInputConnectionProvider* __pProvider;
122 InputConnection* __pInputConnection;
123 InputPanelAction __inputPanelAction;
124 InputPanelShowState __inputPanelState;
125 InputPanelStyle __inputPanelStyle;
126 Ecore_Event_Handler* __pUSBEventHandler;
127 bool __IsKeyEventSkipped;
129 }; // _InputConnectionImpl
133 #endif // _FUI_INTERNAL_INPUT_CONNECTION_IMPL_H_