[ATSPI] Add ScrollStarted/ScrollFinished interface 24/284124/4
authorHosang Kim <hosang12.kim@samsung.com>
Fri, 28 Oct 2022 10:57:02 +0000 (19:57 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Thu, 10 Nov 2022 05:55:55 +0000 (14:55 +0900)
 This interface is used for scrollable object scroll started or
 finished.

Change-Id: I14c40e2bb624020762cc2c909410c7321d99e3f7

dali/devel-api/adaptor-framework/accessibility-bridge.h
dali/devel-api/adaptor-framework/accessibility.h
dali/devel-api/atspi-interfaces/accessible.h
dali/internal/accessibility/bridge/accessible.cpp
dali/internal/accessibility/bridge/bridge-object.cpp
dali/internal/accessibility/bridge/bridge-object.h
dali/internal/accessibility/bridge/dummy/dummy-atspi.cpp
dali/internal/accessibility/bridge/dummy/dummy-atspi.h

index 345686370b4e75285ea5f082d806e1edd9d96462..89217c72ae4daebacc970c920e06c95876c629c5 100644 (file)
@@ -267,6 +267,20 @@ struct DALI_ADAPTOR_API Bridge
    */
   virtual void EmitSocketAvailable(Accessible* obj) = 0;
 
+  /**
+   * @brief Emits ScrollStarted event on at-spi bus.
+   *
+   * @param obj Accessible Object
+   */
+  virtual void EmitScrollStarted(Accessible *obj) = 0;
+
+    /**
+   * @brief Emits ScrollFinished event on at-spi bus.
+   *
+   * @param obj Accessible Object
+   */
+  virtual void EmitScrollFinished(Accessible *obj) = 0;
+
   /**
    * @brief Emits state-changed event on at-spi bus.
    *
index 77c7257d2eab91d323dcdc8d83062bb235e408f0..a6c0da890d7914a10a0c74947dc937b3b5952d3b 100644 (file)
@@ -496,6 +496,8 @@ enum class AtspiEvent
   ATTRIBUTES_CHANGED,\r
   MOVED_OUT,\r
   WINDOW_CHANGED,\r
+  SCROLL_STARTED,\r
+  SCROLL_FINISHED,\r
   MAX_COUNT\r
 };\r
 \r
index edac6d975977f019e3afaab916ecd3469c9bbac4..0156cc952b8739628c6f13688bb092273e4621be 100644 (file)
@@ -138,6 +138,18 @@ public:
   // to spare a dynamic_cast if used like this: Accessible::Get()->Emit*(...)).
   void EmitSocketAvailable();
 
+  /**
+   * @brief Emits "ScrollStarted" event.
+   *
+   */
+  void EmitScrollStarted();
+
+  /**
+   * @brief Emits "ScrollFinished" event.
+   *
+   */
+  void EmitScrollFinished();
+
   /**
    * @brief Emits "highlighted" event.
    *
index c2a62b38b3737813d519321ad38a7bdba0e12703..d0e2700591410003b38922c5bd29926879eb5abe 100644 (file)
@@ -125,6 +125,22 @@ void Accessible::EmitSocketAvailable()
   }
 }
 
+void Accessible::EmitScrollStarted()
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bridgeData->mBridge->EmitScrollStarted(this);
+  }
+}
+
+void Accessible::EmitScrollFinished()
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bridgeData->mBridge->EmitScrollFinished(this);
+  }
+}
+
 void Accessible::Emit(WindowEvent event, unsigned int detail)
 {
   if(auto bridgeData = GetBridgeData())
index 26b697cca650c45a3b15e8a9b209c3ff50eb775f..d9c6d849db39ed7c532e781aff891ec1e6b278b9 100644 (file)
@@ -315,3 +315,31 @@ void BridgeObject::EmitSocketAvailable(Accessible* obj)
     obj->GetAddress(),
     {"", "root"});
 }
+
+void BridgeObject::EmitScrollStarted(Accessible* obj)
+{
+  if(!IsUp() || obj->IsHidden() || obj->GetSuppressedEvents()[AtspiEvent::SCROLL_STARTED])
+  {
+    return;
+  }
+
+  mDbusServer.emit2<Address>(
+    GetAccessiblePath(obj),
+    Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
+    "ScrollStarted",
+    {"", "root"});
+}
+
+void BridgeObject::EmitScrollFinished(Accessible* obj)
+{
+  if(!IsUp() || obj->IsHidden() || obj->GetSuppressedEvents()[AtspiEvent::SCROLL_FINISHED])
+  {
+    return;
+  }
+
+  mDbusServer.emit2<Address>(
+    GetAccessiblePath(obj),
+    Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
+    "ScrollFinished",
+    {"", "root"});
+}
\ No newline at end of file
index 9784469a02a6138818ac389876bad317dff725b2..1b6637dca1a058084292728c7b4417299f7b29c5 100644 (file)
@@ -90,6 +90,16 @@ protected:
    */
   void EmitSocketAvailable(Dali::Accessibility::Accessible* obj) override;
 
+  /**
+   * @copydoc Dali::Accessibility::Bridge::EmitScrollStarted()
+   */
+  void EmitScrollStarted(Dali::Accessibility::Accessible* obj) override;
+
+  /**
+   * @copydoc Dali::Accessibility::Bridge::EmitScrollFinished()
+   */
+  void EmitScrollFinished(Dali::Accessibility::Accessible* obj) override;
+
 protected:
   DBus::DBusInterfaceDescription::SignalId mStateChanged;
 };
index 713dd3cc8d8c2bc38205a309e771647d6b9e546f..b5e253be37f17990fd4f419695d53aa31db60f42 100644 (file)
@@ -141,6 +141,14 @@ void Accessibility::Accessible::EmitSocketAvailable()
 {
 }
 
+void Accessibility::Accessible::EmitScrollStarted()
+{
+}
+
+void Accessibility::Accessible::EmitScrollFinished()
+{
+}
+
 void Accessibility::Accessible::NotifyAccessibilityStateChange(Accessibility::States states, bool isRecursive)
 {
 }
index 12ab7c611fced44d12b0b05f6c1239ddae86dad2..36bb615fc905619839361c5fd2b35165c425effd 100644 (file)
@@ -130,6 +130,14 @@ struct DummyBridge : Dali::Accessibility::Bridge
   {
   }
 
+  void EmitScrollStarted(Accessibility::Accessible* obj) override
+  {
+  }
+
+  void EmitScrollFinished(Accessibility::Accessible* obj) override
+  {
+  }
+
   void EmitStateChanged(Accessibility::Accessible* obj, Accessibility::State state, int newValue, int reserved) override
   {
   }