da9d5c1267f7b5794d0b3b3d4c88453011d9ded7
[platform/core/uifw/dali-adaptor.git] / dali / internal / input / windows / virtual-keyboard-impl-win.cpp
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/input/common/virtual-keyboard-impl.h>
20
21 // EXTERNAL INCLUDES
22 //#include <X11/Xlib.h>
23 //#include <Ecore_X.h>
24 #include <algorithm>
25
26 #include <dali/integration-api/debug.h>
27
28 // INTERNAL INCLUDES
29 #include <dali/integration-api/adaptor.h>
30 #include <dali/internal/system/common/locale-utils.h>
31 #include <dali/internal/input/windows/input-method-context-impl-win.h>
32
33 namespace Dali
34 {
35
36 namespace Internal
37 {
38
39 namespace Adaptor
40 {
41
42 namespace VirtualKeyboard
43 {
44 void Show()
45 {
46 }
47
48 void Hide()
49 {
50
51 }
52
53 bool IsVisible()
54 {
55   return false;
56 }
57
58 void ApplySettings( const Property::Map& settingsMap )
59 {
60
61 }
62
63 void EnablePrediction( const bool enable )
64 {
65
66 }
67
68 bool IsPredictionEnabled()
69 {
70   return false;
71 }
72
73 Rect<int> GetSizeAndPosition()
74 {
75   Rect<int> ret;
76   return ret;
77 }
78
79 Dali::VirtualKeyboard::StatusSignalType& StatusChangedSignal()
80 {
81   Dali::VirtualKeyboard::StatusSignalType ret;
82   return ret;
83 }
84
85 Dali::VirtualKeyboard::KeyboardResizedSignalType& ResizedSignal()
86 {
87   Dali::VirtualKeyboard::KeyboardResizedSignalType ret;
88   return ret;
89 }
90
91 Dali::VirtualKeyboard::LanguageChangedSignalType& LanguageChangedSignal()
92 {
93   Dali::VirtualKeyboard::LanguageChangedSignalType ret;
94   return ret;
95 }
96
97 Dali::VirtualKeyboard::TextDirection GetTextDirection()
98 {
99   return Dali::VirtualKeyboard::LeftToRight;
100 }
101
102 Dali::InputMethod::ActionButton gActionButtonFunction = Dali::InputMethod::ACTION_DEFAULT;
103
104 //Ecore_IMF_Input_Panel_Return_Key_Type buttonActionMapping(Dali::InputMethod::ButtonAction::Type buttonAction )
105 //{
106 //  switch( buttonAction )
107 //  {
108 //    case InputMethod::ButtonAction::DEFAULT:     return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
109 //    case InputMethod::ButtonAction::DONE:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE;
110 //    case InputMethod::ButtonAction::GO:          return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO;
111 //    case InputMethod::ButtonAction::JOIN:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN;
112 //    case InputMethod::ButtonAction::LOGIN:       return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN;
113 //    case InputMethod::ButtonAction::NEXT:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT;
114 //    case InputMethod::ButtonAction::PREVIOUS:    return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
115 //    case InputMethod::ButtonAction::SEARCH:      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH;
116 //    case InputMethod::ButtonAction::SEND:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND;
117 //    case InputMethod::ButtonAction::SIGNIN:      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
118 //    case InputMethod::ButtonAction::UNSPECIFIED: return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
119 //    case InputMethod::ButtonAction::NONE:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
120 //    default:                                     return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
121 //  }
122 //}
123
124 void RotateTo(int angle)
125 {
126   // Get focus window used by Keyboard and rotate it
127   //Display* display = XOpenDisplay(0);
128   //if (display)
129   //{
130   //  ::Window focusWindow;
131   //  int revert;
132   //  // Get Focus window
133   //  XGetInputFocus(display, &focusWindow, &revert);
134
135   //  ecore_x_window_prop_property_set( focusWindow,
136   //                                    ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
137   //                                    ECORE_X_ATOM_CARDINAL, 32, &angle, 1 );
138   //  XCloseDisplay(display);
139   //}
140 }
141
142 void SetReturnKeyType( const InputMethod::ButtonAction::Type type )
143 {
144   //Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) when setting values
145   //Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>(ImfManager::GetImplementation( imfManager ).GetContext());
146
147   //if( imfContext )
148   //{
149   //  gActionButtonFunction = type;
150   //  ecore_imf_context_input_panel_return_key_type_set( imfContext, actionButtonMapping( type ) );
151   //}
152 }
153
154 Dali::InputMethod::ButtonAction::Type GetReturnKeyType()
155 {
156   return Dali::InputMethod::ButtonAction::DEFAULT;
157 }
158
159 } // namespace VirtualKeyboard
160
161 } // namespace Adaptor
162
163 } // namespace Internal
164
165 } // namespace Dali