X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftoolkit-input-method-context.h;h=deb9a2d2511051b1c04ba172f60d5738cc4fc847;hp=395ad4d3a58102c415068f5e9d874d463e9d35e0;hb=bee78157f19fa54ae961081782a2f6537cc8dd5a;hpb=590ede8c5f4771821ff5ac3f3acef0d189525008 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h index 395ad4d..deb9a2d 100755 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.h @@ -60,12 +60,13 @@ public: */ enum EventType { - VOID, ///< No event - PRE_EDIT, ///< Pre-Edit changed - COMMIT, ///< Commit recieved - 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 + VOID, ///< No event + PRE_EDIT, ///< Pre-Edit changed + COMMIT, ///< Commit recieved + 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 + SELECTION_SET ///< input method needs to set the selection }; /** @@ -117,9 +118,16 @@ public: */ 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 }; /** @@ -134,7 +142,9 @@ public: : predictiveString(), eventName( VOID ), cursorOffset( 0 ), - numberOfChars ( 0 ) + numberOfChars ( 0 ), + startIndex ( 0 ), + endIndex ( 0 ) { }; @@ -150,15 +160,36 @@ public: : predictiveString( aPredictiveString ), eventName( aEventName ), cursorOffset( aCursorOffset ), - numberOfChars( aNumberOfChars ) + numberOfChars( aNumberOfChars ), + startIndex ( 0 ), + endIndex ( 0 ) + { + } + + /** + * @brief Constructor + * + * @param[in] aEventName The name of the event from the InputMethodContext. + * @param[in] aStartIndex The start index of selection. + * @param[in] aEndIndex The end index of selection. + */ + EventData(EventType aEventName, int aStartIndex, int aEndIndex) + : predictiveString(), + eventName(aEventName), + cursorOffset(0), + numberOfChars(0), + startIndex(aStartIndex), + endIndex(aEndIndex) { } // Data std::string predictiveString; ///< The pre-edit or commit string. - EventType eventName; ///< The name of the event from the input method context. + 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 startIndex; ///< The start index of selection. + int endIndex; ///< The end index of selection. }; /** @@ -203,6 +234,8 @@ public: typedef Signal< void () > VoidSignalType; typedef Signal< void (bool) > StatusSignalType; + using PreEditAttributeDataContainer = Vector< Dali::InputMethodContext::PreeditAttributeData >; + public: /** @@ -323,11 +356,11 @@ public: void SetPreeditStyle( PreeditStyle type ); /** - * @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& attrs ) const; + void GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const; public: