[AT-SPI] Implement Component for ProxyAccessible 02/273902/5
authorArtur Świgoń <a.swigon@samsung.com>
Fri, 15 Apr 2022 12:53:32 +0000 (14:53 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Mon, 25 Apr 2022 09:31:09 +0000 (11:31 +0200)
The Component interface is required for the object not to be immediately
filtered out by bridge-side navigation code. When a ProxyAccessible is
serialized to an object address as a return value on D-Bus, its address
is replaced by the remote address (stored in `mAddress`), so any further
interaction by AT clients (D-Bus method calls) will be directed to the
actual remote object.

Change-Id: I268e219eb30ecd016ab2ab78dcd0846b551a9e42

dali/devel-api/adaptor-framework/proxy-accessible.h

index a5985e1..33e6b1b 100644 (file)
@@ -24,6 +24,7 @@
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/accessibility.h>
 #include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/component.h>
 
 namespace Dali::Accessibility
 {
@@ -34,7 +35,7 @@ namespace Dali::Accessibility
  * a different bridge (embedding for example), but the object itself isn't planned to be used
  * otherwise. This object has a settable parent, no children, an empty name and so on.
  */
-class DALI_ADAPTOR_API ProxyAccessible : public virtual Accessible
+class DALI_ADAPTOR_API ProxyAccessible : public virtual Accessible, public virtual Component
 {
 public:
   ProxyAccessible()
@@ -133,6 +134,48 @@ public:
     return Dali::Actor{};
   }
 
+  Rect<> GetExtents(CoordinateType type) const override
+  {
+    auto* parent = Component::DownCast(mParent);
+
+    return parent ? parent->GetExtents(type) : Rect<>{};
+  }
+
+  ComponentLayer GetLayer() const override
+  {
+    return ComponentLayer::WINDOW;
+  }
+
+  int16_t GetMdiZOrder() const override
+  {
+    return false;
+  }
+
+  bool GrabFocus() override
+  {
+    return false;
+  }
+
+  double GetAlpha() const override
+  {
+    return 0.0;
+  }
+
+  bool GrabHighlight() override
+  {
+    return false;
+  }
+
+  bool ClearHighlight() override
+  {
+    return false;
+  }
+
+  bool IsScrollable() const override
+  {
+    return false;
+  }
+
 private:
   Address     mAddress;
   Accessible* mParent;