Revert "[Tizen] Remove to call key consumed event in ATSPI bridge"
[platform/core/uifw/dali-adaptor.git] / dali / internal / accessibility / bridge / bridge-impl.cpp
index 6484620..e274ad8 100644 (file)
@@ -122,7 +122,14 @@ public:
       }
     }
 
-    return Consumed::NO;
+    auto methodObject = mRegistryClient.method<bool(std::tuple<uint32_t, int32_t, int32_t, int32_t, int32_t, std::string, bool>)>("NotifyListenersSync");
+    auto result       = methodObject.call(std::tuple<uint32_t, int32_t, int32_t, int32_t, int32_t, std::string, bool>{keyType, 0, static_cast<int32_t>(keyCode), 0, static_cast<int32_t>(timeStamp), keyName, isText ? 1 : 0});
+    if(!result)
+    {
+      LOG() << result.getError().message;
+      return Consumed::NO;
+    }
+    return std::get<0>(result) ? Consumed::YES : Consumed::NO;
   }
 
   /**
@@ -418,6 +425,52 @@ public:
   }
 
   /**
+   * @brief Sends a signal to dbus that the window is minimized.
+   *
+   * @param[in] window The window to be minimized
+   * @see BridgeObject::Emit()
+   */
+  void EmitMinimize(Dali::Window window)
+  {
+    auto windowAccessible = mApplication.GetWindowAccessible(window);
+    if(windowAccessible)
+    {
+      windowAccessible->Emit(WindowEvent::MINIMIZE, 0);
+    }
+  }
+
+  /**
+   * @brief Sends a signal to dbus that the window is restored.
+   *
+   * @param[in] window The window to be restored
+   * @param[in] detail Restored window state
+   * @see BridgeObject::Emit()
+   */
+  void EmitRestore(Dali::Window window, Dali::Accessibility::WindowRestoreType detail)
+  {
+    auto windowAccessible = mApplication.GetWindowAccessible(window);
+    if(windowAccessible)
+    {
+      windowAccessible->Emit(WindowEvent::RESTORE, static_cast<unsigned int>(detail));
+    }
+  }
+
+  /**
+   * @brief Sends a signal to dbus that the window is maximized.
+   *
+   * @param[in] window The window to be maximized
+   * @see BridgeObject::Emit()
+   */
+  void EmitMaximize(Dali::Window window)
+  {
+    auto windowAccessible = mApplication.GetWindowAccessible(window);
+    if(windowAccessible)
+    {
+      windowAccessible->Emit(WindowEvent::MAXIMIZE, 0);
+    }
+  }
+
+  /**
    * @copydoc Dali::Accessibility::Bridge::WindowShown()
    */
   void WindowShown(Dali::Window window) override
@@ -462,6 +515,39 @@ public:
   }
 
   /**
+   * @copydoc Dali::Accessibility::Bridge::WindowMinimized()
+   */
+  void WindowMinimized(Dali::Window window) override
+  {
+    if(IsUp())
+    {
+      EmitMinimize(window);
+    }
+  }
+
+  /**
+   * @copydoc Dali::Accessibility::Bridge::WindowRestored()
+   */
+  void WindowRestored(Dali::Window window, WindowRestoreType detail) override
+  {
+    if(IsUp())
+    {
+      EmitRestore(window, detail);
+    }
+  }
+
+  /**
+   * @copydoc Dali::Accessibility::Bridge::WindowMaximized()
+   */
+  void WindowMaximized(Dali::Window window) override
+  {
+    if(IsUp())
+    {
+      EmitMaximize(window);
+    }
+  }
+
+  /**
    * @copydoc Dali::Accessibility::Bridge::SuppressScreenReader()
    */
   void SuppressScreenReader(bool suppress) override