[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 9ceaf58..4dc5a1a 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 711a6af..eacea53 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 47292c2..47ae710 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 b85b5d4..6315ad7 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 490e352..75b2ec0 100644 (file)
@@ -244,6 +244,11 @@ public:
    */
   bool HandleActionStartStopEvent();
 
+  /**
+   * @copydoc Dali::AccessibilityAdaptor::HandleActionForwardToAppEvent()
+   */
+  bool HandleActionForwardToAppEvent();
+
 protected:
 
   /**
index 72249f9..be4f3f4 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 )