[Tizen] Add align api to InputMethodContext 07/311007/3
authorBowon Ryu <bowon.ryu@samsung.com>
Mon, 13 May 2024 02:42:37 +0000 (11:42 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Mon, 13 May 2024 07:24:34 +0000 (16:24 +0900)
Change-Id: I72f2fd7d22abcf8dd74a8f89ab194da1c918d0ad
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
13 files changed:
dali/devel-api/adaptor-framework/input-method-context.cpp
dali/devel-api/adaptor-framework/input-method-context.h
dali/internal/input/common/input-method-context-impl.h
dali/internal/input/generic/input-method-context-impl-generic.cpp
dali/internal/input/generic/input-method-context-impl-generic.h
dali/internal/input/macos/input-method-context-impl-mac.cpp
dali/internal/input/macos/input-method-context-impl-mac.h
dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp
dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h
dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp
dali/internal/input/ubuntu-x11/input-method-context-impl-x.h
dali/internal/input/windows/input-method-context-impl-win.cpp
dali/internal/input/windows/input-method-context-impl-win.h

index e07cacdf88df953051d98707b96585d02bd83452..7481d5648f26ad65ed6d92cac21c72ff8dd8111a 100644 (file)
@@ -220,6 +220,11 @@ void InputMethodContext::SetInputPanelPosition(unsigned int x, unsigned int y)
   Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelPosition(x, y);
 }
 
+bool InputMethodContext::SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align)
+{
+  return Internal::Adaptor::InputMethodContext::GetImplementation(*this).SetInputPanelPositionAlign(x, y, align);
+}
+
 void InputMethodContext::GetPreeditStyle(PreEditAttributeDataContainer& attrs) const
 {
   Internal::Adaptor::InputMethodContext::GetImplementation(*this).GetPreeditStyle(attrs);
index 0487b068bbb7722115a2939c14d4b17612cae39f..8a768995aef544203b2d3e5a75e3a1dd07ffacf6 100644 (file)
@@ -99,6 +99,22 @@ public:
     ALPHABET   ///< Latin alphabet(default). It can be changed according to OSD(On Screen Display) language.
   };
 
+  /**
+   * @brief Enumeration for defining the types of Ecore_IMF Input Panel align.
+   */
+  enum class InputPanelAlign
+  {
+    TOP_LEFT,      ///< The top-left corner
+    TOP_CENTER,    ///< The top-center position
+    TOP_RIGHT,     ///< The top-right corner
+    MIDDLE_LEFT,   ///< The middle-left position
+    MIDDLE_CENTER, ///< The middle-center position
+    MIDDLE_RIGHT,  ///< The middle-right position
+    BOTTOM_LEFT,   ///< The bottom-left corner
+    BOTTOM_CENTER, ///< The bottom-center position
+    BOTTOM_RIGHT   ///< The bottom-right corner
+  };
+
   /**
    * @brief Enumeration for the preedit style types.
    */
@@ -515,6 +531,20 @@ public:
    */
   void SetInputPanelPosition(unsigned int x, unsigned int y);
 
+  /**
+   * @brief Sets the alignment and its x, y coordinates of the input panel.
+   *
+   * Regardless of the rotation degree, the x, y values of the top-left corner on the screen are based on 0, 0.
+   * When the IME size is changed, its size will change according to the set alignment.
+   *
+   * @param[in] x The x coordinate of the InputPanelAlign value.
+   * @param[in] y The y coordinate of the InputPanelAlign value.
+   * @param[in] align one of the InputPanelAlign values specifying the desired alignment.
+   * @return true on success, false otherwise.
+   * @remarks This API can be used to set the alignment of a floating IME.
+   */
+  bool SetInputPanelPositionAlign(int x, int y, InputPanelAlign align);
+
   /**
    * @brief Gets the preedit attributes data.
    *
index 6791e28504b812857dadbea15c0baf334728e053..4ede4153021c522e4c95ee636e99f20b8e21e22d 100644 (file)
@@ -367,6 +367,14 @@ public:
   {
   }
 
+  /**
+   * @copydoc Dali::InputMethodContext::SetInputPanelPositionAlign()
+   */
+  virtual bool SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align)
+  {
+    return false;
+  }
+
   /**
    * @copydoc Dali::InputMethodContext::GetPreeditStyle()
    */
@@ -461,6 +469,7 @@ protected:
       SET_INPUT_PANEL_DATA,
       SET_INPUT_PANEL_LANGUAGE,
       SET_INPUT_PANEL_POSITION,
+      SET_INPUT_PANEL_POSITION_ALIGN,
       SET_RETURN_KEY_STATE,
       MAX_COUNT
     };
