../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
- ../dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp
+ ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-physical-keyboard.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp
// Set cursor's width to zero.
controller->GetLayoutEngine().SetCursorWidth( 0 );
+ InputMethodContext inputMethodContext = InputMethodContext::New();
// Disables the text input.
- controller->EnableTextInput( NULL );
+ controller->EnableTextInput( NULL, inputMethodContext );
// Disables the vertical scrolling.
controller->SetVerticalScrollEnabled( false );
// Set the text layout as multi-line.
controller->GetLayoutEngine().SetLayout( Layout::Engine::SINGLE_LINE_BOX );
+ InputMethodContext inputMethodContext = InputMethodContext::New();
// Enables the text input.
- controller->EnableTextInput( decorator );
+ controller->EnableTextInput( decorator, inputMethodContext );
// Enables the vertical scrolling after the text input has been enabled.
controller->SetVerticalScrollEnabled( false );
// Set the text layout as multi-line.
controller->GetLayoutEngine().SetLayout( Layout::Engine::MULTI_LINE_BOX );
+ InputMethodContext inputMethodContext = InputMethodContext::New();
// Enables the text input.
- controller->EnableTextInput( decorator );
+ controller->EnableTextInput( decorator, inputMethodContext );
// Enables the vertical scrolling after the text input has been enabled.
controller->SetVerticalScrollEnabled( true );
// Creates a decorator.
Text::DecoratorPtr decorator = Text::Decorator::New( *controller,
*controller );
-
+ InputMethodContext inputMethodContext = InputMethodContext::New();
// Enables the text input.
- controller->EnableTextInput( decorator );
+ controller->EnableTextInput( decorator, inputMethodContext );
// Enables the cursor blink.
controller->SetEnableCursorBlink( true );
ControllerPtr controller = Controller::New();
std::string text;
- ImfManager::ImfEventData imfEvent;
+ InputMethodContext::EventData imfEvent;
DALI_TEST_CHECK( controller );
Text::DecoratorPtr decorator = Text::Decorator::New( *controller,
*controller );
+ InputMethodContext inputMethodContext = InputMethodContext::New();
// Enables the text input.
- controller->EnableTextInput( decorator );
+ controller->EnableTextInput( decorator, inputMethodContext );
// Set the placeholder text.
controller->SetPlaceholderText( Controller::PLACEHOLDER_TYPE_INACTIVE, "Hello Dali" );
- // Creates an ImfManager.
- ImfManager imfManager = ImfManager::Get();
-
// For coverage.
- imfEvent = ImfManager::ImfEventData( ImfManager::GETSURROUNDING, "", 0, 0 );
- controller->OnImfEvent( imfManager, imfEvent );
+ imfEvent = InputMethodContext::EventData( InputMethodContext::GET_SURROUNDING, "", 0, 0 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
// Send VOID event.
- imfEvent = ImfManager::ImfEventData( ImfManager::VOID, "", 0, 0 );
- controller->OnImfEvent( imfManager, imfEvent );
+ imfEvent = InputMethodContext::EventData( InputMethodContext::VOID, "", 0, 0 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
controller->GetText( text );
DALI_TEST_CHECK( text.empty() );
- imfEvent = ImfManager::ImfEventData( ImfManager::COMMIT, "Hello ", 0, 6 );
- controller->OnImfEvent( imfManager, imfEvent );
+ imfEvent = InputMethodContext::EventData( InputMethodContext::COMMIT, "Hello ", 0, 6 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
controller->GetNaturalSize();
// Check 'Delete All' key which means the input panel send a big range
- imfEvent = ImfManager::ImfEventData( ImfManager::DELETESURROUNDING, "", -100, 100 );
- controller->OnImfEvent( imfManager, imfEvent );
+ imfEvent = InputMethodContext::EventData( InputMethodContext::DELETE_SURROUNDING, "", -100, 100 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
controller->GetNaturalSize();
controller->GetText( text );
DALI_TEST_EQUALS( "", text, TEST_LOCATION );
// Send COMMIT event.
- imfEvent = ImfManager::ImfEventData( ImfManager::COMMIT, "Hello ", 0, 6 );
- controller->OnImfEvent( imfManager, imfEvent );
+ imfEvent = InputMethodContext::EventData( InputMethodContext::COMMIT, "Hello ", 0, 6 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
// Force to update the model.
controller->GetNaturalSize();
controller->GetText( text );
DALI_TEST_EQUALS( "Hello ", text, TEST_LOCATION );
- // Send PREEDIT event
- imfEvent = ImfManager::ImfEventData( ImfManager::PREEDIT, "w", 6, 1 );
- controller->OnImfEvent( imfManager, imfEvent );
+ // Send PRE_EDIT event
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "w", 6, 1 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
// Force to update the model.
controller->GetNaturalSize();
controller->GetText( text );
DALI_TEST_EQUALS( "Hello w", text, TEST_LOCATION );
- // Send DELETESURROUNDING event
- imfEvent = ImfManager::ImfEventData( ImfManager::DELETESURROUNDING, "", -1, 1 );
- controller->OnImfEvent( imfManager, imfEvent );
+ // Send DELETE_SURROUNDING event
+ imfEvent = InputMethodContext::EventData( InputMethodContext::DELETE_SURROUNDING, "", -1, 1 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
// Force to update the model.
controller->GetNaturalSize();
controller->GetText( text );
DALI_TEST_EQUALS( "Hello ", text, TEST_LOCATION );
- // Send PREEDIT event
- imfEvent = ImfManager::ImfEventData( ImfManager::PREEDIT, "wo", 6, 2 );
- controller->OnImfEvent( imfManager, imfEvent );
+ // Send PRE_EDIT event
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "wo", 6, 2 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
// Force to update the model.
controller->GetNaturalSize();
controller->GetText( text );
DALI_TEST_EQUALS( "Hello wo", text, TEST_LOCATION );
- // Send GETSURROUNDING event
- imfEvent = ImfManager::ImfEventData( ImfManager::GETSURROUNDING, "", 0, 0 );
- controller->OnImfEvent( imfManager, imfEvent );
+ // Send GET_SURROUNDING event
+ imfEvent = InputMethodContext::EventData( InputMethodContext::GET_SURROUNDING, "", 0, 0 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
controller->GetText( text );
DALI_TEST_EQUALS( "Hello wo", text, TEST_LOCATION );
- // Send PRIVATECOMMAND event
- imfEvent = ImfManager::ImfEventData( ImfManager::PRIVATECOMMAND, "", 0, 0 );
- controller->OnImfEvent( imfManager, imfEvent );
+ // Send PRIVATE_COMMAND event
+ imfEvent = InputMethodContext::EventData( InputMethodContext::PRIVATE_COMMAND, "", 0, 0 );
+ controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
controller->GetText( text );
DALI_TEST_EQUALS( "Hello wo", text, TEST_LOCATION );
Text::DecoratorPtr decorator = Text::Decorator::New( *controller,
*controller );
+ InputMethodContext inputMethodContext = InputMethodContext::New();
// Enables the text input.
- controller->EnableTextInput( decorator );
+ controller->EnableTextInput( decorator, inputMethodContext );
// Creates the text's popup.
TextSelectionPopupCallbackInterface& callbackInterface = *controller;
// Creates a decorator.
Text::DecoratorPtr decorator = Text::Decorator::New( *controller, *controller );
+ InputMethodContext inputMethodContext = InputMethodContext::New();
// Enables the text input.
- controller->EnableTextInput( decorator );
+ controller->EnableTextInput( decorator, inputMethodContext );
DALI_TEST_CHECK( !controller->IsInputModePassword() );
// Creates a decorator.
Text::DecoratorPtr decorator = Text::Decorator::New( *controller, *controller );
+ InputMethodContext inputMethodContext = InputMethodContext::New();
// Enables the text input.
- controller->EnableTextInput( decorator );
+ controller->EnableTextInput( decorator, inputMethodContext );
DALI_TEST_EQUALS( Controller::NoTextTap::NO_ACTION, controller->GetNoTextDoubleTapAction(), TEST_LOCATION );
controller->SetNoTextDoubleTapAction( Controller::NoTextTap::HIGHLIGHT );
../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-feedback-player.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-file-loader.cpp
- ../dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp
+ ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-physical-keyboard.cpp
Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor( editor );
- application.ProcessEvent( Integration::KeyEvent( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( Integration::KeyEvent( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", "", Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
- ../dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp
+ ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-physical-keyboard.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp
dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
dali-toolkit-test-utils/toolkit-environment-variable.cpp
- dali-toolkit-test-utils/toolkit-imf-manager.cpp
+ dali-toolkit-test-utils/toolkit-input-method-context.cpp
dali-toolkit-test-utils/toolkit-orientation.cpp
dali-toolkit-test-utils/toolkit-physical-keyboard.cpp
dali-toolkit-test-utils/toolkit-style-monitor.cpp
#include <dali-test-suite-utils.h>
#include "toolkit-test-application.h"
#include "toolkit-application.h"
-#include "toolkit-imf-manager.h"
+#include "toolkit-input-method-context.h"
#include "toolkit-clipboard-event-notifier.h"
#endif // __DALI_TOOLKIT_TEST_SUITE_UTILS_H__
+++ /dev/null
-/*
- * Copyright (c) 2014 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 "toolkit-imf-manager.h"
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-object.h>
-#include <dali/integration-api/debug.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
-{
-class RenderSurface;
-
-
-class ImfManager : public Dali::BaseObject
-{
-public:
- typedef Dali::ImfManager::ImfManagerSignalType ImfManagerSignalType;
- typedef Dali::ImfManager::ImfEventSignalType ImfEventSignalType;
- typedef Dali::ImfManager::StatusSignalType ImfStatusSignalType;
- typedef Dali::ImfManager::VoidSignalType ImfVoidSignalType;
-
-public:
- static Dali::ImfManager Get();
-
- ImfManager( /* Ecore_X_Window ecoreXwin */ );
- void ConnectCallbacks();
- void DisconnectCallbacks();
- void Activate();
- void Deactivate();
- void Reset();
-
- bool RestoreAfterFocusLost() const;
- void SetRestoreAfterFocusLost( bool toggle );
- void NotifyCursorPosition();
- void SetCursorPosition( unsigned int cursorPosition );
- unsigned int GetCursorPosition() const;
- void SetSurroundingText( const std::string& text );
- const std::string& GetSurroundingText() const;
- void ApplyOptions( const InputMethodOptions& options );
-
-public: // Signals
- ImfManagerSignalType& ActivatedSignal() { return mActivatedSignal; }
- ImfEventSignalType& EventReceivedSignal() { return mEventSignal; }
- ImfStatusSignalType& StatusChangedSignal() { return mKeyboardStatusSignal; }
- ImfVoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
- ImfVoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
-
-protected:
- virtual ~ImfManager();
-
-private:
- void CreateContext( /*Ecore_X_Window ecoreXwin*/ );
- void DeleteContext();
-
-private:
- // Undefined
- ImfManager( const ImfManager& );
- ImfManager& operator=( ImfManager& );
-
-private:
- int mIMFCursorPosition;
- std::string mSurroundingText;
- 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;
-
- static Dali::ImfManager mToolkitImfManager;
-
-public:
-
-inline static Internal::Adaptor::ImfManager& GetImplementation(Dali::ImfManager& imfManager)
-{
- Dali::ImfManager actualImfManager = ImfManager::Get();
-
- BaseObject& handle = actualImfManager.GetBaseObject();
- return static_cast<Internal::Adaptor::ImfManager&>(handle);
-}
-
-inline static const Internal::Adaptor::ImfManager& GetImplementation(const Dali::ImfManager& imfManager)
-{
- Dali::ImfManager actualImfManager = ImfManager::Get();
-
- const BaseObject& handle = imfManager.GetBaseObject();
- return static_cast<const Internal::Adaptor::ImfManager&>(handle);
-}
-
-};
-
-Dali::ImfManager Dali::Internal::Adaptor::ImfManager::mToolkitImfManager;
-
-Dali::ImfManager ImfManager::Get()
-{
- Dali::ImfManager manager;
-
- if( ! mToolkitImfManager )
- {
- mToolkitImfManager = Dali::ImfManager( new Dali::Internal::Adaptor::ImfManager() );
- }
- return mToolkitImfManager;
-}
-
-ImfManager::ImfManager( /*Ecore_X_Window ecoreXwin*/ )
-: mIMFCursorPosition( 0 ),
- mSurroundingText(),
- mRestoreAfterFocusLost( false ),
- mIdleCallbackConnected( false )
-{
- CreateContext( /*ecoreXwin*/ );
- ConnectCallbacks();
-}
-
-ImfManager::~ImfManager()
-{
- DisconnectCallbacks();
- DeleteContext();
-}
-
-void ImfManager::CreateContext( /*Ecore_X_Window ecoreXwin*/ )
-{
-}
-
-void ImfManager::DeleteContext()
-{
-}
-
-// Callbacks for predicitive text support.
-void ImfManager::ConnectCallbacks()
-{
-}
-
-void ImfManager::DisconnectCallbacks()
-{
-}
-
-void ImfManager::Activate()
-{
-}
-
-void ImfManager::Deactivate()
-{
-}
-
-void ImfManager::Reset()
-{
-}
-
-bool ImfManager::RestoreAfterFocusLost() const
-{
- return mRestoreAfterFocusLost;
-}
-
-void ImfManager::SetRestoreAfterFocusLost( bool toggle )
-{
- mRestoreAfterFocusLost = toggle;
-}
-
-void ImfManager::NotifyCursorPosition()
-{
-}
-
-void ImfManager::SetCursorPosition( unsigned int cursorPosition )
-{
- mIMFCursorPosition = static_cast< int >( cursorPosition );
-}
-
-unsigned int ImfManager::GetCursorPosition() const
-{
- return static_cast<unsigned int>( mIMFCursorPosition );
-}
-
-void ImfManager::SetSurroundingText( const std::string& text )
-{
- mSurroundingText = text;
-}
-
-const std::string& ImfManager::GetSurroundingText() const
-{
- return mSurroundingText;
-}
-
-void ImfManager::ApplyOptions( const InputMethodOptions& options )
-{
-}
-
-} // Adaptor
-
-} // Internal
-
-
-/********************************************************************************/
-/********************************* PUBLIC CLASS *******************************/
-/********************************************************************************/
-
-ImfManager::ImfManager()
-{
-}
-
-ImfManager::~ImfManager()
-{
-}
-
-ImfManager ImfManager::Get()
-{
- return Internal::Adaptor::ImfManager::Get();
-}
-
-void ImfManager::Activate()
-{
- Internal::Adaptor::ImfManager::GetImplementation(*this).Activate();
-}
-
-void ImfManager::Deactivate()
-{
- Internal::Adaptor::ImfManager::GetImplementation(*this).Deactivate();
-}
-
-bool ImfManager::RestoreAfterFocusLost() const
-{
- return Internal::Adaptor::ImfManager::GetImplementation(*this).RestoreAfterFocusLost();
-}
-
-void ImfManager::SetRestoreAfterFocusLost( bool toggle )
-{
- Internal::Adaptor::ImfManager::GetImplementation(*this).SetRestoreAfterFocusLost( toggle );
-}
-
-void ImfManager::Reset()
-{
- Internal::Adaptor::ImfManager::GetImplementation(*this).Reset();
-}
-
-void ImfManager::NotifyCursorPosition()
-{
- Internal::Adaptor::ImfManager::GetImplementation(*this).NotifyCursorPosition();
-}
-
-void ImfManager::SetCursorPosition( unsigned int SetCursorPosition )
-{
- Internal::Adaptor::ImfManager::GetImplementation(*this).SetCursorPosition( SetCursorPosition );
-}
-
-unsigned int ImfManager::GetCursorPosition() const
-{
- return Internal::Adaptor::ImfManager::GetImplementation(*this).GetCursorPosition();
-}
-
-void ImfManager::SetSurroundingText( const std::string& text )
-{
- Internal::Adaptor::ImfManager::GetImplementation(*this).SetSurroundingText( text );
-}
-
-const std::string& ImfManager::GetSurroundingText() const
-{
- return Internal::Adaptor::ImfManager::GetImplementation(*this).GetSurroundingText();
-}
-
-void ImfManager::NotifyTextInputMultiLine( bool multiLine )
-{
-}
-
-void ImfManager::ApplyOptions( const InputMethodOptions& options )
-{
- Internal::Adaptor::ImfManager::GetImplementation(*this).ApplyOptions( options );
-}
-
-ImfManager::ImfManagerSignalType& ImfManager::ActivatedSignal()
-{
- return Internal::Adaptor::ImfManager::GetImplementation(*this).ActivatedSignal();
-}
-
-ImfManager::ImfEventSignalType& ImfManager::EventReceivedSignal()
-{
- 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)
-{
-}
-
-} // namespace Dali
--- /dev/null
+/*
+ * Copyright (c) 2018 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 "toolkit-input-method-context.h"
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/base-object.h>
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+class RenderSurface;
+
+
+class InputMethodContext : public Dali::BaseObject
+{
+public:
+ typedef Dali::InputMethodContext::ActivatedSignalType ActivatedSignalType;
+ typedef Dali::InputMethodContext::KeyboardEventSignalType KeyboardEventSignalType;
+ typedef Dali::InputMethodContext::StatusSignalType StatusSignalType;
+ typedef Dali::InputMethodContext::VoidSignalType VoidSignalType;
+
+public:
+ static Dali::InputMethodContext New();
+
+ InputMethodContext( /* Ecore_X_Window ecoreXwin */ );
+ void Finalize();
+ void ConnectCallbacks();
+ void DisconnectCallbacks();
+ void Activate();
+ void Deactivate();
+ void Reset();
+
+ bool RestoreAfterFocusLost() const;
+ void SetRestoreAfterFocusLost( bool toggle );
+ void NotifyCursorPosition();
+ void SetCursorPosition( unsigned int cursorPosition );
+ unsigned int GetCursorPosition() const;
+ void SetSurroundingText( const std::string& text );
+ const std::string& GetSurroundingText() const;
+ void ApplyOptions( const InputMethodOptions& options );
+ bool FilterEventKey( const Dali::KeyEvent& keyEvent );
+
+public: // Signals
+ ActivatedSignalType& ActivatedSignal() { return mActivatedSignal; }
+ KeyboardEventSignalType& EventReceivedSignal() { return mEventSignal; }
+ StatusSignalType& StatusChangedSignal() { return mKeyboardStatusSignal; }
+ VoidSignalType& ResizedSignal() { return mKeyboardResizeSignal; }
+ VoidSignalType& LanguageChangedSignal() { return mKeyboardLanguageChangedSignal; }
+
+protected:
+ virtual ~InputMethodContext();
+
+private:
+ void CreateContext( /*Ecore_X_Window ecoreXwin*/ );
+ void DeleteContext();
+
+private:
+ // Undefined
+ InputMethodContext( const InputMethodContext& );
+ InputMethodContext& operator=( InputMethodContext& );
+
+private:
+ int mIMFCursorPosition;
+ std::string mSurroundingText;
+ 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;
+
+ ActivatedSignalType mActivatedSignal;
+ KeyboardEventSignalType mEventSignal;
+ StatusSignalType mKeyboardStatusSignal;
+ VoidSignalType mKeyboardResizeSignal;
+ VoidSignalType mKeyboardLanguageChangedSignal;
+
+ static Dali::InputMethodContext mToolkitInputMethodContext;
+
+public:
+
+inline static Internal::Adaptor::InputMethodContext& GetImplementation(Dali::InputMethodContext& inputMethodContext)
+{
+ BaseObject& handle = inputMethodContext.GetBaseObject();
+ return static_cast<Internal::Adaptor::InputMethodContext&>(handle);
+}
+
+inline static const Internal::Adaptor::InputMethodContext& GetImplementation(const Dali::InputMethodContext& inputMethodContext)
+{
+ const BaseObject& handle = inputMethodContext.GetBaseObject();
+ return static_cast<const Internal::Adaptor::InputMethodContext&>(handle);
+}
+
+};
+
+Dali::InputMethodContext Dali::Internal::Adaptor::InputMethodContext::mToolkitInputMethodContext;
+
+Dali::InputMethodContext InputMethodContext::New()
+{
+ if( ! mToolkitInputMethodContext )
+ {
+ mToolkitInputMethodContext = Dali::InputMethodContext( new Dali::Internal::Adaptor::InputMethodContext() );
+ }
+ return mToolkitInputMethodContext;
+}
+
+InputMethodContext::InputMethodContext( /*Ecore_X_Window ecoreXwin*/ )
+: mIMFCursorPosition( 0 ),
+ mSurroundingText(),
+ mRestoreAfterFocusLost( false ),
+ mIdleCallbackConnected( false )
+{
+ CreateContext( /*ecoreXwin*/ );
+ ConnectCallbacks();
+}
+
+InputMethodContext::~InputMethodContext()
+{
+ DisconnectCallbacks();
+ DeleteContext();
+}
+
+void InputMethodContext::Finalize()
+{
+}
+
+void InputMethodContext::CreateContext( /*Ecore_X_Window ecoreXwin*/ )
+{
+}
+
+void InputMethodContext::DeleteContext()
+{
+}
+
+// Callbacks for predicitive text support.
+void InputMethodContext::ConnectCallbacks()
+{
+}
+
+void InputMethodContext::DisconnectCallbacks()
+{
+}
+
+void InputMethodContext::Activate()
+{
+}
+
+void InputMethodContext::Deactivate()
+{
+}
+
+void InputMethodContext::Reset()
+{
+}
+
+bool InputMethodContext::RestoreAfterFocusLost() const
+{
+ return mRestoreAfterFocusLost;
+}
+
+void InputMethodContext::SetRestoreAfterFocusLost( bool toggle )
+{
+ mRestoreAfterFocusLost = toggle;
+}
+
+void InputMethodContext::NotifyCursorPosition()
+{
+}
+
+void InputMethodContext::SetCursorPosition( unsigned int cursorPosition )
+{
+ mIMFCursorPosition = static_cast< int >( cursorPosition );
+}
+
+unsigned int InputMethodContext::GetCursorPosition() const
+{
+ return static_cast<unsigned int>( mIMFCursorPosition );
+}
+
+void InputMethodContext::SetSurroundingText( const std::string& text )
+{
+ mSurroundingText = text;
+}
+
+const std::string& InputMethodContext::GetSurroundingText() const
+{
+ return mSurroundingText;
+}
+
+void InputMethodContext::ApplyOptions( const InputMethodOptions& options )
+{
+}
+
+bool InputMethodContext::FilterEventKey( const Dali::KeyEvent& keyEvent )
+{
+ return false;
+}
+} // Adaptor
+
+} // Internal
+
+
+/********************************************************************************/
+/********************************* PUBLIC CLASS *******************************/
+/********************************************************************************/
+
+InputMethodContext::InputMethodContext()
+{
+}
+
+InputMethodContext::~InputMethodContext()
+{
+}
+
+InputMethodContext InputMethodContext::New()
+{
+ return Internal::Adaptor::InputMethodContext::New();
+}
+
+void InputMethodContext::Finalize()
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).Finalize();
+}
+
+void InputMethodContext::Activate()
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).Activate();
+}
+
+void InputMethodContext::Deactivate()
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).Deactivate();
+}
+
+bool InputMethodContext::RestoreAfterFocusLost() const
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).RestoreAfterFocusLost();
+}
+
+void InputMethodContext::SetRestoreAfterFocusLost( bool toggle )
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetRestoreAfterFocusLost( toggle );
+}
+
+void InputMethodContext::Reset()
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).Reset();
+}
+
+void InputMethodContext::NotifyCursorPosition()
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).NotifyCursorPosition();
+}
+
+void InputMethodContext::SetCursorPosition( unsigned int SetCursorPosition )
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetCursorPosition( SetCursorPosition );
+}
+
+unsigned int InputMethodContext::GetCursorPosition() const
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetCursorPosition();
+}
+
+void InputMethodContext::SetSurroundingText( const std::string& text )
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetSurroundingText( text );
+}
+
+const std::string& InputMethodContext::GetSurroundingText() const
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetSurroundingText();
+}
+
+void InputMethodContext::NotifyTextInputMultiLine( bool multiLine )
+{
+}
+
+void InputMethodContext::ApplyOptions( const InputMethodOptions& options )
+{
+ Internal::Adaptor::InputMethodContext::GetImplementation(*this).ApplyOptions( options );
+}
+
+bool InputMethodContext::FilterEventKey( const Dali::KeyEvent& keyEvent )
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey( keyEvent );
+}
+
+InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal()
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal();
+}
+
+InputMethodContext::KeyboardEventSignalType& InputMethodContext::EventReceivedSignal()
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).EventReceivedSignal();
+}
+
+InputMethodContext::StatusSignalType& InputMethodContext::StatusChangedSignal()
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).StatusChangedSignal();
+}
+
+InputMethodContext::VoidSignalType& InputMethodContext::ResizedSignal()
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ResizedSignal();
+}
+
+InputMethodContext::VoidSignalType& InputMethodContext::LanguageChangedSignal()
+{
+ return Internal::Adaptor::InputMethodContext::GetImplementation(*this).LanguageChangedSignal();
+}
+
+InputMethodContext::InputMethodContext(Internal::Adaptor::InputMethodContext *impl)
+ : BaseHandle(impl)
+{
+}
+
+} // namespace Dali
-#ifndef __DALI_TOOLKIT_TOOLKIT_IMF_MANAGER_H__
-#define __DALI_TOOLKIT_TOOLKIT_IMF_MANAGER_H__
+#ifndef __DALI_TOOLKIT_TOOLKIT_INPUT_METHOD_CONTEXT_H__
+#define __DALI_TOOLKIT_TOOLKIT_INPUT_METHOD_CONTEXT_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
// EXTERNAL INCLUDES
-#define __DALI_IMF_MANAGER_H__
+#define __DALI_INPUT_METHOD_CONTEXT_H__
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/dali-signal.h>
#include <dali/devel-api/adaptor-framework/input-method-options.h>
+#include <dali/public-api/events/key-event.h>
namespace Dali DALI_IMPORT_API
{
{
namespace Adaptor
{
-class ImfManager;
+class InputMethodContext;
}
}
/**
- * @brief The ImfManager class
+ * @brief The InputMethodContext class
*
* Specifically manages the ecore input method framework which enables the virtual or hardware keyboards.
*/
-class ImfManager : public BaseHandle
+class InputMethodContext : public BaseHandle
{
public:
/**
- * @brief Events that are generated by the IMF.
+ * @brief Events that are generated by the input method context.
*/
- enum ImfEvent
+ enum EventType
{
VOID, ///< No event
- PREEDIT, ///< Pre-Edit changed
+ PRE_EDIT, ///< Pre-Edit changed
COMMIT, ///< Commit recieved
- DELETESURROUNDING, ///< Event to delete a range of characters from the string
- GETSURROUNDING, ///< Event to query string and cursor position
- PRIVATECOMMAND ///< Private command sent from the input panel
+ DELETE_SURROUNDING, ///< Event to delete a range of characters from the string
+ GET_SURROUNDING, ///< Event to query string and cursor position
+ PRIVATE_COMMAND ///< Private command sent from the input panel
};
/**
- * @brief This structure is used to pass on data from the IMF regarding predictive text.
+ * @brief This structure is used to pass on data from the input method cotext regarding predictive text.
*/
- struct ImfEventData
+ struct EventData
{
/**
* @brief Default Constructor.
*/
- ImfEventData()
+ EventData()
: predictiveString(),
eventName( VOID ),
cursorOffset( 0 ),
/**
* @brief Constructor
*
- * @param[in] aEventName The name of the event from the IMF.
+ * @param[in] aEventName The name of the event from the input method context.
* @param[in] aPredictiveString The pre-edit or commit string.
* @param[in] aCursorOffset Start position from the current cursor position to start deleting characters.
* @param[in] aNumberOfChars The number of characters to delete from the cursorOffset.
*/
- ImfEventData( ImfEvent aEventName, const std::string& aPredictiveString, int aCursorOffset, int aNumberOfChars )
+ EventData( EventType aEventName, const std::string& aPredictiveString, int aCursorOffset, int aNumberOfChars )
: predictiveString( aPredictiveString ),
eventName( aEventName ),
cursorOffset( aCursorOffset ),
// Data
std::string predictiveString; ///< The pre-edit or commit string.
- ImfEvent eventName; ///< The name of the event from the IMF.
+ EventType eventName; ///< The name of the event from the input method context.
int cursorOffset; ///< Start position from the current cursor position to start deleting characters.
int numberOfChars; ///< number of characters to delete from the cursorOffset.
};
/**
- * @brief Data required by IMF from the callback
+ * @brief Data required by input method context from the callback
*/
- struct ImfCallbackData
+ struct CallbackData
{
/**
* @brief Constructor
*/
- ImfCallbackData()
+ CallbackData()
: currentText(),
cursorPosition( 0 ),
update( false ),
* @param[in] aCurrentText current text string
* @param[in] aPreeditResetRequired flag if preedit reset is required.
*/
- ImfCallbackData( bool aUpdate, int aCursorPosition, const std::string& aCurrentText, bool aPreeditResetRequired )
+ CallbackData( bool aUpdate, int aCursorPosition, const std::string& aCurrentText, bool aPreeditResetRequired )
: currentText( aCurrentText ),
cursorPosition( aCursorPosition ),
update( aUpdate ),
bool preeditResetRequired :1; ///< flag if preedit reset is required.
};
- typedef Signal< void (ImfManager&) > ImfManagerSignalType; ///< Keyboard actived signal
- typedef Signal< ImfCallbackData ( ImfManager&, const ImfEventData& ) > ImfEventSignalType; ///< keyboard events
+ typedef Signal< void (InputMethodContext&) > ActivatedSignalType; ///< Keyboard actived signal
+ typedef Signal< CallbackData ( InputMethodContext&, const EventData& ) > KeyboardEventSignalType; ///< keyboard events
typedef Signal< void () > VoidSignalType;
typedef Signal< void (bool) > StatusSignalType;
public:
/**
- * @brief Retrieve a handle to the instance of ImfManager.
- * @return A handle to the ImfManager.
+ * @brief Create a handle to the instance of InputMethodContext.
+ * @return A handle to the InputMethodContext.
*/
- static ImfManager Get();
+ static InputMethodContext New();
/**
- * @brief Activate the IMF.
+ * @brief Finalize the InputMethodContext.
+ *
+ * It means that the context will be deleted.
+ */
+ void Finalize();
+
+ /**
+ * @brief Activate the input method context.
*
* It means that the text editing is started at somewhere.
* If the H/W keyboard isn't connected then it will show the virtual keyboard.
void Activate();
/**
- * @brief Deactivate the IMF.
+ * @brief Deactivate the input method context.
*
* It means that the text editing is finished at somewhere.
*/
bool RestoreAfterFocusLost() const;
/**
- * @brief Set status whether the IMF has to restore the keyboard after losing focus.
+ * @brief Set status whether the input method context has to restore the keyboard after losing focus.
*
* @param[in] toggle True means that keyboard should be restored after focus lost and regained.
*/
void SetRestoreAfterFocusLost( bool toggle );
/**
- * @brief Send message reset the pred-edit state / imf module.
+ * @brief Send message reset the pred-edit state / input method context module.
*
* Used to interupt pre-edit state maybe due to a touch input.
*/
void Reset();
/**
- * @brief Notifies IMF context that the cursor position has changed, required for features like auto-capitalisation.
+ * @brief Notifies ImfContext that the cursor position has changed, required for features like auto-capitalisation.
*/
void NotifyCursorPosition();
/**
- * @brief Sets cursor position stored in VirtualKeyboard, this is required by the IMF context.
+ * @brief Sets cursor position stored in VirtualKeyboard, this is required by the ImfContext.
*
* @param[in] cursorPosition position of cursor
*/
void SetCursorPosition( unsigned int cursorPosition );
/**
- * @brief Gets cursor position stored in VirtualKeyboard, this is required by the IMF context.
+ * @brief Gets cursor position stored in VirtualKeyboard, this is required by the ImfContext.
*
* @return current position of cursor
*/
unsigned int GetCursorPosition() const;
/**
- * @brief Method to store the string required by the IMF, this is used to provide predictive word suggestions.
+ * @brief Method to store the string required by the input method context, this is used to provide predictive word suggestions.
*
* @param[in] text The text string surrounding the current cursor point.
*/
void SetSurroundingText( const std::string& text );
/**
- * @brief Gets current text string set within the IMF manager, this is used to offer predictive suggestions.
+ * @brief Gets current text string set within the input method context, this is used to offer predictive suggestions.
*
* @return current position of cursor
*/
const std::string& GetSurroundingText() const;
/**
- * @brief Notifies IMF context that text input is set to multi line or not
+ * @brief Notifies ImfContext that text input is set to multi line or not
*/
void NotifyTextInputMultiLine( bool multiLine );
*/
void ApplyOptions( const InputMethodOptions& options );
+ /**
+ * @brief Process event key down or up, whether filter a key to isf.
+ *
+ * @param[in] keyEvent The event key to be handled.
+ * @return Whether the event key is handled.
+ */
+ bool FilterEventKey( const Dali::KeyEvent& keyEvent );
+
public:
// Signals
/**
* @brief This is emitted when the virtual keyboard is connected to or the hardware keyboard is activated.
*
- * @return The IMF Activated signal.
+ * @return The input method context Activated signal.
*/
- ImfManagerSignalType& ActivatedSignal();
+ ActivatedSignalType& ActivatedSignal();
/**
- * @brief This is emitted when the IMF manager receives an event from the IMF.
+ * @brief This is emitted when the input method context receives an event.
*
* @return The Event signal containing the event data.
*/
- ImfEventSignalType& EventReceivedSignal();
+ KeyboardEventSignalType& EventReceivedSignal();
/**
* @brief Connect to this signal to be notified when the virtual keyboard is shown or hidden.
/**
* @brief Constructor.
*/
- ImfManager();
+ InputMethodContext();
/**
* @brief Destructor
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
*/
- ~ImfManager();
+ ~InputMethodContext();
/**
- * @brief This constructor is used by ImfManager::Get().
+ * @brief This constructor is used by InputMethodContext::Get().
*
- * @param[in] imfManager A pointer to the imf Manager.
+ * @param[in] inputMethodContext A pointer to the input method context.
*/
- explicit ImfManager( Internal::Adaptor::ImfManager* imfManager );
+ explicit InputMethodContext( Internal::Adaptor::InputMethodContext* inputMethodContext );
};
} // namespace Dali
-#endif // __DALI_TOOLKIT_TOOLKIT_IMF_MANAGER_H__
+#endif // __DALI_TOOLKIT_TOOLKIT_INPUT_METHOD_CONTEXT_H__
manager.SetFocus( dummy3 );
DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained );
- Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", Device::Class::TOUCH, Device::Subclass::NONE );
+ Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", "", Device::Class::TOUCH, Device::Subclass::NONE );
application.ProcessEvent(event);
DALI_TEST_CHECK( callback1.mIsCalled );
manager.SetFocus( dummy3 );
DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained );
- Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", Device::Class::TOUCH, Device::Subclass::NONE );
+ Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "", "", Device::Class::TOUCH, Device::Subclass::NONE );
application.ProcessEvent(event);
DALI_TEST_CHECK( !callback1.mIsCalled );
FocusedActorActivatedCallback focusedActorActivatedCallback(focusedActorActivatedSignalVerified);
manager.FocusedActorEnterKeySignal().Connect( &focusedActorActivatedCallback, &FocusedActorActivatedCallback::Callback );
- Integration::KeyEvent returnEvent( "Return", "", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent returnEvent( "Return", "", 0, 0, 0, Integration::KeyEvent::Up, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
// Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
// It makes mIsFocusIndicatorEnabled true
FocusGroupChangedCallback focusGroupChangedCallback(focusGroupChangedSignalVerified);
manager.FocusGroupChangedSignal().Connect( &focusGroupChangedCallback, &FocusGroupChangedCallback::Callback );
- Integration::KeyEvent tabEvent( "Tab", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent shiftTabEvent( "Tab", "", 0, 1, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent tabEvent( "Tab", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent shiftTabEvent( "Tab", "", 0, 1, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
// Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
// It makes mIsFocusIndicatorEnabled true
FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
- Integration::KeyEvent leftEvent( "Left", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent rightEvent( "Right", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent upEvent( "Up", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent downEvent( "Down", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent pageUpEvent( "Prior", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent pageDownEvent( "Next", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent leftEvent( "Left", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent rightEvent( "Right", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent upEvent( "Up", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent downEvent( "Down", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent pageUpEvent( "Prior", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent pageDownEvent( "Next", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
// Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
// It makes mIsFocusIndicatorEnabled true
int keyModifier,
unsigned long timeStamp,
const Integration::KeyEvent::State& keyState,
+ const std::string& compose = "",
const std::string& deviceName = "",
const Device::Class::Type& deviceClass = Device::Class::NONE,
const Device::Subclass::Type& deviceSubclass = Device::Subclass::NONE
keyModifier,
timeStamp,
keyState,
+ compose,
deviceName,
deviceClass,
deviceSubclass );
popup.SetKeyInputFocus();
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", Device::Class::TOUCH, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", "", Device::Class::TOUCH, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
int keyModifier,
unsigned long timeStamp,
const Integration::KeyEvent::State& keyState,
+ const std::string& compose = "",
const std::string& deviceName = DEFAULT_DEVICE_NAME,
const Device::Class::Type& deviceClass = Device::Class::NONE,
const Device::Subclass::Type& deviceSubclass = Device::Subclass::NONE )
keyModifier,
timeStamp,
keyState,
+ compose,
deviceName,
deviceClass,
deviceSubclass );
editor.SetKeyInputFocus();
gTextChangedCallBackCalled = false;
- application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
DALI_TEST_CHECK( gTextChangedCallBackCalled );
END_TEST;
gInputStyleMask = TextEditor::InputStyle::NONE;
inputStyleChangedSignal = false;
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
gInputStyleMask = TextEditor::InputStyle::NONE;
inputStyleChangedSignal = false;
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
gInputStyleMask = TextEditor::InputStyle::NONE;
inputStyleChangedSignal = false;
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
editor.SetProperty( TextEditor::Property::INPUT_EMBOSS, "emboss" );
editor.SetProperty( TextEditor::Property::INPUT_OUTLINE, "outline" );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Add a key event but as the text editor has not the focus it should do nothing.
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Now the text editor has the focus, so it can handle the key events.
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// The second text editor has the focus. It should handle the key events.
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
// Now the text editor has the focus, so it can handle the key events.
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
// Move the cursor and check the position changes.
Vector3 position1 = cursor.GetCurrentPosition();
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_CHECK( position2.x < position1.x );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_CHECK( position5.x > position4.x );
// Remove all the text.
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
editor.SetProperty( TextEditor::Property::TEXT, "" );
// Render and notify
application.Render();
// Move at the end of the text.
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
for( unsigned int index = 0u; index < 10u; ++index )
{
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
}
// Add a character
- application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( "Hello\nworld", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
// Add some key events
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_UP, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
for( unsigned int index = 0u; index < 10u; ++index )
{
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
}
// Add a character
- application.ProcessEvent( GenerateKey( " ", " ", KEY_WHITE_SPACE_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( " ", " ", KEY_WHITE_SPACE_CODE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Move at the end of the text.
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
for( unsigned int index = 0u; index < 10u; ++index )
{
// Add a character
- application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
// Continuous scroll left to increase coverage
for( unsigned int index = 0u; index < 10u; ++index )
{
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( editor.GetProperty<float>( TextEditor::Property::SCROLL_BAR_FADE_DURATION ), 0.2f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
// Press Escape to increase coverage
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
application.Render();
// Move to seconds line of the text.
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
// Add another script characters ( glyph height is defferent )
- application.ProcessEvent( GenerateKey( "d", "ㅁ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "d", "ኢ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "ㅁ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "ㅁ", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "ኢ", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "ኢ", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Delete characters
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
DALI_TEST_EQUALS( layoutHeight, editor.GetHeightForWidth( 100.f ), TEST_LOCATION );
DALI_TEST_EQUALS( "Hello\nworld\nHello world", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
// For coverage
- application.ProcessEvent( GenerateKey( "", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", 0, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_VOLUME_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_VOLUME_UP, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_VOLUME_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_VOLUME_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
- application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
- application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
- application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
application.Render();
// Move to second line of the text.
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Select some text in the right of the current cursor position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Cut the selected text
- application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, "x", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( "Hello\nld\nHello world", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
// Select some text in the left of the current cursor position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "",DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Copy the selected text
- application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, "c", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Move the cursor to the third line
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Paste the selected text at the current cursor position
- application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "v", "v", KEY_V_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "v", "v", KEY_V_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, "v", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
editor.SetProperty( DevelTextEditor::Property::ENABLE_SHIFT_SELECTION, false );
// Test to select some text in the right of the current cursor position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Cut the selected text
- application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, "x", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( "Hello\nld\nHello lo\nworld", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
// Test to select some text in the left of the current cursor position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Copy the selected text
- application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::Down, "c", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
// When the left selection handle and the right selection handle are at the same position, the highlight box should be deactivated.
// Test to select some text in the left of the current cursor position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Test to the left selection handle position and the right selection handle position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Test to select full text in the left of the current cursor position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Test to release the current full text selection
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Test to move the current cursor position correctly
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Add a character
- application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( "DdALi", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
// Test to select some text in the right of the current cursor position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Test the cursor position with right arrow key
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Add a character
- application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, "c", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( "DdALci", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
// Test to select some text in the left of the current cursor position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Test the cursor position with left arrow key
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Add a character
- application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, "c", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( "DcdALci", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
// Test to select some text in the right of the current cursor position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Test the cursor position with left arrow key
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Add a character
- application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "x", "x", KEY_X_CODE, 0, 0, Integration::KeyEvent::Down, "x", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( "DcxdALci", editor.GetProperty<std::string>( TextEditor::Property::TEXT ), TEST_LOCATION );
// Test to select some text in the left of the current cursor position
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, KEY_SHIFT_MODIFIER, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Test the cursor position with right arrow key
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Add a character
- application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "c", "c", KEY_C_CODE, 0, 0, Integration::KeyEvent::Down, "c", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
END_TEST;
}
+
+int UtcDaliTextEditorGetInputMethodContext(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliTextEditorGetInputMethodContext");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( DevelTextEditor::GetInputMethodContext( editor ) );
+
+ END_TEST;
+}
int keyModifier,
unsigned long timeStamp,
const Integration::KeyEvent::State& keyState,
+ const std::string& compose = "",
const std::string& deviceName = DEFAULT_DEVICE_NAME,
const Device::Class::Type& deviceClass = Device::Class::NONE,
const Device::Subclass::Type& deviceSubclass = Device::Subclass::NONE )
keyModifier,
timeStamp,
keyState,
+ compose,
deviceName,
deviceClass,
deviceSubclass );
field.SetKeyInputFocus();
gTextChangedCallBackCalled = false;
- application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "D", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
DALI_TEST_CHECK( gTextChangedCallBackCalled );
END_TEST;
gMaxCharactersCallBackCalled = false;
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
DALI_TEST_CHECK( gMaxCharactersCallBackCalled );
DALI_TEST_CHECK( maxLengthReachedSignal );
gMaxCharactersCallBackCalled = false;
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
DALI_TEST_CHECK( !gMaxCharactersCallBackCalled );
DALI_TEST_CHECK( !maxLengthReachedSignal );
- application.ProcessEvent( GenerateKey( "Return", "\r", KEY_RETURN_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "Return", "\r", KEY_RETURN_CODE, 0, 0, Integration::KeyEvent::Down, "\r", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
DALI_TEST_CHECK( !gMaxCharactersCallBackCalled );
DALI_TEST_CHECK( !maxLengthReachedSignal );
gInputStyleMask = TextField::InputStyle::NONE;
inputStyleChangedSignal = false;
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
gInputStyleMask = TextField::InputStyle::NONE;
inputStyleChangedSignal = false;
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
gInputStyleMask = TextField::InputStyle::NONE;
inputStyleChangedSignal = false;
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Add a key event but as the text field has not the focus it should do nothing.
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Pressing delete key should be fine even if there is no text in TextField.
- application.ProcessEvent( GenerateKey( "Delete", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "Delete", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::Down, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Now the text field has the focus, so it can handle the key events.
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// The second text field has the focus. It should handle the key events.
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );
// Now the text field has the focus, so it can handle the key events.
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
// Move the cursor and check the position changes.
Vector3 position1 = cursor.GetCurrentPosition();
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_CHECK( position2.x < position1.x );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_CHECK( position5.x > position4.x );
// Remove all the text.
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
field.SetProperty( TextField::Property::TEXT, "" );
// Render and notify
Property::Map map;
map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::HIDE_NONE;
field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map );
- application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::HIDE_ALL;
map[ HiddenInput::Property::SUBSTITUTE_CHARACTER ] = 0x23;
field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map );
- application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map );
for( unsigned int index = 0u; index < 5u; ++index )
{
- application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
}
field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map );
for( unsigned int index = 0u; index < 5u; ++index )
{
- application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
}
map[ HiddenInput::Property::MODE ] = HiddenInput::Mode::SHOW_LAST_CHARACTER;
map[ HiddenInput::Property::SHOW_LAST_CHARACTER_DURATION ] = 0;
field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
- application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
map[ HiddenInput::Property::SHOW_LAST_CHARACTER_DURATION ] = 100;
field.SetProperty( TextField::Property::HIDDEN_INPUT_SETTINGS, map );
- application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", 0, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
// Press Escape to increase coverage
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
application.Render();
// Add a key event but as the text field has not the focus it should do nothing.
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Now the text field has the focus, so it can handle the key events.
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Down, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "d", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::Up, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string("ad"), TEST_LOCATION );
// Generate a Esc key event. The text field should lose the focus.
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( false, field.HasKeyInputFocus(), TEST_LOCATION );
// No more text should be introduced
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Generate a Esc key event. The text field should lose the focus.
- application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Down, "XF86PowerOff", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "XF86PowerOff", "XF86PowerOff", DALI_KEY_POWER, 0, 0, Integration::KeyEvent::Up, "XF86PowerOff", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Generate a Esc key event. The text field should lose the focus.
- application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Down, "XF86Menu", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "XF86Menu", "XF86Menu", DALI_KEY_MENU, 0, 0, Integration::KeyEvent::Up, "XF86Menu", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
application.Render();
// Generate a Esc key event. The text field should lose the focus.
- application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Down, "XF86Home", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "XF86Home", "XF86Home", DALI_KEY_HOME, 0, 0, Integration::KeyEvent::Up, "XF86Home", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( previousHeight, field.GetProperty<float>( Actor::Property::SIZE_HEIGHT ) , TEST_LOCATION );
// Add another script characters ( glyph height is defferent )
- application.ProcessEvent( GenerateKey( "ㅁ", "ㅁ", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
- application.ProcessEvent( GenerateKey( "ㅁ", "ㅁ", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "ㅁ", "ㅁ", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, "ㅁ", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
+ application.ProcessEvent( GenerateKey( "ㅁ", "ㅁ", KEY_A_CODE, 0, 0, Integration::KeyEvent::Up, "ㅁ", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
application.SendNotification();
application.Render();
END_TEST;
}
+
+int UtcDaliTextFieldGetInputMethodContext(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliTextFieldGetInputMethodContext");
+
+ TextField field = TextField::New();
+ DALI_TEST_CHECK( DevelTextField::GetInputMethodContext( field ) );
+
+ END_TEST;
+}
controlDataImpl.DoAction( visualIndex, actionId, attributes );
}
+void SetInputMethodContext( Internal::Control& control, InputMethodContext& inputMethodContext )
+{
+ Internal::Control::Impl::Get( control ).SetInputMethodContext( inputMethodContext );
+}
+
} // namespace DevelControl
} // namespace Toolkit
* limitations under the License.
*
*/
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/input-method-context.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
*/
DALI_IMPORT_API void DoAction( Control& control, Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes );
+/**
+ * @brief Set input method context.
+ *
+ * @param[in] control The control.
+ * @param[in] inputMethodContext The input method context.
+ */
+DALI_IMPORT_API void SetInputMethodContext( Internal::Control& control, InputMethodContext& inputMethodContext );
+
} // namespace DevelControl
} // namespace Toolkit
--- /dev/null
+#ifndef DALI_TOOLKIT_TEXT_EDITOR_DEVEL_H
+#define DALI_TOOLKIT_TEXT_EDITOR_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
+#include <dali-toolkit/internal/controls/text-controls/text-editor-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelTextEditor
+{
+
+InputMethodContext GetInputMethodContext( TextEditor textEditor )
+{
+ return GetImpl( textEditor ).GetInputMethodContext();
+}
+
+} // namespace DevelTextEditor
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_EDITOR_DEVEL_H
* limitations under the License.
*
*/
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/input-method-context.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
} // namespace Property
+/**
+ * @brief Return the input method context of TextEditor.
+ *
+ * @param[in] textEditor The instance of TextEditor.
+ * @return InputMethodContext instance.
+ */
+DALI_IMPORT_API InputMethodContext GetInputMethodContext( TextEditor textEditor );
+
} // namespace DevelTextEditor
} // namespace Toolkit
--- /dev/null
+#ifndef DALI_TOOLKIT_TEXT_FIELD_DEVEL_H
+#define DALI_TOOLKIT_TEXT_FIELD_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/text-controls/text-field-devel.h>
+#include <dali-toolkit/internal/controls/text-controls/text-field-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelTextField
+{
+
+InputMethodContext GetInputMethodContext( TextField textField )
+{
+ return GetImpl( textField ).GetInputMethodContext();
+}
+
+} // namespace DevelText
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_FIELD_DEVEL_H
* limitations under the License.
*
*/
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/input-method-context.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/text-controls/text-field.h>
};
} // namespace Property
+/**
+ * @brief Return the input method context of TextField.
+ *
+ * @param[in] textField The instance of TextField.
+ * @return InputMethodContext instance.
+ */
+DALI_IMPORT_API InputMethodContext GetInputMethodContext( TextField textField );
+
} // namespace DevelText
} // namespace Toolkit
$(devel_api_src_dir)/controls/popup/popup.cpp \
$(devel_api_src_dir)/controls/shadow-view/shadow-view.cpp \
$(devel_api_src_dir)/controls/super-blur-view/super-blur-view.cpp \
+ $(devel_api_src_dir)/controls/text-controls/text-editor-devel.cpp \
+ $(devel_api_src_dir)/controls/text-controls/text-field-devel.cpp \
$(devel_api_src_dir)/controls/text-controls/text-selection-popup.cpp \
$(devel_api_src_dir)/controls/text-controls/text-selection-toolbar.cpp \
$(devel_api_src_dir)/controls/tool-bar/tool-bar.cpp \
mIsKeyboardNavigationSupported( false ),
mIsKeyboardFocusGroup( false )
{
-
}
Control::Impl::~Impl()
return mControlImpl.mImpl->mPadding;
}
+void Control::Impl::SetInputMethodContext( InputMethodContext& inputMethodContext )
+{
+ mInputMethodContext = inputMethodContext;
+}
+
+bool Control::Impl::FilterKeyEvent( const KeyEvent& event )
+{
+ bool consumed ( false );
+
+ if ( mInputMethodContext )
+ {
+ consumed = mInputMethodContext.FilterEventKey( event );
+ }
+ return consumed;
+}
+
} // namespace Internal
} // namespace Toolkit
*/
Extents GetPadding() const;
+ /**
+ * @brief Set the input method context.
+ * @param[in] inputMethodContext The input method context.
+ */
+ void SetInputMethodContext( InputMethodContext& inputMethodContext );
+
+ /**
+ * @brief Filter an key event.
+ * @param[in] event The key to be filtered.
+ * @return True if the key handled, otherwise false.
+ */
+ bool FilterKeyEvent( const KeyEvent& event );
+
private:
/**
// Tooltip
TooltipPtr mTooltip;
+ InputMethodContext mInputMethodContext;
+
ControlBehaviour mFlags : CONTROL_BEHAVIOUR_FLAG_COUNT; ///< Flags passed in from constructor.
bool mIsKeyboardNavigationSupported :1; ///< Stores whether keyboard navigation is supported by the control.
bool mIsKeyboardFocusGroup :1; ///< Stores whether the control is a focus group.
#include <dali-toolkit/internal/text/text-font-style.h>
#include <dali-toolkit/internal/text/text-view.h>
#include <dali-toolkit/internal/styling/style-manager-impl.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
using namespace Dali::Toolkit::Text;
return value;
}
+InputMethodContext TextEditor::GetInputMethodContext()
+{
+ return mInputMethodContext;
+}
+
bool TextEditor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
Dali::BaseHandle handle( object );
mDecorator = Text::Decorator::New( *mController,
*mController );
+ mInputMethodContext = InputMethodContext::New();
+
mController->GetLayoutEngine().SetLayout( Layout::Engine::MULTI_LINE_BOX );
// Enables the text input.
- mController->EnableTextInput( mDecorator );
+ mController->EnableTextInput( mDecorator, mInputMethodContext );
// Enables the vertical scrolling after the text input has been enabled.
mController->SetVerticalScrollEnabled( true );
EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
- mImfManager = ImfManager::Get();
-
self.TouchSignal().Connect( this, &TextEditor::OnTouched );
// Set BoundingBox to stage size if not already set.
self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
self.OnStageSignal().Connect( this, &TextEditor::OnStageConnect );
+ DevelControl::SetInputMethodContext( *this, mInputMethodContext );
+
// Creates an extra control to be used as stencil buffer.
mStencil = Control::New();
mStencil.SetAnchorPoint( AnchorPoint::TOP_LEFT );
void TextEditor::OnKeyInputFocusGained()
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnKeyInputFocusGained %p\n", mController.Get() );
+ if ( mInputMethodContext )
+ {
+ mInputMethodContext.StatusChangedSignal().Connect( this, &TextEditor::KeyboardStatusChanged );
- mImfManager.StatusChangedSignal().Connect( this, &TextEditor::KeyboardStatusChanged );
-
- mImfManager.EventReceivedSignal().Connect( this, &TextEditor::OnImfEvent );
-
- // Notify that the text editing start.
- mImfManager.Activate();
+ mInputMethodContext.EventReceivedSignal().Connect( this, &TextEditor::OnInputMethodContextEvent );
- // When window gain lost focus, the imf manager is deactivated. Thus when window gain focus again, the imf manager must be activated.
- mImfManager.SetRestoreAfterFocusLost( true );
+ // Notify that the text editing start.
+ mInputMethodContext.Activate();
- ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
+ // When window gain lost focus, the InputMethodContext is deactivated. Thus when window gain focus again, the InputMethodContext must be activated.
+ mInputMethodContext.SetRestoreAfterFocusLost( true );
+ }
+ ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
- if ( notifier )
- {
- notifier.ContentSelectedSignal().Connect( this, &TextEditor::OnClipboardTextSelected );
- }
+ if ( notifier )
+ {
+ notifier.ContentSelectedSignal().Connect( this, &TextEditor::OnClipboardTextSelected );
+ }
mController->KeyboardFocusGainEvent(); // Called in the case of no virtual keyboard to trigger this event
void TextEditor::OnKeyInputFocusLost()
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor:OnKeyInputFocusLost %p\n", mController.Get() );
+ if ( mInputMethodContext )
+ {
+ mInputMethodContext.StatusChangedSignal().Disconnect( this, &TextEditor::KeyboardStatusChanged );
- mImfManager.StatusChangedSignal().Disconnect( this, &TextEditor::KeyboardStatusChanged );
-
- // The text editing is finished. Therefore the imf manager don't have restore activation.
- mImfManager.SetRestoreAfterFocusLost( false );
-
- // Notify that the text editing finish.
- mImfManager.Deactivate();
+ // The text editing is finished. Therefore the InputMethodContext don't have restore activation.
+ mInputMethodContext.SetRestoreAfterFocusLost( false );
- mImfManager.EventReceivedSignal().Disconnect( this, &TextEditor::OnImfEvent );
+ // Notify that the text editing finish.
+ mInputMethodContext.Deactivate();
+ mInputMethodContext.EventReceivedSignal().Disconnect( this, &TextEditor::OnInputMethodContextEvent );
+ }
ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
if ( notifier )
void TextEditor::OnTap( const TapGesture& gesture )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnTap %p\n", mController.Get() );
-
- mImfManager.Activate();
-
+ if ( mInputMethodContext )
+ {
+ mInputMethodContext.Activate();
+ }
// Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
Extents padding;
padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
void TextEditor::OnLongPress( const LongPressGesture& gesture )
{
- mImfManager.Activate();
-
+ if ( mInputMethodContext )
+ {
+ mInputMethodContext.Activate();
+ }
Extents padding;
padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
}
}
-ImfManager::ImfCallbackData TextEditor::OnImfEvent( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent )
+InputMethodContext::CallbackData TextEditor::OnInputMethodContextEvent( Dali::InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent )
{
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnImfEvent %p eventName %d\n", mController.Get(), imfEvent.eventName );
- return mController->OnImfEvent( imfManager, imfEvent );
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnInputMethodContextEvent %p eventName %d\n", mController.Get(), inputMethodContextEvent.eventName );
+ return mController->OnInputMethodContextEvent( inputMethodContext, inputMethodContextEvent );
}
void TextEditor::GetHandleImagePropertyValue( Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType )
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
+#include <dali/devel-api/adaptor-framework/input-method-context.h>
#include <dali/public-api/animation/animation.h>
// INTERNAL INCLUDES
namespace Internal
{
-
/**
* @brief A control which renders a long text string with styles.
*/
static Property::Value GetProperty( BaseObject* object, Property::Index index );
/**
+ * @copydoc Dali::Toollkit::TextEditor::GetInputMethodContext()
+ */
+ InputMethodContext GetInputMethodContext();
+
+ /**
* Connects a callback function with the object's signals.
* @param[in] object The object providing the signal.
* @param[in] tracker Used to disconnect the signal.
private: // Implementation
/**
- * @copydoc Dali::Toolkit::Text::Controller::(ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent)
+ * @copydoc Dali::Toolkit::Text::Controller::(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent)
*/
- ImfManager::ImfCallbackData OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent );
+ InputMethodContext::CallbackData OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent );
/**
* @brief Callback when Clipboard signals an item should be pasted
Toolkit::TextEditor::InputStyleChangedSignalType mInputStyleChangedSignal;
Toolkit::TextEditor::ScrollStateChangedSignalType mScrollStateChangedSignal;
- ImfManager mImfManager;
+ InputMethodContext mInputMethodContext;
Text::ControllerPtr mController;
Text::RendererPtr mRenderer;
Text::DecoratorPtr mDecorator;
#include <dali-toolkit/internal/text/text-font-style.h>
#include <dali-toolkit/internal/text/text-view.h>
#include <dali-toolkit/internal/styling/style-manager-impl.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
using namespace Dali::Toolkit::Text;
Toolkit::Control control = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
if (control == textField)
{
- impl.mImfManager.ApplyOptions( impl.mInputMethodOptions );
+ impl.mInputMethodContext.ApplyOptions( impl.mInputMethodOptions );
}
break;
}
return value;
}
+InputMethodContext TextField::GetInputMethodContext()
+{
+ return mInputMethodContext;
+}
+
bool TextField::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
Dali::BaseHandle handle( object );
mDecorator = Text::Decorator::New( *mController,
*mController );
+ mInputMethodContext = InputMethodContext::New();
+
mController->GetLayoutEngine().SetLayout( Layout::Engine::SINGLE_LINE_BOX );
// Enables the text input.
- mController->EnableTextInput( mDecorator );
+ mController->EnableTextInput( mDecorator, mInputMethodContext );
// Enables the horizontal scrolling after the text input has been enabled.
mController->SetHorizontalScrollEnabled( true );
EnableGestureDetection( static_cast<Gesture::Type>( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) );
GetTapGestureDetector().SetMaximumTapsRequired( 2 );
- mImfManager = ImfManager::Get();
-
self.TouchSignal().Connect( this, &TextField::OnTouched );
// Set BoundingBox to stage size if not already set.
self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
self.OnStageSignal().Connect( this, &TextField::OnStageConnect );
+ DevelControl::SetInputMethodContext( *this, mInputMethodContext );
+
if( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy )
{
EnableClipping();
void TextField::OnKeyInputFocusGained()
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyInputFocusGained %p\n", mController.Get() );
+ if ( mInputMethodContext )
+ {
+ mInputMethodContext.ApplyOptions( mInputMethodOptions );
- mImfManager.ApplyOptions( mInputMethodOptions );
-
- mImfManager.StatusChangedSignal().Connect( this, &TextField::KeyboardStatusChanged );
-
- mImfManager.EventReceivedSignal().Connect( this, &TextField::OnImfEvent );
+ mInputMethodContext.StatusChangedSignal().Connect( this, &TextField::KeyboardStatusChanged );
- // Notify that the text editing start.
- mImfManager.Activate();
+ mInputMethodContext.EventReceivedSignal().Connect( this, &TextField::OnInputMethodContextEvent );
- // When window gain lost focus, the imf manager is deactivated. Thus when window gain focus again, the imf manager must be activated.
- mImfManager.SetRestoreAfterFocusLost( true );
+ // Notify that the text editing start.
+ mInputMethodContext.Activate();
- ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
+ // When window gain lost focus, the inputMethodContext is deactivated. Thus when window gain focus again, the inputMethodContext must be activated.
+ mInputMethodContext.SetRestoreAfterFocusLost( true );
+ }
+ ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
- if ( notifier )
- {
- notifier.ContentSelectedSignal().Connect( this, &TextField::OnClipboardTextSelected );
- }
+ if ( notifier )
+ {
+ notifier.ContentSelectedSignal().Connect( this, &TextField::OnClipboardTextSelected );
+ }
mController->KeyboardFocusGainEvent(); // Called in the case of no virtual keyboard to trigger this event
void TextField::OnKeyInputFocusLost()
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField:OnKeyInputFocusLost %p\n", mController.Get() );
+ if ( mInputMethodContext )
+ {
+ mInputMethodContext.StatusChangedSignal().Disconnect( this, &TextField::KeyboardStatusChanged );
+ // The text editing is finished. Therefore the inputMethodContext don't have restore activation.
+ mInputMethodContext.SetRestoreAfterFocusLost( false );
- mImfManager.StatusChangedSignal().Disconnect( this, &TextField::KeyboardStatusChanged );
- // The text editing is finished. Therefore the imf manager don't have restore activation.
- mImfManager.SetRestoreAfterFocusLost( false );
-
- // Notify that the text editing finish.
- mImfManager.Deactivate();
-
- mImfManager.EventReceivedSignal().Disconnect( this, &TextField::OnImfEvent );
+ // Notify that the text editing finish.
+ mInputMethodContext.Deactivate();
+ mInputMethodContext.EventReceivedSignal().Disconnect( this, &TextField::OnInputMethodContextEvent );
+ }
ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() );
if ( notifier )
void TextField::OnTap( const TapGesture& gesture )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnTap %p\n", mController.Get() );
-
- mImfManager.Activate();
-
+ if ( mInputMethodContext )
+ {
+ mInputMethodContext.Activate();
+ }
// Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
Extents padding;
padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
void TextField::OnLongPress( const LongPressGesture& gesture )
{
- mImfManager.Activate();
-
+ if ( mInputMethodContext )
+ {
+ mInputMethodContext.Activate();
+ }
Extents padding;
padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
}
}
-ImfManager::ImfCallbackData TextField::OnImfEvent( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent )
+InputMethodContext::CallbackData TextField::OnInputMethodContextEvent( Dali::InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent )
{
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnImfEvent %p eventName %d\n", mController.Get(), imfEvent.eventName );
- return mController->OnImfEvent( imfManager, imfEvent );
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnInputMethodContextEvent %p eventName %d\n", mController.Get(), inputMethodContextEvent.eventName );
+ return mController->OnInputMethodContextEvent( inputMethodContext, inputMethodContextEvent );
}
void TextField::GetHandleImagePropertyValue( Property::Value& value, Text::HandleType handleType, Text::HandleImageType handleImageType )
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
+#include <dali/devel-api/adaptor-framework/input-method-context.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
namespace Internal
{
-
/**
* @brief A control which renders a short text string.
*/
static Property::Value GetProperty( BaseObject* object, Property::Index index );
/**
+ * @copydoc Dali::Toollkit::TextField::GetInputMethodContext()
+ */
+ InputMethodContext GetInputMethodContext();
+
+ /**
* Connects a callback function with the object's signals.
* @param[in] object The object providing the signal.
* @param[in] tracker Used to disconnect the signal.
private: // Implementation
/**
- * @copydoc Dali::Toolkit::Text::Controller::(ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent)
+ * @copydoc Dali::Toolkit::Text::Controller::(InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent)
*/
- ImfManager::ImfCallbackData OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent );
+ InputMethodContext::CallbackData OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent );
/**
* @brief Callback when Clipboard signals an item should be pasted
Toolkit::TextField::MaxLengthReachedSignalType mMaxLengthReachedSignal;
Toolkit::TextField::InputStyleChangedSignalType mInputStyleChangedSignal;
- ImfManager mImfManager;
+ InputMethodContext mInputMethodContext;
Text::ControllerPtr mController;
Text::RendererPtr mRenderer;
Text::DecoratorPtr mDecorator;
namespace Text
{
-EventData::EventData( DecoratorPtr decorator )
+EventData::EventData( DecoratorPtr decorator, InputMethodContext& inputMethodContext )
: mDecorator( decorator ),
- mImfManager(),
+ mInputMethodContext( inputMethodContext ),
mPlaceholderFont( NULL ),
mPlaceholderTextActive(),
mPlaceholderTextInactive(),
mPlaceholderEllipsisFlag( false ),
mShiftSelectionFlag( true )
{
- mImfManager = ImfManager::Get();
}
EventData::~EventData()
if( mEventData->mUpdateCursorPosition ||
mEventData->mUpdateHighlightBox )
{
- NotifyImfManager();
+ NotifyInputMethodContext();
}
// The cursor must also be repositioned after inserts into the model
return decoratorUpdated;
}
-void Controller::Impl::NotifyImfManager()
+void Controller::Impl::NotifyInputMethodContext()
{
- if( mEventData && mEventData->mImfManager )
+ if( mEventData && mEventData->mInputMethodContext )
{
CharacterIndex cursorPosition = GetLogicalCursorPosition();
cursorPosition -= numberOfWhiteSpaces;
}
- mEventData->mImfManager.SetCursorPosition( cursorPosition );
- mEventData->mImfManager.NotifyCursorPosition();
+ mEventData->mInputMethodContext.SetCursorPosition( cursorPosition );
+ mEventData->mInputMethodContext.NotifyCursorPosition();
}
}
-void Controller::Impl::NotifyImfMultiLineStatus()
+void Controller::Impl::NotifyInputMethodContextMultiLineStatus()
{
- if ( mEventData )
+ if ( mEventData && mEventData->mInputMethodContext )
{
Text::Layout::Engine::Type layout = mLayoutEngine.GetLayout();
- mEventData->mImfManager.NotifyTextInputMultiLine( layout == Text::Layout::Engine::MULTI_LINE_BOX );
+ mEventData->mInputMethodContext.NotifyTextInputMultiLine( layout == Text::Layout::Engine::MULTI_LINE_BOX );
}
}
if ( selecting )
{
- // Notify the cursor position to the imf manager.
- if( mEventData->mImfManager )
+ // Notify the cursor position to the InputMethodContext.
+ if( mEventData->mInputMethodContext )
{
- mEventData->mImfManager.SetCursorPosition( mEventData->mPrimaryCursorPosition );
- mEventData->mImfManager.NotifyCursorPosition();
+ mEventData->mInputMethodContext.SetCursorPosition( mEventData->mPrimaryCursorPosition );
+ mEventData->mInputMethodContext.NotifyCursorPosition();
}
ChangeState( EventData::SELECTING );
mEventData->mScrollAfterUpdatePosition = true;
mEventData->mUpdateInputStyle = true;
- // Notify the cursor position to the imf manager.
- if( mEventData->mImfManager )
+ // Notify the cursor position to the InputMethodContext.
+ if( mEventData->mInputMethodContext )
{
- mEventData->mImfManager.SetCursorPosition( mEventData->mPrimaryCursorPosition );
- mEventData->mImfManager.NotifyCursorPosition();
+ mEventData->mInputMethodContext.SetCursorPosition( mEventData->mPrimaryCursorPosition );
+ mEventData->mInputMethodContext.NotifyCursorPosition();
}
}
else if( 2u == tapCount )
mEventData->mUpdateRightSelectionPosition = true;
mEventData->mUpdateHighlightBox = true;
- // It may happen an IMF commit event arrives before the selection event
- // if the IMF manager is in pre-edit state. The commit event will set the
+ // It may happen an InputMethodContext commit event arrives before the selection event
+ // if the InputMethodContext is in pre-edit state. The commit event will set the
// mEventData->mUpdateCursorPosition flag to true. If it's not set back
// to false, the highlight box won't be updated.
mEventData->mUpdateCursorPosition = false;
TEXT_PANNING
};
- EventData( DecoratorPtr decorator );
+ EventData( DecoratorPtr decorator, InputMethodContext& inputMethodContext );
~EventData();
}
DecoratorPtr mDecorator; ///< Pointer to the decorator.
- ImfManager mImfManager; ///< The Input Method Framework Manager.
+ InputMethodContext mInputMethodContext; ///< The Input Method Framework Manager.
FontDefaults* mPlaceholderFont; ///< The placeholder default font.
std::string mPlaceholderTextActive; ///< The text to display when the TextField is empty with key-input focus.
std::string mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive.
}
}
- void ResetImfManager()
+ void ResetInputMethodContext()
{
if( mEventData )
{
// Reset incase we are in a pre-edit state.
- if( mEventData->mImfManager )
+ if( mEventData->mInputMethodContext )
{
- mEventData->mImfManager.Reset(); // Will trigger a message ( commit, get surrounding )
+ mEventData->mInputMethodContext.Reset(); // Will trigger a message ( commit, get surrounding )
}
ClearPreEditFlag();
}
/**
- * @brief Helper to notify IMF manager with surrounding text & cursor changes.
+ * @brief Helper to notify InputMethodContext with surrounding text & cursor changes.
*/
- void NotifyImfManager();
+ void NotifyInputMethodContext();
/**
- * @brief Helper to notify IMF manager with multi line status.
+ * @brief Helper to notify InputMethodContext with multi line status.
*/
- void NotifyImfMultiLineStatus();
+ void NotifyInputMethodContextMultiLineStatus();
/**
* @brief Retrieve the current cursor position.
// public : Configure the text controller.
-void Controller::EnableTextInput( DecoratorPtr decorator )
+void Controller::EnableTextInput( DecoratorPtr decorator, InputMethodContext& inputMethodContext )
{
if( !decorator )
{
if( NULL == mImpl->mEventData )
{
- mImpl->mEventData = new EventData( decorator );
+ mImpl->mEventData = new EventData( decorator, inputMethodContext );
}
}
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SetText\n" );
// Reset keyboard as text changed
- mImpl->ResetImfManager();
+ mImpl->ResetInputMethodContext();
// Remove the previously set text and style.
ResetText();
mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered.
mImpl->mEventData->mUpdateInputStyle = true;
}
- mImpl->NotifyImfMultiLineStatus();
+ mImpl->NotifyInputMethodContextMultiLineStatus();
if( mImpl->IsShowingPlaceholderText() )
{
// Show alternative placeholder-text when editing
}
else if( Dali::DALI_KEY_SHIFT_LEFT == keyCode )
{
- // DALI_KEY_SHIFT_LEFT is the key code for the Left Shift. It's sent (by the imf?) when the predictive text is enabled
+ // DALI_KEY_SHIFT_LEFT is the key code for the Left Shift. It's sent (by the InputMethodContext?) when the predictive text is enabled
// and a character is typed after the type of a upper case latin character.
// Do nothing.
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p keyString %s\n", this, keyString.c_str() );
- // IMF manager is no longer handling key-events
+ // InputMethodContext is no longer handling key-events
mImpl->ClearPreEditFlag();
InsertText( keyString, COMMIT );
( Dali::DALI_KEY_VOLUME_UP != keyCode ) &&
( Dali::DALI_KEY_VOLUME_DOWN != keyCode ) )
{
- // Should not change the state if the key is the shift send by the imf manager.
+ // Should not change the state if the key is the shift send by the InputMethodContext.
// Otherwise, when the state is SELECTING the text controller can't send the right
- // surrounding info to the imf.
+ // surrounding info to the InputMethodContext.
mImpl->ChangeState( EventData::EDITING );
// Will request for relayout.
}
// Reset keyboard as tap event has occurred.
- mImpl->ResetImfManager();
+ mImpl->ResetInputMethodContext();
}
void Controller::PanEvent( Gesture::State state, const Vector2& displacement )
}
else if( !mImpl->IsClipboardVisible() )
{
- // Reset the imf manager to commit the pre-edit before selecting the text.
- mImpl->ResetImfManager();
+ // Reset the InputMethodContext to commit the pre-edit before selecting the text.
+ mImpl->ResetInputMethodContext();
Event event( Event::LONG_PRESS_EVENT );
event.p1.mInt = state;
}
}
-ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent )
+InputMethodContext::CallbackData Controller::OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent )
{
// Whether the text needs to be relaid-out.
bool requestRelayout = false;
- // Whether to retrieve the text and cursor position to be sent to the IMF manager.
+ // Whether to retrieve the text and cursor position to be sent to the InputMethodContext.
bool retrieveText = false;
bool retrieveCursor = false;
- switch( imfEvent.eventName )
+ switch( inputMethodContextEvent.eventName )
{
- case ImfManager::COMMIT:
+ case InputMethodContext::COMMIT:
{
- InsertText( imfEvent.predictiveString, Text::Controller::COMMIT );
+ InsertText( inputMethodContextEvent.predictiveString, Text::Controller::COMMIT );
requestRelayout = true;
retrieveCursor = true;
break;
}
- case ImfManager::PREEDIT:
+ case InputMethodContext::PRE_EDIT:
{
- InsertText( imfEvent.predictiveString, Text::Controller::PRE_EDIT );
+ InsertText( inputMethodContextEvent.predictiveString, Text::Controller::PRE_EDIT );
requestRelayout = true;
retrieveCursor = true;
break;
}
- case ImfManager::DELETESURROUNDING:
+ case InputMethodContext::DELETE_SURROUNDING:
{
- const bool textDeleted = RemoveText( imfEvent.cursorOffset,
- imfEvent.numberOfChars,
+ const bool textDeleted = RemoveText( inputMethodContextEvent.cursorOffset,
+ inputMethodContextEvent.numberOfChars,
DONT_UPDATE_INPUT_STYLE );
if( textDeleted )
}
break;
}
- case ImfManager::GETSURROUNDING:
+ case InputMethodContext::GET_SURROUNDING:
{
retrieveText = true;
retrieveCursor = true;
break;
}
- case ImfManager::PRIVATECOMMAND:
+ case InputMethodContext::PRIVATE_COMMAND:
{
// PRIVATECOMMAND event is just for getting the private command message
retrieveText = true;
retrieveCursor = true;
break;
}
- case ImfManager::VOID:
+ case InputMethodContext::VOID:
{
// do nothing
break;
}
}
- ImfManager::ImfCallbackData callbackData( ( retrieveText || retrieveCursor ), cursorPosition, text, false );
+ InputMethodContext::CallbackData callbackData( ( retrieveText || retrieveCursor ), cursorPosition, text, false );
if( requestRelayout &&
( NULL != mImpl->mEditableControlInterface ) )
std::string stringToPaste( notifier.GetContent() );
// Commit the current pre-edit text; the contents of the clipboard should be appended
- mImpl->ResetImfManager();
+ mImpl->ResetInputMethodContext();
// Temporary disable hiding clipboard
mImpl->SetClipboardHideEnable( false );
// TODO: At the moment the underline runs are only for pre-edit.
mImpl->mModel->mVisualModel->mUnderlineRuns.Clear();
- // Remove the previous IMF pre-edit.
+ // Remove the previous InputMethodContext pre-edit.
if( mImpl->mEventData->mPreEditFlag && ( 0u != mImpl->mEventData->mPreEditLength ) )
{
removedPrevious = RemoveText( -static_cast<int>( mImpl->mEventData->mPrimaryCursorPosition - mImpl->mEventData->mPreEditStartPosition ),
mImpl->ChangeState( EventData::EDITING );
- // Handle the IMF (predicitive text) state changes
+ // Handle the InputMethodContext (predicitive text) state changes
if( COMMIT == type )
{
- // IMF manager is no longer handling key-events
+ // InputMethodContext is no longer handling key-events
mImpl->ClearPreEditFlag();
}
else // PRE_EDIT
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "MaxLengthReached (%d)\n", mImpl->mModel->mLogicalModel->mText.Count() );
- mImpl->ResetImfManager();
+ mImpl->ResetInputMethodContext();
if( NULL != mImpl->mEditableControlInterface )
{
return removed;
}
- // IMF manager is no longer handling key-events
+ // InputMethodContext is no longer handling key-events
mImpl->ClearPreEditFlag();
if( EventData::SELECTING == mImpl->mEventData->mState )
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/imf-manager.h>
+#include <dali/devel-api/adaptor-framework/input-method-context.h>
#include <dali/public-api/events/gesture.h>
// INTERNAL INCLUDES
};
/**
- * @brief Used to distinguish between regular key events and IMF events
+ * @brief Used to distinguish between regular key events and InputMethodContext events
*/
enum InsertType
{
*
* @note Selectable or editable controls should call this once after Controller::New().
* @param[in] decorator Used to create cursor, selection handle decorations etc.
+ * @param[in] inputMethodContext Used to manager ime.
*/
- void EnableTextInput( DecoratorPtr decorator );
+ void EnableTextInput( DecoratorPtr decorator, InputMethodContext& inputMethodContext );
/**
* @brief Used to switch between bitmap & vector based glyphs
* @brief Called by editable UI controls when key events are received.
*
* @param[in] event The key event.
- * @param[in] type Used to distinguish between regular key events and IMF events.
+ * @param[in] type Used to distinguish between regular key events and InputMethodContext events.
*/
bool KeyEvent( const Dali::KeyEvent& event );
void LongPressEvent( Gesture::State state, float x, float y );
/**
- * @brief Event received from IMF manager
+ * @brief Event received from input method context
*
- * @param[in] imfManager The IMF manager.
- * @param[in] imfEvent The event received.
+ * @param[in] inputMethodContext The input method context.
+ * @param[in] inputMethodContextEvent The event received.
* @return A data struture indicating if update is needed, cursor position and current text.
*/
- ImfManager::ImfCallbackData OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent );
+ InputMethodContext::CallbackData OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent );
/**
* @brief Event from Clipboard notifying an Item has been selected for pasting
* @brief Called by editable UI controls when key events are received.
*
* @param[in] text The text to insert.
- * @param[in] type Used to distinguish between regular key events and IMF events.
+ * @param[in] type Used to distinguish between regular key events and InputMethodContext events.
*/
void InsertText( const std::string& text, InsertType type );
bool consumed = false;
+ consumed = mImpl->FilterKeyEvent( event );
+
// signals are allocated dynamically when someone connects
- if ( !mImpl->mKeyEventSignal.Empty() )
+ if ( !consumed && !mImpl->mKeyEventSignal.Empty() )
{
consumed = mImpl->mKeyEventSignal.Emit( handle, event );
}
- if (!consumed)
+ if ( !consumed )
{
// Notification for derived classes
consumed = OnKeyEvent(event);