[Tizen] Add HandleActionForwardToAppEvent() for accessibility 51/278951/1 accepted/tizen/6.0/unified/20220819.122401 submit/tizen_6.0/20220818.073614
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 29 Jul 2022 00:06:12 +0000 (09:06 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 29 Jul 2022 00:09:44 +0000 (09:09 +0900)
- In Accessibility, One finger double tap and hold gesture is to pass
the event to the application.
- For the application, it can get the signal using
HandleActionForwardToAppEvent.

Change-Id: Ie85f6ca320f8f32683283bb30bd7b19976e06b62
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
dali/devel-api/adaptor-framework/accessibility-action-handler.h
dali/devel-api/adaptor-framework/accessibility-adaptor.cpp
dali/devel-api/adaptor-framework/accessibility-adaptor.h
dali/internal/accessibility/common/accessibility-adaptor-impl.cpp
dali/internal/accessibility/common/accessibility-adaptor-impl.h
dali/internal/window-system/common/event-handler.cpp

index 9ceaf581b13651229ec00c5ada6c30bd1785acbf..4dc5a1a8b2ec28be22318520cdc30cd53dc116aa 100644 (file)
@@ -196,6 +196,12 @@ public:
    */
   virtual bool AccessibilityActionStartStop() = 0;
 
+  /**
+   * Perform the accessibility action to forward the event to the application (by one finger double tap and hold).
+   * @return whether the accessibility action is performed or not.
+   */
+  virtual bool AccessibilityActionForwardToApp() = 0;
+
 }; // class AccessibilityActionHandler
 
 } // namespace Dali
index 711a6afbd3fb0e6e0e52f1492a4b7997f54facd9..eacea531fd4d0788f9b39edf7e17ec7a524c922d 100644 (file)
@@ -209,6 +209,11 @@ bool AccessibilityAdaptor::HandleActionStartStopEvent()
   return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionStartStopEvent();
 }
 
+bool AccessibilityAdaptor::HandleActionForwardToAppEvent()
+{
+  return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionForwardToAppEvent();
+}
+
 AccessibilityAdaptor::AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor& manager)
 : BaseHandle(&manager)
 {
index 47292c2bdc657660e23122a3efb338ffa066143c..47ae71060a41fc00e6853e4fbb3c1328222e3fb6 100644 (file)
@@ -324,6 +324,15 @@ public:
    */
   bool HandleActionStartStopEvent();
 
+  /**
+   * @brief Handle the accessibility action to forward it to the application
+   * (by one finger double tap and hold).
+   *
+   * This is a kind of backdoor to bypass the normal behaviour.
+   * @return Whether the action is performed successfully or not.
+   */
+  bool HandleActionForwardToAppEvent();
+
 public: // Not intended for application developers
   /**
    * @brief Creates a handle using the Adaptor::Internal implementation.
index b85b5d4bbf4ead6ed7c59d5c7faa02559534d6ab..6315ad75f388abe1c0c4aff549306f9e81c12cd3 100644 (file)
@@ -512,6 +512,19 @@ bool AccessibilityAdaptor::HandleActionStartStopEvent()
   return ret;
 }
 
+bool AccessibilityAdaptor::HandleActionForwardToAppEvent()
+{
+  bool ret = false;
+  if( mActionHandler )
+  {
+    ret = mActionHandler->AccessibilityActionForwardToApp();
+  }
+
+  DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
+
+  return ret;
+}
+
 AccessibilityAdaptor::~AccessibilityAdaptor()
 {
   // Do any platform specific clean-up in OnDestroy()
index 490e35292fbb069b0ca649620ae820d6344c7246..75b2ec0a1d5acc37f4f2c512e20712c14eb4054e 100644 (file)
@@ -244,6 +244,11 @@ public:
    */
   bool HandleActionStartStopEvent();
 
+  /**
+   * @copydoc Dali::AccessibilityAdaptor::HandleActionForwardToAppEvent()
+   */
+  bool HandleActionForwardToAppEvent();
+
 protected:
 
   /**
index 72249f9ecd0db2ddff0c780bcd97a08f15b6f6c6..be4f3f40b53ac5728bd5ed3011d443981e75629d 100755 (executable)
@@ -321,6 +321,14 @@ void EventHandler::OnAccessibilityNotification( const WindowBase::AccessibilityI
   // Send touch event to accessibility adaptor.
   TouchPoint point( 0, touchPointState, static_cast< float >( info.startX ), static_cast< float >( info.startY ) );
 
+  // Forward the event to the application.
+  // This is a kind of backdoor to bypass the normal behaviour.
+  if( info.gestureValue == 15 && info.state == 3 )
+  {
+    accessibilityAdaptor->HandleActionForwardToAppEvent();
+    return;
+  }
+
   // Perform actions based on received gestures.
   // Note: This is seperated from the reading so we can have other input readers without changing the below code.
   switch( info.gestureValue )