Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelPosition( x, y );
}
-void InputMethodContext::GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttrData >& attrs ) const
+void InputMethodContext::GetPreeditStyle( PreEditAttributeDataContainer& attrs ) const
{
Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle( attrs );
}
public:
/**
- * @brief The direction of text.
- */
+ * @brief The direction of text.
+ */
enum TextDirection
{
LeftToRight,
*/
enum class PreeditStyle
{
- NONE, ///< None style
- UNDERLINE, ///< Underline substring style
- REVERSE, ///< Reverse substring style
- HIGHLIGHT, ///< Highlight substring style
- HIGHLIGHT_SUB4, ///< SUB4 substring style
- HIGHLIGHT_SUB5, ///< SUB5 substring style
- HIGHLIGHT_SUB6, ///< SUB6 substring style
- HIGHLIGHT_SUB7 ///< SUB7 substring style
+ NONE, ///< None style
+ UNDERLINE, ///< Underline substring style
+ REVERSE, ///< Reverse substring style
+ HIGHLIGHT, ///< Highlight substring style
+ CUSTOM_PLATFORM_STYLE_1, ///< Custom style for platform
+ CUSTOM_PLATFORM_STYLE_2, ///< Custom style for platform
+ CUSTOM_PLATFORM_STYLE_3, ///< Custom style for platform
+ CUSTOM_PLATFORM_STYLE_4 ///< Custom style for platform
};
/**
* @brief This structure is for the preedit style types and indices.
*/
- struct PreeditAttrData
+ struct PreeditAttributeData
{
- PreeditStyle preeditType; /// The preedit style type
- unsigned int startIndex; /// The start index of preedit
- unsigned int endIndex; /// The end index of preedit
+ PreeditAttributeData()
+ : preeditType( PreeditStyle::NONE ),
+ startIndex( 0 ),
+ endIndex( 0 )
+ {
+ }
+
+ PreeditStyle preeditType; /// The preedit style type
+ unsigned int startIndex; /// The start index of preedit
+ unsigned int endIndex; /// The end index of preedit
};
/**
typedef Signal< void ( int ) > LanguageChangedSignalType; ///< Language changed signal
typedef Signal< void ( const std::string&, const std::string&, const std::string& ) > ContentReceivedSignalType; ///< Content received signal
+ using PreEditAttributeDataContainer = Vector< Dali::InputMethodContext::PreeditAttributeData >;
+
public:
/**
void SetInputPanelPosition( unsigned int x, unsigned int y );
/**
- * @brief Gets the preedit attrs data.
+ * @brief Gets the preedit attributes data.
*
- * @param[out] attrs The preedit attrs data.
+ * @param[out] attrs The preedit attributes data.
*/
- void GetPreeditStyle( Vector<PreeditAttrData>& attrs ) const;
+ void GetPreeditStyle( PreEditAttributeDataContainer& attrs ) const;
public:
/**
* @copydoc Dali::InputMethodContext::GetPreeditStyle()
*/
- virtual void GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttrData >& attrs ) const {}
+ virtual void GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const {}
public: // Signals
DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::SetInputPanelPosition\n" );
}
-void InputMethodContextGeneric::GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttrData >& attrs) const
+void InputMethodContextGeneric::GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const
{
DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::GetPreeditStyle\n" );
// Do Nothing
/**
* @copydoc Dali::InputMethodContext::GetPreeditStyle()
*/
- void GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttrData >& attrs ) const override;
+ void GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const override;
public:
#include <dali/internal/system/common/singleton-service-impl.h>
#include <dali/internal/window-system/common/window-render-surface.h>
-#define TOKEN_STRING(x) #x
-
Ecore_IMF_Input_Panel_Layout panelLayoutMap[] =
{
ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL,
{
size_t length = 0;
- if ((leadByte & 0x80) == 0 ) //ASCII character (lead bit zero)
+ if( ( leadByte & 0x80 ) == 0 ) //ASCII character (lead bit zero)
{
length = 1;
}
- else if (( leadByte & 0xe0 ) == 0xc0 ) //110x xxxx
+ else if( ( leadByte & 0xe0 ) == 0xc0 ) //110x xxxx
{
length = 2;
}
- else if (( leadByte & 0xf0 ) == 0xe0 ) //1110 xxxx
+ else if( ( leadByte & 0xf0 ) == 0xe0 ) //1110 xxxx
{
length = 3;
}
- else if (( leadByte & 0xf8 ) == 0xf0 ) //1111 0xxx
+ else if( ( leadByte & 0xf8 ) == 0xf0 ) //1111 0xxx
{
length = 4;
}
+ else if( ( leadByte & 0xfc ) == 0xf8 ) //1111 10xx
+ {
+ length = 5;
+ }
+ else if( ( leadByte & 0xfe ) == 0xfc ) //1111 110x
+ {
+ length = 6;
+ }
return length;
}
// iterate through the list of attributes getting the type, start and end position.
for ( l = attrs, (attr = static_cast<Ecore_IMF_Preedit_Attr*>( eina_list_data_get(l) ) ); l; l = eina_list_next(l), ( attr = static_cast<Ecore_IMF_Preedit_Attr*>( eina_list_data_get(l) ) ))
{
- Dali::InputMethodContext::PreeditAttrData data;
+ Dali::InputMethodContext::PreeditAttributeData data;
data.startIndex = 0;
data.endIndex = 0;
size_t byteIndex = 0;
// iterate through null terminated string checking each character's position against the given byte position ( attr->end_index ).
- const char leadByte = preEditString[byteIndex];
+ char leadByte = preEditString[byteIndex];
+
while( leadByte != '\0' )
{
+ leadByte = preEditString[byteIndex]; // Update the character to get the number of its byte
+
// attr->end_index is provided as a byte position not character and we need to know the character position.
const size_t currentSequenceLength = Utf8SequenceLength( leadByte ); // returns number of bytes used to represent character.
if( byteIndex <= attr->start_index )
{
data.startIndex = visualCharacterIndex;
}
- if ( byteIndex >= attr->end_index )
+ if( byteIndex >= attr->end_index )
{
data.endIndex = visualCharacterIndex;
break;
}
case ECORE_IMF_PREEDIT_TYPE_SUB4:
{
- data.preeditType = Dali::InputMethodContext::PreeditStyle::HIGHLIGHT_SUB4;
+ data.preeditType = Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_1;
break;
}
case ECORE_IMF_PREEDIT_TYPE_SUB5:
{
- data.preeditType = Dali::InputMethodContext::PreeditStyle::HIGHLIGHT_SUB5;
+ data.preeditType = Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_2;
break;
}
case ECORE_IMF_PREEDIT_TYPE_SUB6:
{
- data.preeditType = Dali::InputMethodContext::PreeditStyle::HIGHLIGHT_SUB6;
+ data.preeditType = Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_3;
break;
}
case ECORE_IMF_PREEDIT_TYPE_SUB7:
{
- data.preeditType = Dali::InputMethodContext::PreeditStyle::HIGHLIGHT_SUB7;
+ data.preeditType = Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_4;
break;
}
default:
mBackupOperations[Operation::SET_INPUT_PANEL_POSITION] = std::bind( &InputMethodContextEcoreWl::SetInputPanelPosition, this, x, y );
}
-void InputMethodContextEcoreWl::GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttrData >& attrs ) const
+void InputMethodContextEcoreWl::GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const
{
DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextEcoreWl::GetPreeditStyle\n" );
attrs = mPreeditAttrs;
/**
* @copydoc Dali::InputMethodContext::GetPreeditStyle()
*/
- void GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttrData >& attrs ) const override;
+ void GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const override;
private:
/**
std::vector<Dali::Integration::KeyEvent> mKeyEvents; ///< Stores key events to be sent from idle call-back.
InputMethodOptions mOptions;
- Vector< Dali::InputMethodContext::PreeditAttrData > mPreeditAttrs; ///< Stores preedit attr data
+ Dali::InputMethodContext::PreEditAttributeDataContainer mPreeditAttrs; ///< Stores preedit attribute data
int mWindowId;
};
{
size_t length = 0;
- if ((leadByte & 0x80) == 0 ) //ASCII character (lead bit zero)
+ if( ( leadByte & 0x80 ) == 0 ) //ASCII character (lead bit zero)
{
length = 1;
}
- else if (( leadByte & 0xe0 ) == 0xc0 ) //110x xxxx
+ else if( ( leadByte & 0xe0 ) == 0xc0 ) //110x xxxx
{
length = 2;
}
- else if (( leadByte & 0xf0 ) == 0xe0 ) //1110 xxxx
+ else if( ( leadByte & 0xf0 ) == 0xe0 ) //1110 xxxx
{
length = 3;
}
- else if (( leadByte & 0xf8 ) == 0xf0 ) //1111 0xxx
+ else if( ( leadByte & 0xf8 ) == 0xf0 ) //1111 0xxx
{
length = 4;
}
+ else if( ( leadByte & 0xfc ) == 0xf8 ) //1111 10xx
+ {
+ length = 5;
+ }
+ else if( ( leadByte & 0xfe ) == 0xfc ) //1111 110x
+ {
+ length = 6;
+ }
return length;
}
// iterate through the list of attributes getting the type, start and end position.
for ( l = attrs, (attr = static_cast<Ecore_IMF_Preedit_Attr*>( eina_list_data_get(l) ) ); l; l = eina_list_next(l), ( attr = static_cast<Ecore_IMF_Preedit_Attr*>( eina_list_data_get(l) ) ))
{
- Dali::InputMethodContext::PreeditAttrData data;
+ Dali::InputMethodContext::PreeditAttributeData data;
data.startIndex = 0;
data.endIndex = 0;
size_t byteIndex = 0;
// iterate through null terminated string checking each character's position against the given byte position ( attr->end_index ).
- const char leadByte = preEditString[byteIndex];
+ char leadByte = preEditString[byteIndex];
+
while( leadByte != '\0' )
{
+ leadByte = preEditString[byteIndex]; // Update the character to get the number of its byte
+
// attr->end_index is provided as a byte position not character and we need to know the character position.
const size_t currentSequenceLength = Utf8SequenceLength( leadByte ); // returns number of bytes used to represent character.
if( byteIndex <= attr->start_index )
{
data.startIndex = visualCharacterIndex;
}
- if ( byteIndex >= attr->end_index )
+ if( byteIndex >= attr->end_index )
{
data.endIndex = visualCharacterIndex;
break;
}
case ECORE_IMF_PREEDIT_TYPE_SUB4:
{
- data.preeditType = Dali::InputMethodContext::PreeditStyle::HIGHLIGHT_SUB4;
+ data.preeditType = Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_1;
break;
}
case ECORE_IMF_PREEDIT_TYPE_SUB5:
{
- data.preeditType = Dali::InputMethodContext::PreeditStyle::HIGHLIGHT_SUB5;
+ data.preeditType = Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_2;
break;
}
case ECORE_IMF_PREEDIT_TYPE_SUB6:
{
- data.preeditType = Dali::InputMethodContext::PreeditStyle::HIGHLIGHT_SUB6;
+ data.preeditType = Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_3;
break;
}
case ECORE_IMF_PREEDIT_TYPE_SUB7:
{
- data.preeditType = Dali::InputMethodContext::PreeditStyle::HIGHLIGHT_SUB7;
+ data.preeditType = Dali::InputMethodContext::PreeditStyle::CUSTOM_PLATFORM_STYLE_4;
break;
}
default:
// ecore_imf_context_input_panel_position_set() is supported from ecore-imf 1.21.0 version.
}
-void InputMethodContextX::GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttrData >& attrs ) const
+void InputMethodContextX::GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const
{
DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextX::GetPreeditStyle\n" );
attrs = mPreeditAttrs;
/**
* @copydoc Dali::InputMethodContext::GetPreeditStyle()
*/
- void GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttrData >& attrs ) const override;
+ void GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const override;
private:
/**
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;
- Vector< Dali::InputMethodContext::PreeditAttrData > mPreeditAttrs; ///< Stores preedit attr data
+ Dali::InputMethodContext::PreEditAttributeDataContainer mPreeditAttrs; ///< Stores preedit attribute data
};
} // namespace Adaptor
DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::SetInputPanelPosition\n" );\r
}\r
\r
-void InputMethodContextWin::GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttrData >& attrs ) const\r
+void InputMethodContextWin::GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const\r
{\r
DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::GetPreeditStyle\n" );\r
attrs = mPreeditAttrs;\r
/**\r
* @copydoc Dali::InputMethodContext::GetPreeditStyle()\r
*/\r
- void GetPreeditStyle( Vector< Dali::InputMethodContext::PreeditAttrData >& attrs ) const override;\r
+ void GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const override;\r
\r
private:\r
/**\r
bool mRestoreAfterFocusLost:1; ///< Whether the keyboard needs to be restored (activated ) after focus regained.\r
bool mIdleCallbackConnected:1; ///< Whether the idle callback is already connected.\r
InputMethodOptions mOptions;\r
- Vector< Dali::InputMethodContext::PreeditAttrData > mPreeditAttrs;\r
+ Dali::InputMethodContext::PreEditAttributeDataContainer mPreeditAttrs; ///< Stores preedit attribute data\r
};\r
\r
} // namespace Adaptor\r