-void ImfManager::PreEditChanged( void *, Ecore_IMF_Context *imfContext, void *event_info )
-{
- // char *preEditString( NULL );
- // int cursorPosition( 0 );
- // Eina_List *attrs = NULL;
- // Eina_List *l = NULL;
-
- // Ecore_IMF_Preedit_Attr *attr;
-
- // // Retrieves attributes as well as the string the cursor position offset from start of pre-edit string.
- // // the attributes (attrs) is used in languages that use the soft arrows keys to insert characters into a current pre-edit string.
- // ecore_imf_context_preedit_string_with_attributes_get( imfContext, &preEditString, &attrs, &cursorPosition );
- // if ( attrs )
- // {
- // // iterate through the list of attributes getting the type, start and end position.
- // for ( l = attrs, (attr = (Ecore_IMF_Preedit_Attr*)eina_list_data_get(l) ); l; l = eina_list_next(l), ( attr = (Ecore_IMF_Preedit_Attr*)eina_list_data_get(l) ))
- // {
- // if ( attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB4 ) // (Ecore_IMF)
- // {
- // // check first byte so know how many bytes a character is represented by as keyboard returns cursor position in bytes. Which is different for some languages.
- // size_t visualCharacterIndex = 0;
- // size_t byteIndex = 0;
- // // iterate through null terminated string checking each character's position against the given byte position ( attr->end_index ).
- // while ( preEditString[byteIndex] != '\0' )
- // {
- // // attr->end_index is provided as a byte position not character and we need to know the character position.
- // size_t currentSequenceLength = Utf8SequenceLength(preEditString[byteIndex]); // returns number of bytes used to represent character.
- // if ( byteIndex == attr->end_index )
- // {
- // cursorPosition = visualCharacterIndex;
- // break;
- // // end loop as found cursor position that matches byte position
- // }
- // else
- // {
- // byteIndex += currentSequenceLength; // jump to next character
- // visualCharacterIndex++; // increment character count so we know our position for when we get a match
- // }
- // DALI_ASSERT_DEBUG( visualCharacterIndex < strlen( preEditString ));
- // }
- // }
- // }
- // }
- // if ( Dali::Adaptor::IsAvailable() )
- // {
- // std::string keyString ( preEditString );
- // int numberOfChars( 0 );
- // Dali::ImfManager handle( this );
- // Dali::ImfManager::ImfEventData imfEventData ( Dali::ImfManager::PREEDIT, keyString, cursorPosition, numberOfChars );
- // Dali::ImfManager::ImfCallbackData callbackData = mEventSignalV2.Emit( handle, imfEventData );
- // if ( callbackData.update )
- // {
- // SetCursorPosition( callbackData.cursorPosition );
- // SetSurroundingText( callbackData.currentText );
- // NotifyCursorPosition();
- // }
- // if ( callbackData.preeditResetRequired )
- // {
- // Reset();
- // }
- // }
- // free( preEditString );
-}
-
-void ImfManager::CommitReceived( void *, Ecore_IMF_Context *imfContext, void *event_info )
-{
- // if ( Dali::Adaptor::IsAvailable() )
- // {
- // const std::string keyString( (char *)event_info );
- // const int cursorOffset( 0 );
- // const int numberOfChars( 0 );
-
- // Dali::ImfManager handle( this );
- // Dali::ImfManager::ImfEventData imfEventData ( Dali::ImfManager::COMMIT, keyString, cursorOffset, numberOfChars );
- // Dali::ImfManager::ImfCallbackData callbackData = mEventSignalV2.Emit( handle, imfEventData );
-
- // if ( callbackData.update )
- // {
- // SetCursorPosition( callbackData.cursorPosition );
- // SetSurroundingText( callbackData.currentText );
-
- // NotifyCursorPosition();
- // }
- // }
-}
-
-/**
- * Called when an IMF retrieve surround event is received.
- * Here the IMF module wishes to know the string we are working with and where within the string the cursor is
- * We need to signal the application to tell us this information.
- */
-Eina_Bool ImfManager::RetrieveSurrounding( void *data, Ecore_IMF_Context *imfContext, char** text, int* cursorPosition )
-{
- // std::string keyString ( "" );
- // int cursorOffset( 0 );
- // int numberOfChars( 0 );
- // Dali::ImfManager::ImfEventData imfData ( Dali::ImfManager::GETSURROUNDING , keyString, cursorOffset, numberOfChars );
- // Dali::ImfManager handle( this );
- // mEventSignalV2.Emit( handle, imfData );
- // if ( text )
- // {
- // std::string surroundingText( GetSurroundingText() );
- // if ( !surroundingText.empty() )
- // {
- // *text = strdup( surroundingText.c_str() );
- // }
- // else
- // {
- // *text = strdup( "" );
- // }
- // }
- // if ( cursorPosition )
- // {
- // *cursorPosition = GetCursorPosition();
- // }
- return EINA_TRUE;
-}
-
-/**
- * Called when an IMF delete surrounding event is received.
- * Here we tell the application that it should delete a certain range.
- */
-void ImfManager::DeleteSurrounding( void *data, Ecore_IMF_Context *imfContext, void *event_info )
-{
- // if ( Dali::Adaptor::IsAvailable() )
- // {
- // Ecore_IMF_Event_Delete_Surrounding* deleteSurroundingEvent = (Ecore_IMF_Event_Delete_Surrounding*) event_info;
- // const std::string keyString( "" );
- // const int cursorOffset( deleteSurroundingEvent->offset );
- // const int numberOfChars( deleteSurroundingEvent->n_chars );
- // Dali::ImfManager::ImfEventData imfData ( Dali::ImfManager::DELETESURROUNDING , keyString, cursorOffset, numberOfChars );
- // Dali::ImfManager handle( this );
- // mEventSignalV2.Emit( handle, imfData );
- // }
-}
-