2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <imf-manager-impl.h>
22 #include <dali/public-api/events/key-event.h>
23 #include <dali/public-api/object/type-registry.h>
24 #include <dali/integration-api/debug.h>
28 #include <window-render-surface.h>
29 #include <adaptor-impl.h>
30 #include <singleton-service-impl.h>
31 #include <virtual-keyboard-impl.h>
47 return ImfManager::Get();
50 TypeRegistration IMF_MANAGER_TYPE( typeid(Dali::ImfManager), typeid(Dali::BaseHandle), Create );
52 } // unnamed namespace
54 bool ImfManager::IsAvailable()
59 Dali::ImfManager ImfManager::Get()
61 // Return empty handle as not supported
62 return Dali::ImfManager();
65 ImfManager::~ImfManager()
69 void ImfManager::DeleteContext()
73 void ImfManager::ConnectCallbacks()
77 void ImfManager::DisconnectCallbacks()
81 void ImfManager::Activate()
85 void ImfManager::Deactivate()
89 void ImfManager::Reset()
93 Ecore_IMF_Context* ImfManager::GetContext()
98 bool ImfManager::RestoreAfterFocusLost() const
100 return mRestoreAfterFocusLost;
103 void ImfManager::SetRestoreAfterFocusLost( bool toggle )
105 mRestoreAfterFocusLost = toggle;
108 void ImfManager::PreEditChanged( void *, Ecore_IMF_Context *imfContext, void *event_info )
112 void ImfManager::CommitReceived( void *, Ecore_IMF_Context *imfContext, void *event_info )
116 Eina_Bool ImfManager::RetrieveSurrounding( void *data, Ecore_IMF_Context *imfContext, char** text, int* cursorPosition )
121 void ImfManager::DeleteSurrounding( void *data, Ecore_IMF_Context *imfContext, void *event_info )
125 void ImfManager::NotifyCursorPosition()
129 int ImfManager::GetCursorPosition()
131 return mIMFCursorPosition;
134 void ImfManager::SetCursorPosition( unsigned int cursorPosition )
136 mIMFCursorPosition = ( int )cursorPosition;
139 void ImfManager::SetSurroundingText( std::string text )
141 mSurroundingText = text;
144 std::string ImfManager::GetSurroundingText()
146 return mSurroundingText;