index 7cbd688727e281388438f131a699f1d289f79157..765331b2336f603af70f1e672d1c555d514e9206 100644 (file)
@@ -291,19 +291,25 @@ void InputMethodContextGeneric::SetInputPanelLanguage(Dali::InputMethodContext::
 
 Dali::InputMethodContext::InputPanelLanguage InputMethodContextGeneric::GetInputPanelLanguage() const
 {
-  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextX::GetInputPanelLanguage\n");
+  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextGeneric::GetInputPanelLanguage\n");
 
   return Dali::InputMethodContext::InputPanelLanguage::AUTOMATIC;
 }
 
 void InputMethodContextGeneric::SetInputPanelPosition(unsigned int x, unsigned int y)
 {
-  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextX::SetInputPanelPosition\n");
+  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextGeneric::SetInputPanelPosition\n");
+}
+
+bool InputMethodContextGeneric::SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align)
+{
+  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextGeneric::SetInputPanelPositionAlign\n");
+  return false;
 }
 
 void InputMethodContextGeneric::GetPreeditStyle(Dali::InputMethodContext::PreEditAttributeDataContainer& attrs) const
 {
-  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextX::GetPreeditStyle\n");
+  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextGeneric::GetPreeditStyle\n");
   // Do Nothing
 }
 
index 34f3039fee88deaf5d9c272a3133881c84dac756..c665513b0e6afeb7ff12546fc19123dbd950eacb 100644 (file)
@@ -265,6 +265,11 @@ public:
    */
   void SetInputPanelPosition(unsigned int x, unsigned int y) override;
 
+  /**
+   * @copydoc Dali::InputMethodContext::SetInputPanelPositionAlign()
+   */
+  bool SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align) override;
+
   /**
    * @copydoc Dali::InputMethodContext::GetPreeditStyle()
    */
index 8c4654872602825c48ed1c45a971b580c8be61d1..219843e8314fa5d9d5e7398c8abf951c2dfe1ca8 100644 (file)
@@ -355,6 +355,12 @@ void InputMethodContextCocoa::SetInputPanelPosition(unsigned int x, unsigned int
   DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextCocoa::SetInputPanelPosition\n");
 }
 
+bool InputMethodContextCocoa::SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align)
+{
+  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextCocoa::SetInputPanelPositionAlign\n");
+  return false;
+}
+
 void InputMethodContextCocoa::GetPreeditStyle(Dali::InputMethodContext::PreEditAttributeDataContainer& attrs) const
 {
   DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextCocoa::GetPreeditStyle\n");
index 978446d83364413658dd2c2567fb91649e9535b9..16844b1aeb7289a9429f61e91819a6490d816b0b 100644 (file)
@@ -259,6 +259,11 @@ public:
    */
   void SetInputPanelPosition(unsigned int x, unsigned int y) override;
 
+  /**
+   * @copydoc Dali::InputMethodContext::SetInputPanelPositionAlign()
+   */
+  bool SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align) override;
+
   /**
    * @copydoc Dali::InputMethodContext::GetPreeditStyle()
    */
index bb5dcd754c72347742563dd91887ea5b2e88c46a..579f301b4af2ef4b029d33ead2c7952e95c8fafd 100644 (file)
@@ -1187,6 +1187,71 @@ void InputMethodContextEcoreWl::SetInputPanelPosition(unsigned int x, unsigned i
   mBackupOperations[Operation::SET_INPUT_PANEL_POSITION] = std::bind(&InputMethodContextEcoreWl::SetInputPanelPosition, this, x, y);
 }
 
