The Window will highlight itself on NUI side.
The GrabHighlight emits the Highlight signal.
Change-Id: I2296685688056359afe5ce807d0b61deb280c091
bool GrabHighlight() override
{
- return false;
+ if(!IsUp())
+ {
+ return false;
+ }
+
+ // Only window accessible is able to grab and clear highlight
+ if(!mRoot)
+ {
+ return false;
+ }
+
+ auto self = Self();
+ auto oldHighlightedActor = GetCurrentlyHighlightedActor();
+ if(self == oldHighlightedActor)
+ {
+ return true;
+ }
+
+ // Clear the old highlight.
+ if(oldHighlightedActor)
+ {
+ auto oldHighlightedObject = Dali::Accessibility::Component::DownCast(Accessible::Get(oldHighlightedActor));
+ if(oldHighlightedObject)
+ {
+ oldHighlightedObject->ClearHighlight();
+ }
+ }
+
+ SetCurrentlyHighlightedActor(self);
+
+ auto window = Dali::DevelWindow::Get(self);
+ Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation(window);
+ windowImpl.EmitAccessibilityHighlightSignal(true);
+
+ return true;
}
bool ClearHighlight() override
{
- return false;
+ if(!IsUp())
+ {
+ return false;
+ }
+
+ // Only window accessible is able to grab and clear highlight
+ if(!mRoot)
+ {
+ return false;
+ }
+
+ auto self = Self();
+ if(self != GetCurrentlyHighlightedActor())
+ {
+ return false;
+ }
+
+ SetCurrentlyHighlightedActor({});
+
+ auto window = Dali::DevelWindow::Get(self);
+ Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation(window);
+ windowImpl.EmitAccessibilityHighlightSignal(false);
+
+ return true;
}
Role GetRole() const override
return GetImplementation(window).AuxiliaryMessageSignal();
}
+AccessibilityHighlightSignalType& AccessibilityHighlightSignal(Window window)
+{
+ return GetImplementation(window).AccessibilityHighlightSignal();
+}
+
void SetParent(Window window, Window parent)
{
GetImplementation(window).SetParent(parent);
typedef Signal<void(const std::string&, const std::string&, const Property::Array&)> AuxiliaryMessageSignalType; ///< Auxiliary message signal type
+typedef Signal<void(Window, bool)> AccessibilityHighlightSignalType; ///< Accessibility Highlight signal type
+
/**
* @brief Creates an initialized handle to a new Window.
*
DALI_ADAPTOR_API AuxiliaryMessageSignalType& AuxiliaryMessageSignal(Window window);
/**
+ * @brief This signal is emitted when the window needs to grab or clear accessibility highlight.
+ * The highlight indicates that it is an object to interact with the user regardless of focus.
+ * After setting the highlight on the object, you can do things that the object can do, such as
+ * giving or losing focus.
+ *
+ * This signal is emitted by Dali::Accessibility::Component::GrabHighlight
+ * and Dali::Accessibility::Component::ClearHighlight
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( Window window, bool highlight );
+ * @endcode
+ *
+ * @param[in] window The window instance
+ * @return The signal to connect to
+ */
+DALI_ADAPTOR_API AccessibilityHighlightSignalType& AccessibilityHighlightSignal(Window window);
+
+/**
* @brief Sets parent window of the window.
*
* After setting that, these windows do together when raise-up, lower and iconified/deiconified.
mWindowBase->SetPositionSizeWithAngle(positionSize, angle);
}
+void Window::EmitAccessibilityHighlightSignal(bool highlight)
+{
+ Dali::Window handle(this);
+ mAccessibilityHighlightSignal.Emit(handle, highlight);
+}
+
void Window::SetAvailableAnlges(const std::vector<int>& angles)
{
if(angles.size() > 4)
typedef Dali::DevelWindow::TransitionEffectEventSignalType TransitionEffectEventSignalType;
typedef Dali::DevelWindow::KeyboardRepeatSettingsChangedSignalType KeyboardRepeatSettingsChangedSignalType;
typedef Dali::DevelWindow::AuxiliaryMessageSignalType AuxiliaryMessageSignalType;
+ typedef Dali::DevelWindow::AccessibilityHighlightSignalType AccessibilityHighlightSignalType;
typedef Signal<void()> SignalType;
/**
*/
void SetPositionSizeWithOrientation(PositionSize positionSize, WindowOrientation orientation);
+ /**
+ * @brief Emit the accessibility highlight signal.
+ * The highlight indicates that it is an object to interact with the user regardless of focus.
+ * After setting the highlight on the object, you can do things that the object can do, such as
+ * giving or losing focus.
+ *
+ * @param[in] highlight If window needs to grab or clear highlight.
+ */
+ void EmitAccessibilityHighlightSignal(bool highlight);
+
public: // Dali::Internal::Adaptor::SceneHolder
/**
* @copydoc Dali::Internal::Adaptor::SceneHolder::GetNativeHandle
return mAuxiliaryMessageSignal;
}
+ /**
+ * @copydoc Dali::DevelWindow::AccessibilityHighlightSignal()
+ */
+ AccessibilityHighlightSignalType& AccessibilityHighlightSignal()
+ {
+ return mAccessibilityHighlightSignal;
+ }
+
private:
WindowRenderSurface* mWindowSurface; ///< The window rendering surface
WindowBase* mWindowBase;
TransitionEffectEventSignalType mTransitionEffectEventSignal;
KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal;
AuxiliaryMessageSignalType mAuxiliaryMessageSignal;
+ AccessibilityHighlightSignalType mAccessibilityHighlightSignal;
};
} // namespace Adaptor