1 #ifndef __DALI_VIRTUAL_KEYBOARD_H__
2 #define __DALI_VIRTUAL_KEYBOARD_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 * @addtogroup CAPI_DALI_ADAPTOR_MODULE
27 #include <dali/public-api/signals/dali-signal-v2.h>
28 #include <dali/public-api/math/rect.h>
30 namespace Dali DALI_IMPORT_API
34 * @brief This namespace is provided for application developers to be able to show and hide the on-screen keyboard.
36 * Key events are sent to the actor in focus. Focus is set through the actor Public API.
38 namespace VirtualKeyboard
43 typedef SignalV2< void () > VoidSignalV2;
44 typedef SignalV2< void (bool) > StatusSignalV2;
49 * @brief The direction of text.
58 * @brief The meaning of the return key.
75 * @brief Show the virtual keyboard.
80 * @brief Hide the virtual keyboard.
85 * @brief Returns whether the virtual keyboard is visible or not.
86 * @return true if visible, false otherwise.
91 * @brief Set the specific return key into the virtual keyboard.
92 * @param[in] type the kind of return key types.
94 void SetReturnKeyType( ReturnKeyType type );
97 * @brief Retrieve the current return key type.
98 * @return the type of retun key.
100 ReturnKeyType GetReturnKeyType();
103 * @brief Enable/disable prediction (predictive text).
105 * By default prediction text is enabled.
106 * @param[in] enable true or false to enable or disable
107 * Prediction can not be changed while the keyboard is visible. It must be set in advance of showing keyboard.
109 void EnablePrediction(const bool enable);
112 * @brief Returns whether prediction is enabled in the virtual keyboard
113 * @return true if predictive text enabled, false otherwise.
115 bool IsPredictionEnabled();
118 * @brief Provides size and position of keyboard.
120 * Position is relative to whether keyboard is visible or not.
121 * If keyboard is not visible then position will be off the screen.
122 * If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get
123 * the values then taken down. So ideally GetSizeAndPosition() should be called after Show().
124 * @return rect which is keyboard panel x, y, width, height
126 Dali::Rect<int> GetSizeAndPosition();
129 * @brief Rotates the keyboard orientation to the given angle.
131 * A value of 0 indicates the portrait orientation.
132 * Other valid values are 90, 180, 270.
133 * @param angle the angle is in degrees.
135 void RotateTo(int angle);
138 * @brief Returns text direction of the keyboard's current input language.
139 * @return The direction of the text.
141 TextDirection GetTextDirection();
144 * @brief Connect to this signal to be notified when the virtual keyboard is shown or hidden.
146 * A callback of the following type may be connected:
148 * void YourCallbackName(bool keyboardShown);
150 * If the parameter keyboardShown is true, then the keyboard has just shown, if it is false, then it
151 * has just been hidden.
152 * @return The signal to connect to.
154 StatusSignalV2& StatusChangedSignal();
157 * @brief Connect to this signal to be notified when the virtual keyboard is resized.
159 * A callback of the following type may be connected:
161 * void YourCallbackName();
163 * User can get changed size by using GetSizeAndPosition() in the callback
164 * @return The signal to connect to.
166 VoidSignalV2& ResizedSignal();
169 * @brief Connect to this signal to be notified when the virtual keyboard's language is changed.
171 * A callback of the following type may be connected:
173 * void YourCallbackName();
175 * User can get the text direction of the language by calling GetTextDirection() in the callback.
176 * @return The signal to connect to.
178 VoidSignalV2& LanguageChangedSignal();
180 } // namespace VirtualKeyboard
187 #endif // __DALI_VIRTUAL_KEYBOARD_H__