[Tizen] Modify to get the encoded offset in UTF8
[platform/core/uifw/dali-adaptor.git] / dali / internal / input / ubuntu-x11 / input-method-context-impl-x.h
index 4c2b1b5..e707386 100755 (executable)
@@ -39,21 +39,22 @@ namespace Internal
 namespace Adaptor
 {
 
-class InputMethodContextX : public Dali::Internal::Adaptor::InputMethodContext
+class InputMethodContextX : public Dali::Internal::Adaptor::InputMethodContext, public Dali::ConnectionTracker
 {
 public:
   /**
    * @brief Creates a new InputMethodContext handle
    *
+   * @param[in] actor The actor that uses the new InputMethodContext instance.
    * @return InputMethodContext pointer
    */
-  static InputMethodContextPtr New();
+  static InputMethodContextPtr New( Dali::Actor actor );
 
   /**
    * Constructor
-   * @param[in] ecoreXwin, The window is created by application.
+   * @param[in] actor The actor that uses the new InputMethodContext instance.
    */
-  explicit InputMethodContextX( Ecore_X_Window ecoreXwin );
+  explicit InputMethodContextX( Dali::Actor actor );
 
 public:
 
@@ -112,12 +113,12 @@ public:
   /**
    * @copydoc Dali::InputMethodContext::PreEditChanged()
    */
-  void PreEditChanged( void* data, ImfContext* imfContext, void* event_info ) override;
+  void PreEditChanged( void* data, ImfContext* imfContext, void* eventInfo ) override;
 
   /**
    * @copydoc Dali::InputMethodContext::NotifyCursorPosition()
    */
-  void CommitReceived( void* data, ImfContext* imfContext, void* event_info ) override;
+  void CommitReceived( void* data, ImfContext* imfContext, void* eventInfo ) override;
 
   /**
    * @copydoc Dali::InputMethodContext::NotifyCursorPosition()
@@ -127,12 +128,18 @@ public:
   /**
    * @copydoc Dali::InputMethodContext::DeleteSurrounding()
    */
-  void DeleteSurrounding( void* data, ImfContext* imfContext, void* event_info ) override;
+  void DeleteSurrounding( void* data, ImfContext* imfContext, void* eventInfo ) override;
 
   /**
    * @copydoc Dali::InputMethodContext::SendPrivateCommand()
    */
-  void SendPrivateCommand( void* data, ImfContext* imfContext, void* event_info ) override
+  void SendPrivateCommand( void* data, ImfContext* imfContext, void* eventInfo ) override
+  {}
+
+  /**
+   * @copydoc Dali::InputMethodContext::SendCommitContent()
+   */
+  void SendCommitContent( void* data, ImfContext* imfContext, void* eventInfo ) override
   {}
 
   // Cursor related
@@ -227,6 +234,11 @@ public:
   std::string GetInputPanelLocale() override;
 
   /**
+   * @copydoc Dali::InputMethodContext::SetContentMIMETypes()
+   */
+  void SetContentMIMETypes( const std::string& mimeTypes ) override;
+
+  /**
    * @copydoc Dali::InputMethodContext::FilterEventKey()
    */
   bool FilterEventKey( const Dali::KeyEvent& keyEvent ) override;
@@ -251,12 +263,21 @@ public:
    */
   Dali::InputMethodContext::InputPanelLanguage GetInputPanelLanguage() const override;
 
+  /**
+   * @copydoc Dali::InputMethodContext::SetInputPanelPosition()
+   */
+  void SetInputPanelPosition( unsigned int x, unsigned int y ) override;
+
+  /**
+   * @copydoc Dali::InputMethodContext::GetPreeditStyle()
+   */
+  void GetPreeditStyle( Dali::InputMethodContext::PreEditAttributeDataContainer& attrs ) const override;
+
 private:
   /**
    * Context created the first time and kept until deleted.
-   * @param[in] ecoreXwin, The window is created by application.
    */
-  void CreateContext( Ecore_X_Window ecoreXwin );
+  void CreateContext();
 
   /**
    * @copydoc Dali::InputMethodContext::DeleteContext()
@@ -296,6 +317,11 @@ private:
    */
   Ecore_IMF_Keyboard_Locks EcoreInputModifierToEcoreIMFLock( unsigned int modifier );
 
+  /**
+   * Called when the binded actor is added to a window.
+   */
+  void OnStaged( Dali::Actor actor );
+
 public:
 
   /**
@@ -320,6 +346,7 @@ 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;
+  Dali::InputMethodContext::PreEditAttributeDataContainer mPreeditAttrs; ///< Stores preedit attribute data
 };
 
 } // namespace Adaptor