projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refractor ImfManager to InputMethodContext
[platform/core/uifw/dali-toolkit.git]
/
automated-tests
/
src
/
dali-toolkit
/
dali-toolkit-test-utils
/
toolkit-input-method-context.h
diff --git
a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h
b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h
old mode 100644
(file)
new mode 100755
(executable)
similarity index 62%
rename from
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h
rename to
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h
index
392b580
..
cb4e085
--- a/
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.h
+++ b/
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h
@@
-1,8
+1,8
@@
-#ifndef __DALI_TOOLKIT_TOOLKIT_I
MF_MANAGER
_H__
-#define __DALI_TOOLKIT_TOOLKIT_I
MF_MANAGER
_H__
+#ifndef __DALI_TOOLKIT_TOOLKIT_I
NPUT_METHOD_CONTEXT
_H__
+#define __DALI_TOOLKIT_TOOLKIT_I
NPUT_METHOD_CONTEXT
_H__
/*
/*
- * Copyright (c) 201
4
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
8
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-19,10
+19,11
@@
*/
// EXTERNAL INCLUDES
*/
// EXTERNAL INCLUDES
-#define __DALI_I
MF_MANAGER
_H__
+#define __DALI_I
NPUT_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/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 Dali DALI_IMPORT_API
{
@@
-31,41
+32,41
@@
namespace Internal DALI_INTERNAL
{
namespace Adaptor
{
{
namespace Adaptor
{
-class I
mfManager
;
+class I
nputMethodContext
;
}
}
/**
}
}
/**
- * @brief The I
mfManager
class
+ * @brief The I
nputMethodContext
class
*
* Specifically manages the ecore input method framework which enables the virtual or hardware keyboards.
*/
*
* Specifically manages the ecore input method framework which enables the virtual or hardware keyboards.
*/
-class I
mfManager
: public BaseHandle
+class I
nputMethodContext
: public BaseHandle
{
public:
/**
{
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
{
VOID, ///< No event
- PREEDIT, ///< Pre-Edit changed
+ PRE
_
EDIT, ///< Pre-Edit changed
COMMIT, ///< Commit recieved
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
Imf
EventData
+ struct EventData
{
/**
* @brief Default Constructor.
*/
{
/**
* @brief Default Constructor.
*/
-
Imf
EventData()
+ EventData()
: predictiveString(),
eventName( VOID ),
cursorOffset( 0 ),
: predictiveString(),
eventName( VOID ),
cursorOffset( 0 ),
@@
-76,12
+77,12
@@
public:
/**
* @brief Constructor
*
/**
* @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.
*/
* @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 ),
: predictiveString( aPredictiveString ),
eventName( aEventName ),
cursorOffset( aCursorOffset ),
@@
-91,20
+92,20
@@
public:
// Data
std::string predictiveString; ///< The pre-edit or commit string.
// 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.
};
/**
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
Imf
CallbackData
+ struct CallbackData
{
/**
* @brief Constructor
*/
{
/**
* @brief Constructor
*/
-
Imf
CallbackData()
+ CallbackData()
: currentText(),
cursorPosition( 0 ),
update( false ),
: currentText(),
cursorPosition( 0 ),
update( false ),
@@
-119,7
+120,7
@@
public:
* @param[in] aCurrentText current text string
* @param[in] aPreeditResetRequired flag if preedit reset is required.
*/
* @param[in] aCurrentText current text string
* @param[in] aPreeditResetRequired flag if preedit reset is required.
*/
-
Imf
CallbackData( 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 ),
: currentText( aCurrentText ),
cursorPosition( aCursorPosition ),
update( aUpdate ),
@@
-133,21
+134,28
@@
public:
bool preeditResetRequired :1; ///< flag if preedit reset is required.
};
bool preeditResetRequired :1; ///< flag if preedit reset is required.
};
- typedef Signal< void (I
mfManager&) > ImfManager
SignalType; ///< Keyboard actived signal
- typedef Signal<
ImfCallbackData ( ImfManager&, const ImfEventData& ) > Imf
EventSignalType; ///< keyboard events
+ typedef Signal< void (I
nputMethodContext&) > Activated
SignalType; ///< Keyboard actived signal
+ typedef Signal<
CallbackData ( InputMethodContext&, const EventData& ) > Keyboard
EventSignalType; ///< keyboard events
typedef Signal< void () > VoidSignalType;
typedef Signal< void (bool) > StatusSignalType;
public:
/**
typedef Signal< void () > VoidSignalType;
typedef Signal< void (bool) > StatusSignalType;
public:
/**
- * @brief
Retrieve a handle to the instance of ImfManager
.
- * @return A handle to the I
mfManager
.
+ * @brief
Create a handle to the instance of InputMethodContext
.
+ * @return A handle to the I
nputMethodContext
.
*/
*/
- static I
mfManager Get
();
+ static I
nputMethodContext 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.
*
* 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.
@@
-155,7
+163,7
@@
public:
void Activate();
/**
void Activate();
/**
- * @brief Deactivate the
IMF
.
+ * @brief Deactivate the
input method context
.
*
* It means that the text editing is finished at somewhere.
*/
*
* It means that the text editing is finished at somewhere.
*/
@@
-170,54
+178,54
@@
public:
bool RestoreAfterFocusLost() const;
/**
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 );
/**
*
* @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 / i
mf
module.
+ * @brief Send message reset the pred-edit state / i
nput method context
module.
*
* Used to interupt pre-edit state maybe due to a touch input.
*/
void Reset();
/**
*
* Used to interupt pre-edit state maybe due to a touch input.
*/
void Reset();
/**
- * @brief Notifies I
MF c
ontext that the cursor position has changed, required for features like auto-capitalisation.
+ * @brief Notifies I
mfC
ontext that the cursor position has changed, required for features like auto-capitalisation.
*/
void NotifyCursorPosition();
/**
*/
void NotifyCursorPosition();
/**
- * @brief Sets cursor position stored in VirtualKeyboard, this is required by the I
MF c
ontext.
+ * @brief Sets cursor position stored in VirtualKeyboard, this is required by the I
mfC
ontext.
*
* @param[in] cursorPosition position of cursor
*/
void SetCursorPosition( unsigned int cursorPosition );
/**
*
* @param[in] cursorPosition position of cursor
*/
void SetCursorPosition( unsigned int cursorPosition );
/**
- * @brief Gets cursor position stored in VirtualKeyboard, this is required by the I
MF c
ontext.
+ * @brief Gets cursor position stored in VirtualKeyboard, this is required by the I
mfC
ontext.
*
* @return current position of cursor
*/
unsigned int GetCursorPosition() const;
/**
*
* @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 );
/**
*
* @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;
/**
*
* @return current position of cursor
*/
const std::string& GetSurroundingText() const;
/**
- * @brief Notifies I
MF c
ontext that text input is set to multi line or not
+ * @brief Notifies I
mfC
ontext that text input is set to multi line or not
*/
void NotifyTextInputMultiLine( bool multiLine );
*/
void NotifyTextInputMultiLine( bool multiLine );
@@
-227,6
+235,14
@@
public:
*/
void ApplyOptions( const InputMethodOptions& options );
*/
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
public:
// Signals
@@
-234,16
+250,16
@@
public:
/**
* @brief This is emitted when the virtual keyboard is connected to or the hardware keyboard is activated.
*
/**
* @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.
*/
*/
-
ImfManager
SignalType& ActivatedSignal();
+
Activated
SignalType& 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.
*/
*
* @return The Event signal containing the event data.
*/
-
Imf
EventSignalType& EventReceivedSignal();
+
Keyboard
EventSignalType& EventReceivedSignal();
/**
* @brief Connect to this signal to be notified when the virtual keyboard is shown or hidden.
/**
* @brief Connect to this signal to be notified when the virtual keyboard is shown or hidden.
@@
-271,23
+287,23
@@
public:
/**
* @brief Constructor.
*/
/**
* @brief Constructor.
*/
- I
mfManager
();
+ I
nputMethodContext
();
/**
* @brief Destructor
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
*/
/**
* @brief Destructor
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
*/
- ~I
mfManager
();
+ ~I
nputMethodContext
();
/**
/**
- * @brief This constructor is used by I
mfManager
::Get().
+ * @brief This constructor is used by I
nputMethodContext
::Get().
*
*
- * @param[in] i
mfManager A pointer to the imf Manager
.
+ * @param[in] i
nputMethodContext A pointer to the input method context
.
*/
*/
- explicit I
mfManager( Internal::Adaptor::ImfManager* imfManager
);
+ explicit I
nputMethodContext( Internal::Adaptor::InputMethodContext* inputMethodContext
);
};
} // namespace Dali
};
} // namespace Dali
-#endif // __DALI_TOOLKIT_TOOLKIT_I
MF_MANAGER
_H__
+#endif // __DALI_TOOLKIT_TOOLKIT_I
NPUT_METHOD_CONTEXT
_H__