[Tizen] Add ShowInsideFridge function for Accessibility 72/288772/2 accepted/tizen/6.0/unified/20230223.002106 submit/tizen_6.0/20230222.141246 submit/tizen_6.0/20230222.142042
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 22 Feb 2023 13:25:53 +0000 (22:25 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 22 Feb 2023 13:28:22 +0000 (22:28 +0900)
- ShowInsideFridge() can tell which app is at the top of the layer.

Change-Id: I2ba90e6976e2f3c23b86fac0f67dd95a4ee60779
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
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 eacea53..68f2cf3 100644 (file)
@@ -43,8 +43,8 @@ Vector2 AccessibilityAdaptor::GetReadPosition() const
 
 void AccessibilityAdaptor::EnableAccessibility(bool enabled)
 {
-  SetForcedEnable( true );
-  if(enabled)
+  SetForcedEnable(true);
+  if (enabled)
   {
     Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).EnableAccessibility();
   }
@@ -59,11 +59,23 @@ bool AccessibilityAdaptor::IsEnabled() const
   return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).IsEnabled();
 }
 
-void AccessibilityAdaptor::SetForcedEnable( bool forced )
+void AccessibilityAdaptor::SetForcedEnable(bool forced)
 {
   Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetForcedEnable(forced);
 }
 
+void AccessibilityAdaptor::ShowInsideFridge(bool isShown)
+{
+  SetForcedShown(true);
+  Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).ShowInsideFridge(isShown);
+}
+
+void AccessibilityAdaptor::SetForcedShown(bool forced)
+{
+  Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetForcedShown(forced);
+}
+
+
 void AccessibilityAdaptor::SetActionHandler(AccessibilityActionHandler& handler)
 {
   Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetActionHandler(handler);
index 47ae710..69d907d 100644 (file)
@@ -89,7 +89,19 @@ public:
    * @brief Sets Accessibility enabled forcibly.
    * @param forced Whether accessibility sets enabled forcibly
    */
-  void SetForcedEnable( bool forced );
+  void SetForcedEnable(bool forced);
+
+  /**
+   * @brief Checks whether Inside Fridge is shown or not.
+   * @param[in] isShown True if Inside Fridge is shown.
+   */
+  void ShowInsideFridge(bool isShown);
+
+  /**
+   * @brief Sets Inside Fridge shown forcibly.
+   * @param[in] forced Whether Inside Fridge shown forcibly
+   */
+  void SetForcedShown(bool forced);
 
   /**
    * @brief Set the handler to handle accessibility actions.
index 80b678b..e8aad87 100644 (file)
@@ -55,7 +55,9 @@ AccessibilityAdaptor::AccessibilityAdaptor()
   mFocusedActorPosition(-1.0f, -1.0f),
   mActionHandler( NULL ),
   mIsEnabled( false ),
-  mIsForced( false )
+  mIsForced( false ),
+  mIsInsideFridgeShown( false ),
+  mIsForcedShown( false )
 {
   mAccessibilityGestureDetector = new AccessibilityGestureDetector();
 }
@@ -113,7 +115,7 @@ bool AccessibilityAdaptor::IsEnabled() const
   return mIsEnabled;
 }
 
-void AccessibilityAdaptor::SetForcedEnable( bool forced )
+void AccessibilityAdaptor::SetForcedEnable(bool forced)
 {
   mIsForced = forced;
 }
@@ -123,6 +125,26 @@ bool AccessibilityAdaptor::IsForcedEnable() const
   return mIsForced;
 }
 
+void AccessibilityAdaptor::ShowInsideFridge(bool isShown)
+{
+  mIsInsideFridgeShown = isShown;
+}
+
+bool AccessibilityAdaptor::IsInsideFridgeShown() const
+{
+  return mIsInsideFridgeShown;
+}
+
+void AccessibilityAdaptor::SetForcedShown(bool forced)
+{
+  mIsForcedShown = forced;
+}
+
+bool AccessibilityAdaptor::IsForcedShown() const
+{
+  return mIsForcedShown;
+}
+
 Vector2 AccessibilityAdaptor::GetReadPosition() const
 {
   return mReadPosition;
index 75b2ec0..b6db12b 100644 (file)
@@ -89,6 +89,26 @@ public:
   bool IsForcedEnable() const;
 
   /**
+   * @copydoc Dali::AccessibilityAdaptor::ShowInsideFridge()
+   */
+  void ShowInsideFridge(bool isShown);
+
+  /**
+   * Whether Inside Fridge is shown.
+   */
+  bool IsInsideFridgeShown() const;
+
+  /**
+   * @copydoc Dali::AccessibilityAdaptor::SetForcedShown()
+   */
+  void SetForcedShown(bool forced);
+
+  /**
+   * Whether Inside Fridge shown forcibly or not.
+   */
+  bool IsForcedShown() const;
+
+  /**
    * @copydoc Dali::AccessibilityAdaptor::GetReadPosition() const
    */
   Vector2 GetReadPosition() const;
@@ -281,9 +301,10 @@ protected:
 
   AccessibilityGestureDetectorPtr mAccessibilityGestureDetector; ///< The accessibility gesture detector
 
-  bool mIsEnabled        : 1; ///< enable/disable the accessibility action
-
-  bool mIsForced         : 1; ///< Is the accessibility enabled forcibly
+  bool mIsEnabled           : 1; ///< enable/disable the accessibility action
+  bool mIsForced            : 1; ///< Is the accessibility enabled forcibly
+  bool mIsInsideFridgeShown : 1; ///< Is inside fridge shown
+  bool mIsForcedShown       : 1; ///< Is inside fridge shown forcibly
 
 public:
 
index 1429ada..3851c1c 100755 (executable)
@@ -318,6 +318,21 @@ void EventHandler::OnAccessibilityNotification( const WindowBase::AccessibilityI
     }
   }
 
+  if( accessibilityAdaptor->IsForcedShown() )
+  {
+    DALI_LOG_ERROR("InsideFridge app calls the API \n");
+    if( accessibilityAdaptor->IsInsideFridgeShown() )
+    {
+      DALI_LOG_ERROR("Is Inside Fridge shown [TRUE] -> Enable \n");
+      accessibilityAdaptor->EnableAccessibility();
+    }
+    else
+    {
+      DALI_LOG_ERROR("Is Inside Fridge shown [FALSE] -> Disable \n");
+      accessibilityAdaptor->DisableAccessibility();
+    }
+  }
+
   if( !accessibilityAdaptor->IsEnabled() )
   {
     DALI_LOG_ERROR( "The current dali accessibility is not available. \n" );
@@ -622,7 +637,7 @@ void EventHandler::OnAccessibilityQuickpanelChanged( const unsigned char& info )
     }
     else
     {
-      DALI_LOG_ERROR("[FYI] Only Apps show and it is a forced dali -> EnableAccessibility \n");
+      DALI_LOG_ERROR("[FYI] Only Apps show and it is a forced dali -> (Apps) EnableAccessibility \n");
       accessibilityAdaptor->EnableAccessibility();
     }
   }