controller->GetText( text );
DALI_TEST_EQUALS( "Hello ", text, TEST_LOCATION );
- // for coverage
- inputMethodContext.SetPreeditStyle( InputMethodContext::PreeditStyle::UNDERLINE );
-
// Send PRE_EDIT event
imfEvent = InputMethodContext::EventData( InputMethodContext::PRE_EDIT, "wo", 6, 2 );
controller->OnInputMethodContextEvent( inputMethodContext, imfEvent );
const std::string& GetSurroundingText() const;
void ApplyOptions( const InputMethodOptions& options );
bool FilterEventKey( const Dali::KeyEvent& keyEvent );
- void SetPreeditStyle( Dali::InputMethodContext::PreeditStyle type );
- Dali::InputMethodContext::PreeditStyle GetPreeditStyle() const;
public: // Signals
ActivatedSignalType& ActivatedSignal() { return mActivatedSignal; }
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;
- Dali::InputMethodContext::PreeditStyle mPreeditStyle;
ActivatedSignalType mActivatedSignal;
KeyboardEventSignalType mEventSignal;
: mIMFCursorPosition( 0 ),
mSurroundingText(),
mRestoreAfterFocusLost( false ),
- mIdleCallbackConnected( false ),
- mPreeditStyle( Dali::InputMethodContext::PreeditStyle::NONE )
+ mIdleCallbackConnected( false )
{
CreateContext( /*ecoreXwin*/ );
ConnectCallbacks();
{
return false;
}
-
-void InputMethodContext::SetPreeditStyle( Dali::InputMethodContext::PreeditStyle type )
-{
- mPreeditStyle = type;
-}
-
-Dali::InputMethodContext::PreeditStyle InputMethodContext::GetPreeditStyle() const
-{
- return mPreeditStyle;
-}
} // Adaptor
} // Internal
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).FilterEventKey( keyEvent );
}
-void InputMethodContext::SetPreeditStyle( Dali::InputMethodContext::PreeditStyle type )
-{
- Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetPreeditStyle( type );
-}
-
-Dali::InputMethodContext::PreeditStyle InputMethodContext::GetPreeditStyle() const
-{
- return Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle();
-}
-
-// Signals
InputMethodContext::ActivatedSignalType& InputMethodContext::ActivatedSignal()
{
return Internal::Adaptor::InputMethodContext::GetImplementation(*this).ActivatedSignal();
public:
/**
- * @brief The direction of text.
- */
- enum TextDirection
- {
- LeftToRight,
- RightToLeft,
- };
-
- /**
- * @brief Events that are generated by the InputMethodContext.
+ * @brief Events that are generated by the input method context.
*/
enum EventType
{
};
/**
- * @brief Enumeration for state of the input panel.
- */
- enum State
- {
- DEFAULT = 0, ///< Unknown state
- SHOW, ///< Input panel is shown
- HIDE, ///< Input panel is hidden
- WILL_SHOW ///< Input panel in process of being shown
- };
-
- /**
- * @brief Enumeration for the type of Keyboard.
- */
- enum KeyboardType
- {
- SOFTWARE_KEYBOARD, ///< Software keyboard (Virtual keyboard) is default
- HARDWARE_KEYBOARD ///< Hardware keyboard
- };
-
- /**
- * @brief Enumeration for the language mode of the input panel.
- */
- enum class InputPanelLanguage
- {
- AUTOMATIC, ///< IME Language automatically set depending on the system display
- ALPHABET ///< Latin alphabet at all times
- };
-
- /**
- * @brief Enumeration for the preedit style types.
- */
- enum class PreeditStyle
- {
- NONE, ///< None style
- UNDERLINE, ///< Underline substring style
- REVERSE, ///< Reverse substring style
- HIGHLIGHT ///< Highlight substring style
- };
-
- /**
- * @brief This structure is used to pass on data from the InputMethodContext regarding predictive text.
+ * @brief This structure is used to pass on data from the input method cotext regarding predictive text.
*/
struct EventData
{
*/
bool FilterEventKey( const Dali::KeyEvent& keyEvent );
- /**
- * @brief Sets the preedit type.
- *
- * @param[in] type The preedit style type
- */
- void SetPreeditStyle( PreeditStyle type );
-
- /**
- * @brief Gets the preedit type.
- *
- * @return The preedit style type
- */
- PreeditStyle GetPreeditStyle() const;
-
public:
// Signals
mEventData->mPreEditFlag &&
( 0u != mModel->mVisualModel->mCharactersToGlyph.Count() ) )
{
- Dali::InputMethodContext::PreeditStyle type = mEventData->mInputMethodContext.GetPreeditStyle();
+ // Add the underline for the pre-edit text.
+ const GlyphIndex* const charactersToGlyphBuffer = mModel->mVisualModel->mCharactersToGlyph.Begin();
+ const Length* const glyphsPerCharacterBuffer = mModel->mVisualModel->mGlyphsPerCharacter.Begin();
- switch( type )
- {
- case Dali::InputMethodContext::PreeditStyle::UNDERLINE:
- {
- // Add the underline for the pre-edit text.
- const GlyphIndex* const charactersToGlyphBuffer = mModel->mVisualModel->mCharactersToGlyph.Begin();
- const Length* const glyphsPerCharacterBuffer = mModel->mVisualModel->mGlyphsPerCharacter.Begin();
+ const GlyphIndex glyphStart = *( charactersToGlyphBuffer + mEventData->mPreEditStartPosition );
+ const CharacterIndex lastPreEditCharacter = mEventData->mPreEditStartPosition + ( ( mEventData->mPreEditLength > 0u ) ? mEventData->mPreEditLength - 1u : 0u );
+ const Length numberOfGlyphsLastCharacter = *( glyphsPerCharacterBuffer + lastPreEditCharacter );
+ const GlyphIndex glyphEnd = *( charactersToGlyphBuffer + lastPreEditCharacter ) + ( numberOfGlyphsLastCharacter > 1u ? numberOfGlyphsLastCharacter - 1u : 0u );
- const GlyphIndex glyphStart = *( charactersToGlyphBuffer + mEventData->mPreEditStartPosition );
- const CharacterIndex lastPreEditCharacter = mEventData->mPreEditStartPosition + ( ( mEventData->mPreEditLength > 0u ) ? mEventData->mPreEditLength - 1u : 0u );
- const Length numberOfGlyphsLastCharacter = *( glyphsPerCharacterBuffer + lastPreEditCharacter );
- const GlyphIndex glyphEnd = *( charactersToGlyphBuffer + lastPreEditCharacter ) + ( numberOfGlyphsLastCharacter > 1u ? numberOfGlyphsLastCharacter - 1u : 0u );
+ GlyphRun underlineRun;
+ underlineRun.glyphIndex = glyphStart;
+ underlineRun.numberOfGlyphs = 1u + glyphEnd - glyphStart;
- GlyphRun underlineRun;
- underlineRun.glyphIndex = glyphStart;
- underlineRun.numberOfGlyphs = 1u + glyphEnd - glyphStart;
-
- mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun );
- break;
- }
- // TODO : At this moment, other styles for preedit are not implemented yet.
- case Dali::InputMethodContext::PreeditStyle::REVERSE:
- case Dali::InputMethodContext::PreeditStyle::HIGHLIGHT:
- case Dali::InputMethodContext::PreeditStyle::NONE:
- default:
- break;
- }
+ // TODO: At the moment the underline runs are only for pre-edit.
+ mModel->mVisualModel->mUnderlineRuns.PushBack( underlineRun );
}
// The estimated number of lines. Used to avoid reallocations when layouting.