namespace Locale
{
-using Dali::VirtualKeyboard::TextDirection;
-using Dali::VirtualKeyboard::LeftToRight;
-using Dali::VirtualKeyboard::RightToLeft;
-
namespace
{
{
const char * locale;
const char * name;
- TextDirection direction;
+ Dali::ImfManager::TextDirection direction;
};
const LocaleDirection LOCALE_DIRECTION_LOOKUP_TABLE[] =
{
- { "af", "Afrikaans", LeftToRight },
- { "am", "Amharic", LeftToRight },
- { "ar", "Arabic", RightToLeft },
- { "as", "Assamese", LeftToRight },
- { "az", "Azeri", LeftToRight },
- { "be", "Belarusian", LeftToRight },
- { "bg", "Bulgarian", LeftToRight },
- { "bn", "Bengali", LeftToRight },
- { "bo", "Tibetan", LeftToRight },
- { "bs", "Bosnian", LeftToRight },
- { "ca", "Catalan", LeftToRight },
- { "cs", "Czech", LeftToRight },
- { "cy", "Welsh", LeftToRight },
- { "da", "Danish", LeftToRight },
- { "de", "German", LeftToRight },
- { "dv", "Divehi", RightToLeft },
- { "el", "Greek", LeftToRight },
- { "en", "English", LeftToRight },
- { "es", "Spanish", LeftToRight },
- { "et", "Estonian", LeftToRight },
- { "eu", "Basque", LeftToRight },
- { "fa", "Farsi", RightToLeft },
- { "fi", "Finnish", LeftToRight },
- { "fo", "Faroese", LeftToRight },
- { "fr", "French", LeftToRight },
- { "gd", "Gaelic", LeftToRight },
- { "gl", "Galician", LeftToRight },
- { "gn", "Guarani", LeftToRight },
- { "gu", "Gujarati", LeftToRight },
- { "he", "Hebrew", RightToLeft },
- { "hi", "Hindi", LeftToRight },
- { "hr", "Croatian", LeftToRight },
- { "hu", "Hungarian", LeftToRight },
- { "hy", "Armenian", LeftToRight },
- { "id", "Indonesian", LeftToRight },
- { "is", "Icelandic", LeftToRight },
- { "it", "Italian", LeftToRight },
- { "ja", "Japanese", LeftToRight },
- { "ka", "Georgian", LeftToRight },
- { "kk", "Kazakh", RightToLeft },
- { "km", "Khmer", LeftToRight },
- { "kn", "Kannada", LeftToRight },
- { "ko", "Korean", LeftToRight },
- { "ks", "Kashmiri", RightToLeft },
- { "la", "Latin", LeftToRight },
- { "lo", "Lao", LeftToRight },
- { "lt", "Lithuanian", LeftToRight },
- { "lv", "Latvian", LeftToRight },
- { "mi", "Maori", LeftToRight },
- { "mk", "FYRO Macedonia", LeftToRight },
- { "ml", "Malayalam", LeftToRight },
- { "mn", "Mongolian", LeftToRight },
- { "mr", "Marathi", LeftToRight },
- { "ms", "Malay", LeftToRight },
- { "mt", "Maltese", LeftToRight },
- { "my", "Burmese", LeftToRight },
- { "nb", "Norwegian: Bokml", LeftToRight },
- { "ne", "Nepali", LeftToRight },
- { "nl", "Dutch", LeftToRight },
- { "nn", "Norwegian: Nynorsk", LeftToRight },
- { "or", "Oriya", LeftToRight },
- { "pa", "Punjabi", LeftToRight },
- { "pl", "Polish", LeftToRight },
- { "pt", "Portuguese", LeftToRight },
- { "rm", "Raeto-Romance", LeftToRight },
- { "ro", "Romanian", LeftToRight },
- { "ru", "Russian", LeftToRight },
- { "sa", "Sanskrit", LeftToRight },
- { "sb", "Sorbian", LeftToRight },
- { "sd", "Sindhi", LeftToRight },
- { "si", "Sinhala", LeftToRight },
- { "sk", "Slovak", LeftToRight },
- { "sl", "Slovenian", LeftToRight },
- { "so", "Somali", LeftToRight },
- { "sq", "Albanian", LeftToRight },
- { "sr", "Serbian", LeftToRight },
- { "sv", "Swedish", LeftToRight },
- { "sw", "Swahili", LeftToRight },
- { "ta", "Tamil", LeftToRight },
- { "te", "Telugu", LeftToRight },
- { "tg", "Tajik", RightToLeft },
- { "th", "Thai", LeftToRight },
- { "tk", "Turkmen", LeftToRight },
- { "tn", "Setsuana", LeftToRight },
- { "tr", "Turkish", LeftToRight },
- { "ts", "Tsonga", LeftToRight },
- { "tt", "Tatar", LeftToRight },
- { "uk", "Ukrainian", LeftToRight },
- { "ur", "Urdu", RightToLeft },
- { "uz", "Uzbek", LeftToRight },
- { "vi", "Vietnamese", LeftToRight },
- { "xh", "Xhosa", LeftToRight },
- { "yi", "Yiddish", RightToLeft },
- { "zh", "Chinese", LeftToRight },
- { "zu", "Zulu", LeftToRight },
-
- { NULL, NULL, LeftToRight }
+ { "af", "Afrikaans", Dali::ImfManager::LeftToRight },
+ { "am", "Amharic", Dali::ImfManager::LeftToRight },
+ { "ar", "Arabic", Dali::ImfManager::RightToLeft },
+ { "as", "Assamese", Dali::ImfManager::LeftToRight },
+ { "az", "Azeri", Dali::ImfManager::LeftToRight },
+ { "be", "Belarusian", Dali::ImfManager::LeftToRight },
+ { "bg", "Bulgarian", Dali::ImfManager::LeftToRight },
+ { "bn", "Bengali", Dali::ImfManager::LeftToRight },
+ { "bo", "Tibetan", Dali::ImfManager::LeftToRight },
+ { "bs", "Bosnian", Dali::ImfManager::LeftToRight },
+ { "ca", "Catalan", Dali::ImfManager::LeftToRight },
+ { "cs", "Czech", Dali::ImfManager::LeftToRight },
+ { "cy", "Welsh", Dali::ImfManager::LeftToRight },
+ { "da", "Danish", Dali::ImfManager::LeftToRight },
+ { "de", "German", Dali::ImfManager::LeftToRight },
+ { "dv", "Divehi", Dali::ImfManager::RightToLeft },
+ { "el", "Greek", Dali::ImfManager::LeftToRight },
+ { "en", "English", Dali::ImfManager::LeftToRight },
+ { "es", "Spanish", Dali::ImfManager::LeftToRight },
+ { "et", "Estonian", Dali::ImfManager::LeftToRight },
+ { "eu", "Basque", Dali::ImfManager::LeftToRight },
+ { "fa", "Farsi", Dali::ImfManager::RightToLeft },
+ { "fi", "Finnish", Dali::ImfManager::LeftToRight },
+ { "fo", "Faroese", Dali::ImfManager::LeftToRight },
+ { "fr", "French", Dali::ImfManager::LeftToRight },
+ { "gd", "Gaelic", Dali::ImfManager::LeftToRight },
+ { "gl", "Galician", Dali::ImfManager::LeftToRight },
+ { "gn", "Guarani", Dali::ImfManager::LeftToRight },
+ { "gu", "Gujarati", Dali::ImfManager::LeftToRight },
+ { "he", "Hebrew", Dali::ImfManager::RightToLeft },
+ { "hi", "Hindi", Dali::ImfManager::LeftToRight },
+ { "hr", "Croatian", Dali::ImfManager::LeftToRight },
+ { "hu", "Hungarian", Dali::ImfManager::LeftToRight },
+ { "hy", "Armenian", Dali::ImfManager::LeftToRight },
+ { "id", "Indonesian", Dali::ImfManager::LeftToRight },
+ { "is", "Icelandic", Dali::ImfManager::LeftToRight },
+ { "it", "Italian", Dali::ImfManager::LeftToRight },
+ { "ja", "Japanese", Dali::ImfManager::LeftToRight },
+ { "ka", "Georgian", Dali::ImfManager::LeftToRight },
+ { "kk", "Kazakh", Dali::ImfManager::RightToLeft },
+ { "km", "Khmer", Dali::ImfManager::LeftToRight },
+ { "kn", "Kannada", Dali::ImfManager::LeftToRight },
+ { "ko", "Korean", Dali::ImfManager::LeftToRight },
+ { "ks", "Kashmiri", Dali::ImfManager::RightToLeft },
+ { "la", "Latin", Dali::ImfManager::LeftToRight },
+ { "lo", "Lao", Dali::ImfManager::LeftToRight },
+ { "lt", "Lithuanian", Dali::ImfManager::LeftToRight },
+ { "lv", "Latvian", Dali::ImfManager::LeftToRight },
+ { "mi", "Maori", Dali::ImfManager::LeftToRight },
+ { "mk", "FYRO Macedonia", Dali::ImfManager::LeftToRight },
+ { "ml", "Malayalam", Dali::ImfManager::LeftToRight },
+ { "mn", "Mongolian", Dali::ImfManager::LeftToRight },
+ { "mr", "Marathi", Dali::ImfManager::LeftToRight },
+ { "ms", "Malay", Dali::ImfManager::LeftToRight },
+ { "mt", "Maltese", Dali::ImfManager::LeftToRight },
+ { "my", "Burmese", Dali::ImfManager::LeftToRight },
+ { "nb", "Norwegian: Bokml", Dali::ImfManager::LeftToRight },
+ { "ne", "Nepali", Dali::ImfManager::LeftToRight },
+ { "nl", "Dutch", Dali::ImfManager::LeftToRight },
+ { "nn", "Norwegian: Nynorsk", Dali::ImfManager::LeftToRight },
+ { "or", "Oriya", Dali::ImfManager::LeftToRight },
+ { "pa", "Punjabi", Dali::ImfManager::LeftToRight },
+ { "pl", "Polish", Dali::ImfManager::LeftToRight },
+ { "pt", "Portuguese", Dali::ImfManager::LeftToRight },
+ { "rm", "Raeto-Romance", Dali::ImfManager::LeftToRight },
+ { "ro", "Romanian", Dali::ImfManager::LeftToRight },
+ { "ru", "Russian", Dali::ImfManager::LeftToRight },
+ { "sa", "Sanskrit", Dali::ImfManager::LeftToRight },
+ { "sb", "Sorbian", Dali::ImfManager::LeftToRight },
+ { "sd", "Sindhi", Dali::ImfManager::LeftToRight },
+ { "si", "Sinhala", Dali::ImfManager::LeftToRight },
+ { "sk", "Slovak", Dali::ImfManager::LeftToRight },
+ { "sl", "Slovenian", Dali::ImfManager::LeftToRight },
+ { "so", "Somali", Dali::ImfManager::LeftToRight },
+ { "sq", "Albanian", Dali::ImfManager::LeftToRight },
+ { "sr", "Serbian", Dali::ImfManager::LeftToRight },
+ { "sv", "Swedish", Dali::ImfManager::LeftToRight },
+ { "sw", "Swahili", Dali::ImfManager::LeftToRight },
+ { "ta", "Tamil", Dali::ImfManager::LeftToRight },
+ { "te", "Telugu", Dali::ImfManager::LeftToRight },
+ { "tg", "Tajik", Dali::ImfManager::RightToLeft },
+ { "th", "Thai", Dali::ImfManager::LeftToRight },
+ { "tk", "Turkmen", Dali::ImfManager::LeftToRight },
+ { "tn", "Setsuana", Dali::ImfManager::LeftToRight },
+ { "tr", "Turkish", Dali::ImfManager::LeftToRight },
+ { "ts", "Tsonga", Dali::ImfManager::LeftToRight },
+ { "tt", "Tatar", Dali::ImfManager::LeftToRight },
+ { "uk", "Ukrainian", Dali::ImfManager::LeftToRight },
+ { "ur", "Urdu", Dali::ImfManager::RightToLeft },
+ { "uz", "Uzbek", Dali::ImfManager::LeftToRight },
+ { "vi", "Vietnamese", Dali::ImfManager::LeftToRight },
+ { "xh", "Xhosa", Dali::ImfManager::LeftToRight },
+ { "yi", "Yiddish", Dali::ImfManager::RightToLeft },
+ { "zh", "Chinese", Dali::ImfManager::LeftToRight },
+ { "zu", "Zulu", Dali::ImfManager::LeftToRight },
+
+ { NULL, NULL, Dali::ImfManager::LeftToRight }
};
} // unnamed namespace
-TextDirection GetTextDirection( std::string locale )
+Dali::ImfManager::TextDirection GetTextDirection( std::string locale )
{
- TextDirection direction( LeftToRight );
+ Dali::ImfManager::TextDirection direction( Dali::ImfManager::LeftToRight );
if ( !locale.empty() && locale.size() > 2 )
{
#define __DALI_INTERNAL_LOCALE_UTILS_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <string>
// INTERNAL INCLUDES
-#include <virtual-keyboard.h>
+#include <imf-manager.h>
namespace Dali
{
namespace Locale
{
-Dali::VirtualKeyboard::TextDirection GetTextDirection( std::string locale );
+Dali::ImfManager::TextDirection GetTextDirection( std::string locale );
} // namespace Locale
Internal::Adaptor::ImfManager::GetImplementation(*this).NotifyTextInputMultiLine( multiLine );
}
+ImfManager::TextDirection ImfManager::GetTextDirection()
+{
+ return Internal::Adaptor::ImfManager::GetImplementation(*this).GetTextDirection();
+}
+
+Rect<int> ImfManager::GetInputMethodArea()
+{
+ return Internal::Adaptor::ImfManager::GetImplementation(*this).GetInputMethodArea();
+}
+
+void ImfManager::ApplyOptions( const InputMethodOptions& options )
+{
+ Internal::Adaptor::ImfManager::GetImplementation(*this).ApplyOptions( options );
+}
+
ImfManager::ImfManagerSignalType& ImfManager::ActivatedSignal()
{
return Internal::Adaptor::ImfManager::GetImplementation(*this).ActivatedSignal();
return Internal::Adaptor::ImfManager::GetImplementation(*this).EventReceivedSignal();
}
+ImfManager::StatusSignalType& ImfManager::StatusChangedSignal()
+{
+ return Internal::Adaptor::ImfManager::GetImplementation(*this).StatusChangedSignal();
+}
+
+ImfManager::VoidSignalType& ImfManager::ResizedSignal()
+{
+ return Internal::Adaptor::ImfManager::GetImplementation(*this).ResizedSignal();
+}
+
+ImfManager::VoidSignalType& ImfManager::LanguageChangedSignal()
+{
+ return Internal::Adaptor::ImfManager::GetImplementation(*this).LanguageChangedSignal();
+}
+
ImfManager::ImfManager(Internal::Adaptor::ImfManager *impl)
: BaseHandle(impl)
{
// EXTERNAL INCLUDES
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/dali-signal.h>
+#include "input-method-options.h"
namespace Dali
{
public:
/**
+ * @brief The direction of text.
+ */
+ enum TextDirection
+ {
+ LeftToRight,
+ RightToLeft,
+ };
+
+ /**
* @brief Events that are generated by the IMF.
*/
enum ImfEvent
typedef Signal< void (ImfManager&) > ImfManagerSignalType; ///< Keyboard actived signal
typedef Signal< ImfCallbackData ( ImfManager&, const ImfEventData& ) > ImfEventSignalType; ///< keyboard events
+ typedef Signal< void () > VoidSignalType;
+ typedef Signal< void (bool) > StatusSignalType;
public:
*/
void NotifyTextInputMultiLine( bool multiLine );
+ /**
+ * @brief Returns text direction of the keyboard's current input language.
+ * @return The direction of the text.
+ */
+ TextDirection GetTextDirection();
+
+ /**
+ * @brief Provides size and position of keyboard.
+ *
+ * Position is relative to whether keyboard is visible or not.
+ * If keyboard is not visible then position will be off the screen.
+ * If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get
+ * the values then taken down. So ideally GetInputMethodArea() should be called after Show().
+ * @return rect which is keyboard panel x, y, width, height
+ */
+ Dali::Rect<int> GetInputMethodArea();
+
+ /**
+ * @brief Set one or more of the Input Method options
+ * @param[in] options The options to be applied
+ */
+ void ApplyOptions( const InputMethodOptions& options );
+
+
public:
// Signals
*/
ImfEventSignalType& EventReceivedSignal();
+ /**
+ * @brief Connect to this signal to be notified when the virtual keyboard is shown or hidden.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName(bool keyboardShown);
+ * @endcode
+ * If the parameter keyboardShown is true, then the keyboard has just shown, if it is false, then it
+ * has just been hidden.
+ * @return The signal to connect to.
+ */
+ StatusSignalType& StatusChangedSignal();
+
+ /**
+ * @brief Connect to this signal to be notified when the virtual keyboard is resized.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName();
+ * @endcode
+ * User can get changed size by using GetInputMethodArea() in the callback
+ * @return The signal to connect to.
+ */
+ VoidSignalType& ResizedSignal();
+
+ /**
+ * @brief Connect to this signal to be notified when the virtual keyboard's language is changed.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName();
+ * @endcode
+ * User can get the text direction of the language by calling GetTextDirection() in the callback.
+ * @return The signal to connect to.
+ */
+ VoidSignalType& LanguageChangedSignal();
+
// Construction & Destruction
/**
--- /dev/null
+#ifndef __DALI_INPUT_MEHTOD_DEVEL_H__
+#define __DALI_INPUT_MEHTOD_DEVEL_H__
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
+namespace Dali
+{
+/**
+ * @addtogroup dali_adaptor_framework
+ * @{
+ */
+namespace InputMethod
+{
+
+/**
+ * @brief SetType that can be changed in the system Input Method
+ *
+ * Key types of map to change virtual keyboard settings in INPUT_METHOD_SETTINGS property
+ *
+ */
+namespace Category
+{
+ enum Type
+ {
+ PANEL_LAYOUT, ///< Set Keyboard layout
+ ACTION_BUTTON_TITLE, ///< Set Action button title
+ AUTO_CAPITALISE, ///< Set Auto capitalise of input
+ VARIATION, ///< Set variation
+ };
+}
+
+/**
+ * @brief Autocapitalization Types
+ *
+ */
+namespace AutoCapital
+{
+ enum Type
+ {
+ NONE, ///< No auto-capitalization when typing
+ WORD, ///< Autocapitalize each word typed
+ SENTENCE, ///< Autocapitalize the start of each sentence
+ ALLCHARACTER, ///< Autocapitalize all letters
+ };
+}
+
+/**
+ * @brief Input panel (virtual keyboard) layout types.
+ *
+ */
+namespace PanelLayout
+{
+ enum Type
+ {
+ NORMAL, ///< Default layout
+ NUMBER, ///< Number layout
+ EMAIL, ///< Email layout
+ URL, ///< URL layout
+ PHONENUMBER, ///< Phone Number layout
+ IP, ///< IP layout
+ MONTH, ///< Month layout
+ NUMBERONLY, ///< Number Only layout
+ HEX, ///< Hexadecimal layout
+ TERMINAL, ///< Command-line terminal layout including ESC, Alt, Ctrl key, so on (no auto-correct, no auto-capitalization)
+ PASSWORD, ///< Like normal, but no auto-correct, no auto-capitalization etc
+ DATETIME, ///< Date and time layout
+ EMOTICON, ///< Emoticon layout
+ };
+}
+
+/**
+ * @brief Specifies what the Input Method "action" button functionality is set to.
+ *
+ * The 'Action' button is traditionally the [RETURN] or [DONE] button.
+ *
+ */
+namespace ActionButtonTitle
+{
+ enum Type
+ {
+ DEFAULT, ///< Default action
+ DONE, ///< Done
+ GO, ///< Go action
+ JOIN, ///< Join action
+ LOGIN, ///< Login action
+ NEXT, ///< Next action
+ PREVIOUS, ///< Previous action
+ SEARCH, ///< Search action
+ SEND, ///< Send action
+ SIGNIN, ///< Sign in action
+ UNSPECIFIED, ///< Unspecified action
+ NONE ///< Nothing to do
+ };
+}
+
+/**
+ * @brief Available variation for Normal layout
+ *
+ *
+ */
+namespace NormalLayout
+{
+ enum Type
+ {
+ NORMAL, ///< The plain normal layout
+ WITH_FILENAME, ///< Filename layout. Symbols such as '/' should be disabled
+ WITH_PERSON_NAME ///< The name of a person
+ };
+}
+
+/**
+ * @brief Available variation for Number only layout
+ *
+ *
+ */
+namespace NumberOnlyLayout
+{
+ enum Type
+ {
+ NORMAL, ///< The plain normal number layout
+ WITH_SIGNED, ///< The number layout to allow a positive or negative sign at the start
+ WITH_DECIMAL, ///< The number layout to allow decimal point to provide fractional value
+ WITH_SIGNED_AND_DECIMAL ///< The number layout to allow decimal point and negative sign
+ };
+}
+
+/**
+ * @brief Available variation for Password layout
+ *
+ *
+ */
+namespace PasswordLayout
+{
+ enum Type
+ {
+ NORMAL, ///< The normal password layout
+ WITH_NUMBERONLY ///< The password layout to allow only number
+ };
+}
+
+} // namespace InputMethod
+
+/**
+ * @}
+ */
+} // namespace Dali
+
+#endif // __DALI_INPUT_MEHTOD_DEVEL_H__
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <input-method-options.h>
+
+// INTERNAL INCLUDES
+#include <input-method-devel.h>
+
+using namespace Dali::InputMethod;
+using namespace Dali::InputMethod::Category;
+
+namespace Dali
+{
+
+#define TOKEN_STRING(x) #x
+
+struct InputMethodOptions::Impl
+{
+ Impl()
+ {
+ mPanelLayout = PanelLayout::NORMAL;
+ mAutoCapital = AutoCapital::SENTENCE;
+ mActionButton = ActionButtonTitle::DEFAULT;
+ mVariation = NormalLayout::NORMAL;
+ }
+
+ PanelLayout::Type mPanelLayout;
+ AutoCapital::Type mAutoCapital;
+ ActionButtonTitle::Type mActionButton;
+ int mVariation:4;
+};
+
+InputMethodOptions::InputMethodOptions()
+{
+ mImpl = new Impl( );
+}
+
+bool InputMethodOptions::IsPassword()
+{
+ return (mImpl->mPanelLayout == Dali::InputMethod::PanelLayout::PASSWORD);
+}
+
+void InputMethodOptions::ApplyProperty( const Property::Map& settings )
+{
+ for ( unsigned int i = 0, count = settings.Count(); i < count; ++i )
+ {
+ Property::Key key = settings.GetKeyAt( i );
+ if( key.type == Property::Key::INDEX )
+ {
+ continue;
+ }
+
+ Property::Value item = settings.GetValue(i);
+
+ if( key == TOKEN_STRING( PANEL_LAYOUT ) )
+ {
+ if( item.GetType() == Property::INTEGER )
+ {
+ int value = item.Get< int >();
+ mImpl->mPanelLayout = static_cast<InputMethod::PanelLayout::Type>(value);
+ }
+ }
+ else if ( key == TOKEN_STRING( AUTO_CAPITALISE ) )
+ {
+ if ( item.GetType() == Property::INTEGER )
+ {
+ int value = item.Get< int >();
+ mImpl->mAutoCapital = static_cast<InputMethod::AutoCapital::Type>(value);
+ }
+ }
+ else if ( key == TOKEN_STRING( ACTION_BUTTON ) )
+ {
+ if ( item.GetType() == Property::INTEGER )
+ {
+ int value = item.Get< int >();
+ mImpl->mActionButton = static_cast<InputMethod::ActionButtonTitle::Type>(value);
+ }
+ }
+ else if( key == TOKEN_STRING( VARIATION ) )
+ {
+ if( item.GetType() == Property::INTEGER )
+ {
+ int value = item.Get< int >();
+ mImpl->mVariation = value;
+ }
+ }
+ else
+ {
+ }
+ }
+}
+
+void InputMethodOptions::RetrieveProperty( Property::Map& settings )
+{
+ settings[TOKEN_STRING( PANEL_LAYOUT )] = mImpl->mPanelLayout;
+ settings[TOKEN_STRING( AUTO_CAPITALISE )] = mImpl->mAutoCapital;
+ settings[TOKEN_STRING( ACTION_BUTTON )] = mImpl->mActionButton;
+ settings[TOKEN_STRING( VARIATION )] = mImpl->mVariation;
+}
+
+bool InputMethodOptions::CompareAndSet( InputMethod::Category::Type type, const InputMethodOptions& options, int& index)
+{
+ bool updated = false;
+
+ switch (type)
+ {
+ case PANEL_LAYOUT:
+ {
+ if ( options.mImpl->mPanelLayout != mImpl->mPanelLayout )
+ {
+ mImpl->mPanelLayout = options.mImpl->mPanelLayout;
+ index = static_cast<int>(mImpl->mPanelLayout);
+ updated = true;
+ }
+ break;
+ }
+ case AUTO_CAPITALISE:
+ {
+ if ( options.mImpl->mAutoCapital != mImpl->mAutoCapital )
+ {
+ mImpl->mAutoCapital = options.mImpl->mAutoCapital;
+ index = static_cast<int>(mImpl->mAutoCapital);
+ updated = true;
+ }
+ break;
+ }
+ case ACTION_BUTTON_TITLE:
+ {
+ if ( options.mImpl->mActionButton != mImpl->mActionButton )
+ {
+ mImpl->mActionButton = options.mImpl->mActionButton;
+ index = static_cast<int>(mImpl->mActionButton);
+ updated = true;
+ }
+ break;
+ }
+ case VARIATION:
+ {
+ if ( options.mImpl->mVariation != mImpl->mVariation )
+ {
+ mImpl->mVariation = options.mImpl->mVariation;
+ index = static_cast<int>(mImpl->mVariation);
+ updated = true;
+ }
+ break;
+ }
+ }
+ return updated;
+}
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_VIRTUAL_KEYBOARD_OPTIONS_H__
+#define __DALI_VIRTUAL_KEYBOARD_OPTIONS_H__
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/property-map.h>
+
+// INTERNAL INCLUDES
+#include "input-method-devel.h"
+
+namespace Dali
+{
+
+/**
+ * Class to handle the Input Method options
+ */
+class DALI_IMPORT_API InputMethodOptions
+{
+public:
+
+ /**
+ * Constructor
+ */
+ InputMethodOptions(); /// Default InputMethodOptions options
+
+ /**
+ * @brief Returns whether panel layout type is password or not
+ * @return true if panel layout type is password, false otherwise.
+ */
+ bool IsPassword();
+
+ /**
+ * @brief Apply property map to attribute class, this class will keep the virtualKeyboard settings.
+ * @param[in] settings The property map to be applied
+ */
+ void ApplyProperty( const Property::Map& settings );
+
+ /**
+ * @brief Retrieve property map from current option
+ * @param[out] settings The converted property map
+ */
+ void RetrieveProperty( Property::Map& settings );
+
+public: // Intended for internal use
+ /**
+ * @brief Set option respectively
+ * @param[in] type The type of source option will be updated
+ * @param[in] options The source option to be applied
+ * @param[out] index The updated index after applying source option
+ * @return true if the value of this option is updated by source option
+ */
+ DALI_INTERNAL bool CompareAndSet( InputMethod::Category::Type type, const InputMethodOptions& options, int& index );
+
+private:
+
+ struct Impl;
+ Impl* mImpl;
+};
+
+} // namespace Dali
+
+#endif // __DALI_VIRTUAL_KEYBOARD_OPTIONS_H__
Internal::Adaptor::VirtualKeyboard::SetReturnKeyType( type );
}
-InputMethod::ActionButton GetReturnKeyType()
+InputMethod::ActionButton GetReturnKeyType()
{
return Internal::Adaptor::VirtualKeyboard::GetReturnKeyType();
}
$(adaptor_devel_api_dir)/adaptor-framework/image-loading.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/gif-loading.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/imf-manager.cpp \
+ $(adaptor_devel_api_dir)/adaptor-framework/input-method-options.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/orientation.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/performance-logger.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/physical-keyboard.cpp \
$(adaptor_devel_api_dir)/adaptor-framework/image-loading.h \
$(adaptor_devel_api_dir)/adaptor-framework/gif-loading.h \
$(adaptor_devel_api_dir)/adaptor-framework/imf-manager.h \
+ $(adaptor_devel_api_dir)/adaptor-framework/input-method-devel.h \
+ $(adaptor_devel_api_dir)/adaptor-framework/input-method-options.h \
$(adaptor_devel_api_dir)/adaptor-framework/lifecycle-controller.h \
$(adaptor_devel_api_dir)/adaptor-framework/orientation.h \
$(adaptor_devel_api_dir)/adaptor-framework/performance-logger.h \
void Show()
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: Show() is deprecated and will be removed from next release. Use ImfManager.Activate() instead.\n" );
+
Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) to show the keyboard
if( imfManager )
void Hide()
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: Hide() is deprecated and will be removed from next release. Use ImfManager.Deactivate() instead.\n" );
+
if( ImfManager::IsAvailable() /* We do not want to create an ImfManager instance*/ )
{
Dali::ImfManager imfManager = ImfManager::Get();
bool IsVisible()
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsVisible() is deprecated and will be removed from next release.\n" );
+
if( ImfManager::IsAvailable() /* We do not want to create an ImfManager instance */ )
{
DALI_LOG_INFO( gLogFilter, Debug::General, "IMF IsVisible\n" );
{
int xPos, yPos, width, height;
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetSizeAndPosition() is deprecated and will be removed from next release. Use ImfManager.GetInputMethodArea() instead.\n" );
+
width = height = xPos = yPos = 0;
Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) as we may need to do some size related setup in the application
Dali::VirtualKeyboard::StatusSignalType& StatusChangedSignal()
{
- return gKeyboardStatusSignal;
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: StatusChangedSignal() is deprecated and will be removed from next release. Use ImfManager.StatusChangedSignal() instead.\n" );
+
+ Dali::ImfManager imfManager = ImfManager::Get();
+ return imfManager.StatusChangedSignal();
}
Dali::VirtualKeyboard::VoidSignalType& ResizedSignal()
{
- return gKeyboardResizeSignal;
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ResizedSignal() is deprecated and will be removed from next release. Use ImfManager.ResizedSignal() instead.\n" );
+
+ Dali::ImfManager imfManager = ImfManager::Get();
+ return imfManager.ResizedSignal();
}
Dali::VirtualKeyboard::VoidSignalType& LanguageChangedSignal()
{
- return gKeyboardLanguageChangedSignal;
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: LanguageChangedSignal() is deprecated and will be removed from next release. Use ImfManager.LanguageChangedSignal() instead.\n" );
+
+ Dali::ImfManager imfManager = ImfManager::Get();
+ return imfManager.LanguageChangedSignal();
}
Dali::VirtualKeyboard::TextDirection GetTextDirection()
if ( locale )
{
- direction = Locale::GetTextDirection( std::string( locale ) );
+ direction = (Dali::VirtualKeyboard::TextDirection)Locale::GetTextDirection( std::string( locale ) );
free( locale );
}
}
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
+#include <input-method-devel.h>
#include <adaptor.h>
+#include <locale-utils.h>
#include <window-render-surface.h>
#include <adaptor-impl.h>
#include <singleton-service-impl.h>
-#include <virtual-keyboard-impl.h>
-#include "ecore-virtual-keyboard.h"
+
+#define TOKEN_STRING(x) #x
+
+Ecore_IMF_Input_Panel_Layout panelLayoutMap[] =
+{
+ ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_URL,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_IP,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_HEX,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_DATETIME,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_EMOTICON,
+ ECORE_IMF_INPUT_PANEL_LAYOUT_VOICE
+};
+
+Ecore_IMF_Autocapital_Type autoCapitalMap[] =
+{
+ ECORE_IMF_AUTOCAPITAL_TYPE_NONE,
+ ECORE_IMF_AUTOCAPITAL_TYPE_WORD,
+ ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE,
+ ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER,
+};
+
+Ecore_IMF_Input_Panel_Return_Key_Type returnKeyTypeMap[] =
+{
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT,
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE,
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO,
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN,
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN,
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT,
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH,
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND,
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN
+};
namespace Dali
{
}
}
+void InputPanelStateChangeCallback( void* data, Ecore_IMF_Context* context, int value )
+{
+ if (!data)
+ {
+ return;
+ }
+ ImfManager* imfManager = reinterpret_cast< ImfManager* > ( data );
+ switch (value)
+ {
+ case ECORE_IMF_INPUT_PANEL_STATE_SHOW:
+ {
+ imfManager->StatusChangedSignal().Emit( true );
+ break;
+ }
+
+ case ECORE_IMF_INPUT_PANEL_STATE_HIDE:
+ {
+ imfManager->StatusChangedSignal().Emit( false );
+ break;
+ }
+
+ case ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW:
+ default:
+ {
+ // Do nothing
+ break;
+ }
+ }
+}
+
+void InputPanelLanguageChangeCallback( void* data, Ecore_IMF_Context* context, int value )
+{
+ if (!data)
+ {
+ return;
+ }
+ ImfManager* imfManager = reinterpret_cast< ImfManager* > ( data );
+ // Emit the signal that the language has changed
+ imfManager->LanguageChangedSignal().Emit();
+}
+
+void InputPanelGeometryChangedCallback ( void *data, Ecore_IMF_Context *context, int value )
+{
+ if (!data)
+ {
+ return;
+ }
+ ImfManager* imfManager = reinterpret_cast< ImfManager* > ( data );
+ // Emit signal that the keyboard is resized
+ imfManager->ResizedSignal().Emit();
+}
+
/**
* Called when an IMF delete surrounding event is received.
* Here we tell the application that it should delete a certain range.
CreateContext( ecoreWlwin );
ConnectCallbacks();
- VirtualKeyboard::ConnectCallbacks( mIMFContext );
}
ImfManager::~ImfManager()
{
- VirtualKeyboard::DisconnectCallbacks( mIMFContext );
DisconnectCallbacks();
DeleteContext();
ecore_imf_context_event_callback_add( mIMFContext, ECORE_IMF_CALLBACK_COMMIT, Commit, this );
ecore_imf_context_event_callback_add( mIMFContext, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, ImfDeleteSurrounding, this );
+ ecore_imf_context_input_panel_event_callback_add( mIMFContext, ECORE_IMF_INPUT_PANEL_STATE_EVENT, InputPanelStateChangeCallback, this );
+ ecore_imf_context_input_panel_event_callback_add( mIMFContext, ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, InputPanelLanguageChangeCallback, this );
+ ecore_imf_context_input_panel_event_callback_add( mIMFContext, ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, InputPanelGeometryChangedCallback, this );
+
ecore_imf_context_retrieve_surrounding_callback_set( mIMFContext, ImfRetrieveSurrounding, this);
}
}
ecore_imf_context_event_callback_del( mIMFContext, ECORE_IMF_CALLBACK_COMMIT, Commit );
ecore_imf_context_event_callback_del( mIMFContext, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, ImfDeleteSurrounding );
+ ecore_imf_context_input_panel_event_callback_del( mIMFContext, ECORE_IMF_INPUT_PANEL_STATE_EVENT, InputPanelStateChangeCallback );
+ ecore_imf_context_input_panel_event_callback_del( mIMFContext, ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, InputPanelLanguageChangeCallback );
+ ecore_imf_context_input_panel_event_callback_del( mIMFContext, ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, InputPanelGeometryChangedCallback );
+
// We do not need to unset the retrieve surrounding callback.
}
}
(currentHint & ~ECORE_IMF_INPUT_HINT_MULTILINE)));
}
+Dali::ImfManager::TextDirection ImfManager::GetTextDirection()
+{
+ Dali::ImfManager::TextDirection direction ( Dali::ImfManager::LeftToRight );
+
+ if ( ImfManager::IsAvailable() /* We do not want to create an instance of ImfManager */ )
+ {
+ if ( mIMFContext )
+ {
+ char* locale( NULL );
+ ecore_imf_context_input_panel_language_locale_get( mIMFContext, &locale );
+
+ if ( locale )
+ {
+ direction = Locale::GetTextDirection( std::string( locale ) );
+ free( locale );
+ }
+ }
+ }
+ return direction;
+}
+
+Rect<int> ImfManager::GetInputMethodArea()
+{
+ int xPos, yPos, width, height;
+
+ width = height = xPos = yPos = 0;
+
+ if( mIMFContext )
+ {
+ ecore_imf_context_input_panel_geometry_get( mIMFContext, &xPos, &yPos, &width, &height );
+ }
+ else
+ {
+ DALI_LOG_WARNING("VKB Unable to get IMF Context so GetSize unavailable\n");
+ // return 0 as real size unknown.
+ }
+
+ return Rect<int>(xPos,yPos,width,height);
+}
+
+void ImfManager::ApplyOptions( const InputMethodOptions& options )
+{
+ using namespace Dali::InputMethod::Category;
+
+ int index;
+
+ if (mIMFContext == NULL)
+ {
+ DALI_LOG_WARNING("VKB Unable to excute ApplyOptions with Null ImfContext\n");
+ return;
+ }
+
+ if ( mOptions.CompareAndSet(PANEL_LAYOUT, options, index) )
+ {
+ ecore_imf_context_input_panel_layout_set( mIMFContext, panelLayoutMap[index] );
+ }
+ if ( mOptions.CompareAndSet(AUTO_CAPITALISE, options, index) )
+ {
+ ecore_imf_context_autocapital_type_set( mIMFContext, autoCapitalMap[index] );
+ }
+ if ( mOptions.CompareAndSet(ACTION_BUTTON_TITLE, options, index) )
+ {
+ ecore_imf_context_input_panel_return_key_type_set( mIMFContext, returnKeyTypeMap[index] );
+ }
+ if ( mOptions.CompareAndSet(VARIATION, options, index) )
+ {
+ ecore_imf_context_input_panel_layout_variation_set( mIMFContext, index );
+ }
+}
+
} // Adaptor
} // Internal
public:
typedef Dali::ImfManager::ImfManagerSignalType ImfManagerSignalType;
typedef Dali::ImfManager::ImfEventSignalType ImfEventSignalType;
+ typedef Dali::ImfManager::StatusSignalType ImfStatusSignalType;
+ typedef Dali::ImfManager::VoidSignalType ImfVoidSignalType;
public:
*/
void NotifyTextInputMultiLine( bool multiLine );
+ /**
+ * @copydoc Dali::ImfManager::GetTextDirection()
+ */
+ Dali::ImfManager::TextDirection GetTextDirection();
+
+ /**
+ * @copydoc Dali::ImfManager::GetInputMethodArea()
+ */
+ Dali::Rect<int> GetInputMethodArea();
+
+ /**
+ * @copydoc Dali::ImfManager::ApplyOptions()
+ */
+ void ApplyOptions( const InputMethodOptions& options );
+
public: // Signals
/**
*/
ImfEventSignalType& EventReceivedSignal() { return mEventSignal; }
+ /**
+ * @copydoc Dali::ImfManager::StatusChangedSignal()
+ */
+ ImfStatusSignalType& StatusChangedSignal() { return mKeyboardStatusSignal; }
+
+ /**
+ * @copydoc Dali::ImfManager::ResizedSignal()
+ */
+ ImfVoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
+
+ /**
+ * @copydoc Dali::ImfManager::LanguageChangedSignal()
+ */
+ ImfVoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
+
+
protected:
/**
bool mIdleCallbackConnected:1; ///< Whether the idle callback is already connected.
std::vector<Dali::Integration::KeyEvent> mKeyEvents; ///< Stores key events to be sent from idle call-back.
+ InputMethodOptions mOptions;
ImfManagerSignalType mActivatedSignal;
ImfEventSignalType mEventSignal;
+ ImfStatusSignalType mKeyboardStatusSignal;
+ ImfVoidSignalType mKeyboardResizeSignal;
+ ImfVoidSignalType mKeyboardLanguageChangedSignal;
public:
public:
typedef Dali::ImfManager::ImfManagerSignalType ImfManagerSignalType;
typedef Dali::ImfManager::ImfEventSignalType ImfEventSignalType;
+ typedef Dali::ImfManager::StatusSignalType ImfStatusSignalType;
+ typedef Dali::ImfManager::VoidSignalType ImfVoidSignalType;
public:
*/
void NotifyTextInputMultiLine( bool multiLine );
+ /**
+ * @copydoc Dali::ImfManager::GetTextDirection()
+ */
+ Dali::ImfManager::TextDirection GetTextDirection();
+
+ /**
+ * @copydoc Dali::ImfManager::GetInputMethodArea()
+ */
+ Dali::Rect<int> GetInputMethodArea();
+
+ /**
+ * @copydoc Dali::ImfManager::ApplyOptions()
+ */
+ void ApplyOptions( const InputMethodOptions& options );
+
public: // Signals
/**
*/
ImfEventSignalType& EventReceivedSignal() { return mEventSignal; }
+ /**
+ * @copydoc Dali::ImfManager::StatusChangedSignal()
+ */
+ ImfStatusSignalType& StatusChangedSignal() { return mKeyboardStatusSignal; }
+
+ /**
+ * @copydoc Dali::ImfManager::ResizedSignal()
+ */
+ ImfVoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
+
+ /**
+ * @copydoc Dali::ImfManager::LanguageChangedSignal()
+ */
+ ImfVoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
+
protected:
/**
bool mRestoreAfterFocusLost:1; ///< Whether the keyboard needs to be restored (activated ) after focus regained.
bool mIdleCallbackConnected:1; ///< Whether the idle callback is already connected.
+ InputMethodOptions mOptions;
ImfManagerSignalType mActivatedSignal;
ImfEventSignalType mEventSignal;
+ ImfStatusSignalType mKeyboardStatusSignal;
+ ImfVoidSignalType mKeyboardResizeSignal;
+ ImfVoidSignalType mKeyboardLanguageChangedSignal;
public:
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
+Dali::Rect< int > ImfManager::GetInputMethodArea()
+{
+ TextInputManager::SeatInfo& info = mTextInputManager.GetLastActiveSeat();
+ return info.mInputPanelDimensions;
+}
+
+void ImfManager::ApplyOptions(const InputMethodOptions& options)
+{
+}
+
+Dali::ImfManager::TextDirection ImfManager::GetTextDirection()
+{
+ TextInputManager::SeatInfo& info = mTextInputManager.GetLastActiveSeat();
+ return (Dali::ImfManager::TextDirection)info.mTextDirection;
+}
+
} // Adaptor
} // Internal
public:
typedef Dali::ImfManager::ImfManagerSignalType ImfManagerSignalType;
typedef Dali::ImfManager::ImfEventSignalType ImfEventSignalType;
+ typedef Dali::ImfManager::StatusSignalType ImfStatusSignalType;
+ typedef Dali::ImfManager::VoidSignalType ImfVoidSignalType;
public:
*/
void NotifyTextInputMultiLine( bool multiLine );
+ /**
+ * @copydoc Dali::ImfManager::GetTextDirection()
+ */
+ Dali::ImfManager::TextDirection GetTextDirection();
+
+ /**
+ * @copydoc Dali::ImfManager::GetInputMethodArea()
+ */
+ Dali::Rect<int> GetInputMethodArea();
+
+ /**
+ * @copydoc Dali::ImfManager::ApplyOptions()
+ */
+ void ApplyOptions( const InputMethodOptions& options );
+
public: // Signals
/**
ImfEventSignalType& EventReceivedSignal() { return mEventSignal; }
/**
+ * @copydoc Dali::ImfManager::StatusChangedSignal()
+ */
+ ImfStatusSignalType& StatusChangedSignal() { return mKeyboardStatusSignal; }
+
+ /**
+ * @copydoc Dali::ImfManager::ResizedSignal()
+ */
+ ImfVoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
+
+ /**
+ * @copydoc Dali::ImfManager::LanguageChangedSignal()
+ */
+ ImfVoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
+
+
+ /**
* @brief Called when an IMF Pre-Edit change event is received.
* We are still predicting what the user is typing. The latest string is what the IMF module thinks
* the user wants to type.
ImfManagerSignalType mActivatedSignal;
ImfEventSignalType mEventSignal;
+ ImfStatusSignalType mKeyboardStatusSignal;
+ ImfVoidSignalType mKeyboardResizeSignal;
+ ImfVoidSignalType mKeyboardLanguageChangedSignal;
// Undefined
ImfManager( const ImfManager& );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#define __DALI_WAYLAND_TEXT_INPUT_MANAGER_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <adaptor.h>
#include <window-render-surface.h>
#include <adaptor-impl.h>
+#include <locale-utils.h>
#include <singleton-service-impl.h>
#include <virtual-keyboard-impl.h>
#include "ecore-virtual-keyboard.h"
{
}
+Dali::ImfManager::TextDirection ImfManager::GetTextDirection()
+{
+ Dali::ImfManager::TextDirection direction ( Dali::ImfManager::LeftToRight );
+
+ if ( ImfManager::IsAvailable() /* We do not want to create an instance of ImfManager */ )
+ {
+ if ( mIMFContext )
+ {
+ char* locale( NULL );
+ ecore_imf_context_input_panel_language_locale_get( mIMFContext, &locale );
+
+ if ( locale )
+ {
+ direction = Locale::GetTextDirection( std::string( locale ) );
+ free( locale );
+ }
+ }
+ }
+ return direction;
+}
+
+Rect<int> ImfManager::GetInputMethodArea()
+{
+ int xPos, yPos, width, height;
+
+ width = height = xPos = yPos = 0;
+
+ if( mIMFContext )
+ {
+ ecore_imf_context_input_panel_geometry_get( mIMFContext, &xPos, &yPos, &width, &height );
+ }
+ else
+ {
+ DALI_LOG_WARNING("VKB Unable to get IMF Context so GetSize unavailable\n");
+ }
+
+ return Rect<int>(xPos,yPos,width,height);
+}
+
+void ImfManager::ApplyOptions( const InputMethodOptions& options )
+{
+ using namespace Dali::InputMethod::Category;
+
+ int index;
+
+ if (mIMFContext == NULL)
+ {
+ DALI_LOG_WARNING("VKB Unable to excute ApplyOptions with Null ImfContext\n");
+ return;
+ }
+
+ if ( mOptions.CompareAndSet(PANEL_LAYOUT, options, index) )
+ {
+ }
+ if ( mOptions.CompareAndSet(AUTO_CAPITALISE, options, index) )
+ {
+ }
+ if ( mOptions.CompareAndSet(ACTION_BUTTON_TITLE, options, index) )
+ {
+ }
+ if ( mOptions.CompareAndSet(VARIATION, options, index) )
+ {
+ }
+}
+
} // Adaptor
} // Internal