+bool InputMethodContextEcoreWl::SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align)
+{
+  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextEcoreWl::SetInputPanelPositionAlign\n");
+  bool result = false;
+
+  if(mIMFContext)
+  {
+    Ecore_IMF_Input_Panel_Align inputPanelAlign = ECORE_IMF_INPUT_PANEL_ALIGN_TOP_LEFT;
+    switch (align)
+    {
+      case Dali::InputMethodContext::InputPanelAlign::TOP_LEFT:
+      {
+        inputPanelAlign = ECORE_IMF_INPUT_PANEL_ALIGN_TOP_LEFT;
+        break;
+      }
+      case Dali::InputMethodContext::InputPanelAlign::TOP_CENTER:
+      {
+        inputPanelAlign = ECORE_IMF_INPUT_PANEL_ALIGN_TOP_CENTER;
+        break;
+      }
+      case Dali::InputMethodContext::InputPanelAlign::TOP_RIGHT:
+      {
+        inputPanelAlign = ECORE_IMF_INPUT_PANEL_ALIGN_TOP_RIGHT;
+        break;
+      }
+      case Dali::InputMethodContext::InputPanelAlign::MIDDLE_LEFT:
+      {
+        inputPanelAlign = ECORE_IMF_INPUT_PANEL_ALIGN_MIDDLE_LEFT;
+        break;
+      }
+      case Dali::InputMethodContext::InputPanelAlign::MIDDLE_CENTER:
+      {
+        inputPanelAlign = ECORE_IMF_INPUT_PANEL_ALIGN_MIDDLE_CENTER;
+        break;
+      }
+      case Dali::InputMethodContext::InputPanelAlign::MIDDLE_RIGHT:
+      {
+        inputPanelAlign = ECORE_IMF_INPUT_PANEL_ALIGN_MIDDLE_RIGHT;
+        break;
+      }
+      case Dali::InputMethodContext::InputPanelAlign::BOTTOM_LEFT:
+      {
+        inputPanelAlign = ECORE_IMF_INPUT_PANEL_ALIGN_BOTTOM_LEFT;
+        break;
+      }
+      case Dali::InputMethodContext::InputPanelAlign::BOTTOM_CENTER:
+      {
+        inputPanelAlign = ECORE_IMF_INPUT_PANEL_ALIGN_BOTTOM_CENTER;
+        break;
+      }
+      case Dali::InputMethodContext::InputPanelAlign::BOTTOM_RIGHT:
+      {
+        inputPanelAlign = ECORE_IMF_INPUT_PANEL_ALIGN_BOTTOM_RIGHT;
+        break;
+      }
+    }
+
+    result = ecore_imf_context_input_panel_position_align_set(mIMFContext, x, y, inputPanelAlign);
+  }
+
+  mBackupOperations[Operation::SET_INPUT_PANEL_POSITION_ALIGN] = std::bind(&InputMethodContextEcoreWl::SetInputPanelPositionAlign, this, x, y, align);
+
+  return result;
+}
+
 void InputMethodContextEcoreWl::GetPreeditStyle(Dali::InputMethodContext::PreEditAttributeDataContainer& attrs) const
 {
   DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextEcoreWl::GetPreeditStyle\n");
index 0cdfcb72e5ea2252ddc634467ac070525029623a..d294fbc67976f851978c22a7d0841a0021a21bb5 100644 (file)
@@ -262,6 +262,11 @@ public:
    */
   void SetInputPanelPosition(unsigned int x, unsigned int y) override;
 
+  /**
+   * @copydoc Dali::InputMethodContext::SetInputPanelPositionAlign()
+   */
+  bool SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align) override;
+
   /**
    * @copydoc Dali::InputMethodContext::GetPreeditStyle()
    */
index 3f8abe017783e073b958ccdbb4e4da9146c32f55..0460378a3b6cde4ff5f091ec557d6a356e10069e 100644 (file)
@@ -845,6 +845,12 @@ void InputMethodContextX::SetInputPanelPosition(unsigned int x, unsigned int y)
   // ecore_imf_context_input_panel_position_set() is supported from ecore-imf 1.21.0 version.
 }
 
+bool InputMethodContextX::SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align)
+{
+  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextX::SetInputPanelPositionAlign\n");
+  return false;
+}
+
 void InputMethodContextX::GetPreeditStyle(Dali::InputMethodContext::PreEditAttributeDataContainer& attrs) const
 {
   DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextX::GetPreeditStyle\n");
index 4e028c2fc12d77d6b3a7ec8b4cdb5b698e3db475..d71b38c7a558627e3cb6d16899401b65bb8a5b92 100644 (file)
@@ -273,6 +273,11 @@ public:
    */
   void SetInputPanelPosition(unsigned int x, unsigned int y) override;
 
+  /**
+   * @copydoc Dali::InputMethodContext::SetInputPanelPositionAlign()
+   */
+  bool SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align) override;
+
   /**
    * @copydoc Dali::InputMethodContext::GetPreeditStyle()
    */
index 3308f608f7f6781ead2fe2e3f6854b8380ea06b9..5a280c4f49631f67beb3eeb11e4b92b063caef39 100644 (file)
@@ -367,6 +367,12 @@ void InputMethodContextWin::SetInputPanelPosition(unsigned int x, unsigned int y
   DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextWin::SetInputPanelPosition\n");\r
 }\r
 \r
+bool InputMethodContextWin::SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align)\r
+{\r
+  DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextWin::SetInputPanelPositionAlign\n");\r
+  return false;\r
+}\r
+\r
 void InputMethodContextWin::GetPreeditStyle(Dali::InputMethodContext::PreEditAttributeDataContainer& attrs) const\r
 {\r
   DALI_LOG_INFO(gLogFilter, Debug::General, "InputMethodContextWin::GetPreeditStyle\n");\r
index a36d0bd707dc25ab74567cde6fba70cbdac49c6f..5520b2f662a11c539e119de85330ed6aafd15268 100644 (file)
@@ -261,6 +261,11 @@ public:
    */\r
   void SetInputPanelPosition(unsigned int x, unsigned int y) override;\r
 \r
+  /**\r
+   * @copydoc Dali::InputMethodContext::SetInputPanelPositionAlign()\r
+   */\r
+  bool SetInputPanelPositionAlign(int x, int y, Dali::InputMethodContext::InputPanelAlign align) override;\r
+\r
   /**\r
    * @copydoc Dali::InputMethodContext::GetPreeditStyle()\r
    */\r