#define DALI_WINDOW_DEVEL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <memory>
// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/mouse-in-out-event.h>
#include <dali/public-api/adaptor-framework/window-enumerations.h>
#include <dali/public-api/adaptor-framework/window.h>
#include <dali/public-api/common/vector-wrapper.h>
class TouchEvent;
class WheelEvent;
class RenderTaskList;
+struct TouchPoint;
namespace DevelWindow
{
-typedef Signal<void()> EventProcessingFinishedSignalType; ///< Event Processing finished signal type
-
-typedef Signal<void(const KeyEvent&)> KeyEventSignalType; ///< Key event signal type
-
-typedef Signal<void(const TouchEvent&)> TouchEventSignalType; ///< Touch signal type
-
-typedef Signal<void(const WheelEvent&)> WheelEventSignalType; ///< Touched signal type
-
-typedef Signal<void(Window, bool)> VisibilityChangedSignalType; ///< Visibility changed signal type
-
-typedef Signal<void(Window, WindowEffectState, WindowEffectType)> TransitionEffectEventSignalType; ///< Effect signal type and state
-
-typedef Signal<void()> KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type
+typedef Signal<void()> EventProcessingFinishedSignalType; ///< Event Processing finished signal type
+typedef Signal<void(const KeyEvent&)> KeyEventSignalType; ///< Key event signal type
+typedef Signal<void(const TouchEvent&)> TouchEventSignalType; ///< Touch signal type
+typedef Signal<void(const WheelEvent&)> WheelEventSignalType; ///< Wheel signal type
+typedef Signal<void(Window, bool)> VisibilityChangedSignalType; ///< Visibility changed signal type
+typedef Signal<void(Window, WindowEffectState, WindowEffectType)> TransitionEffectEventSignalType; ///< Effect signal type and state
+typedef Signal<void()> KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type
+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
+typedef Signal<bool(const KeyEvent&)> InterceptKeyEventSignalType; ///< Intercept Key event signal type
+typedef Signal<void(Window, Dali::Window::WindowPosition)> MovedSignalType; ///< Window Moved signal type
+typedef Signal<void(Window, Dali::WindowOrientation)> OrientationChangedSignalType; ///< Window orientation changed signal type
+typedef Signal<void(Window, const Dali::DevelWindow::MouseInOutEvent&)> MouseInOutEventSignalType; ///< MouseInOutEvent signal type
/**
* @brief Creates an initialized handle to a new Window.
* @param[in] isTransparent Whether Window is transparent
* @return A new window
* @note This creates an extra window in addition to the default main window
-*/
+ */
DALI_ADAPTOR_API Window New(Any surface, PositionSize windowPosition, const std::string& name, bool isTransparent = false);
/**
DALI_ADAPTOR_API KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal(Window window);
/**
+ * @brief This signal is emitted when window's auxiliary was changed then display server sent the message.
+ *
+ * Auxiliary message is sent by display server.
+ * When client application added the window's auxiliary hint and if the auxiliary is changed,
+ * display server send the auxiliary message.
+ * Auxiliary message has the key, value and options.
+ *
+ * @param[in] window The window instance
+ * @return The signal to connect to
+ */
+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.
DALI_ADAPTOR_API Window GetParent(Window window);
/**
- * @brief Downcast sceneHolder to window
- *
- * @param[in] handle The handle need to downcast
- * @return The window cast from SceneHolder
- */
-DALI_ADAPTOR_API Window DownCast(BaseHandle handle);
-
-/**
* @brief Gets current orientation of the window.
*
* @param[in] window The window instance
*/
DALI_ADAPTOR_API void ExcludeInputRegion(Window window, const Rect<int>& inputRegion);
+/**
+ * @brief Sets the necessary for window rotation Acknowledgement.
+ * After this function called, SendRotationCompletedAcknowledgement() should be called to complete window rotation.
+ *
+ * This function is supprot that application has the window rotation acknowledgement's control.
+ * It means display server waits when application's rotation work is finished.
+ * It is useful application has the other rendering engine which works asynchronous.
+ * For instance, GlView.
+ * It only works on Tizen device.
+ *
+ * @param[in] window The window instance.
+ * @param[in] needAcknowledgement the flag is true if window rotation acknowledge is sent.
+ */
+DALI_ADAPTOR_API void SetNeedsRotationCompletedAcknowledgement(Window window, bool needAcknowledgement);
+
+/**
+ * @brief send the Acknowledgement to complete window rotation.
+ * For this function, SetNeedsRotationCompletedAcknowledgement should be already called with true.
+ *
+ * @param[in] window The window instance.
+ */
+DALI_ADAPTOR_API void SendRotationCompletedAcknowledgement(Window window);
+
+/**
+ * @brief Feed (Send) touch event to window
+ * @param[in] window The window instance
+ * @param[in] point The touch point
+ * @param[in] timeStamp The time stamp
+ */
+DALI_ADAPTOR_API void FeedTouchPoint(Window window, const Dali::TouchPoint& point, int32_t timeStamp);
+
+/**
+ * @brief Feed (Send) wheel event to window
+ * @param[in] window The window instance
+ * @param[in] wheelEvent The wheel event
+ */
+DALI_ADAPTOR_API void FeedWheelEvent(Window window, const Dali::WheelEvent& wheelEvent);
+
+/**
+ * @brief Feed (Send) key event to window
+ * @param[in] window The window instance
+ * @param[in] keyEvent The key event holding the key information.
+ */
+DALI_ADAPTOR_API void FeedKeyEvent(Window window, const Dali::KeyEvent& keyEvent);
+
+/**
+ * @brief Maximizes window's size.
+ * If this function is called with true, window will be resized with screen size.
+ * Otherwise window will be resized with previous size.
+ * It is for the window's MAX button in window's border.
+ *
+ * It is for client application.
+ * If window border is supported by display server, it is not necessary.
+ *
+ * @param[in] window The window instance.
+ * @param[in] maximize If window is maximized or unmaximized.
+ */
+DALI_ADAPTOR_API void Maximize(Window window, bool maximize);
+
+/**
+ * @brief Returns whether the window is maximized or not.
+ *
+ * @param[in] window The window instance.
+ * @return True if the window is maximized, false otherwise.
+ */
+DALI_ADAPTOR_API bool IsMaximized(Window window);
+
+/**
+ * @brief Sets window's maximum size.
+ *
+ * It is to set the maximized size when window is maximized or the window's size is increased by RequestResizeToServer().
+ * Although the size is set by this function, window's size can be increased over the limitation by SetPositionSize() or SetSize().
+ *
+ * After setting, if Maximize() is called, window is resized with the setting size and move the center.
+ *
+ * @param[in] window The window instance.
+ * @param[in] size the maximum size
+ */
+DALI_ADAPTOR_API void SetMaximumSize(Window window, Dali::Window::WindowSize size);
+
+/**
+ * @brief Minimizes window's size.
+ * If this function is called with true, window will be iconified.
+ * Otherwise window will be activated.
+ * It is for the window's MIN button in window border.
+ *
+ * It is for client application.
+ * If window border is supported by display server, it is not necessary.
+ *
+ * @param[in] window The window instance.
+ * @param[in] minimize If window is minimized or unminimized(activated).
+ */
+DALI_ADAPTOR_API void Minimize(Window window, bool minimize);
+
+/**
+ * @brief Returns whether the window is minimized or not.
+ *
+ * @param[in] window The window instance.
+ * @return True if the window is minimized, false otherwise.
+ */
+DALI_ADAPTOR_API bool IsMinimized(Window window);
+
+/**
+ * @brief Sets window's minimum size.
+ *
+ * It is to set the minimum size when window's size is decreased by RequestResizeToServer().
+ * Although the size is set by this function, window's size can be decreased over the limitation by SetPositionSize() or SetSize().
+ *
+ * @param[in] window The window instance.
+ * @param[in] size the minimum size
+ */
+DALI_ADAPTOR_API void SetMimimumSize(Window window, Dali::Window::WindowSize size);
+
+/**
+ * @brief Query whether window is rotating or not.
+ *
+ * @param[in] window The window instance.
+ * @return true if window is rotating, false otherwise.
+ */
+DALI_ADAPTOR_API bool IsWindowRotating(Window window);
+
+/**
+ * @brief Gets the last key event the window gets.
+ *
+ * @param[in] window The window instance.
+ * @return The last key event the window gets.
+ */
+DALI_ADAPTOR_API const KeyEvent& GetLastKeyEvent(Window window);
+
+/**
+ * @brief Gets the last touch event the window gets.
+ *
+ * @param[in] window The window instance.
+ * @return The last touch event the window gets.
+ * @note It returns the raw event the window gets. There is no hit-actor and local position information.
+ */
+DALI_ADAPTOR_API const TouchEvent& GetLastTouchEvent(Window window);
+
+/**
+ * @brief The user would connect to this signal to intercept a KeyEvent at window.
+ *
+ * Intercepts KeyEvents in the window before dispatching KeyEvents to the control.
+ * If a KeyEvent is consumed, no KeyEvent is delivered to the control.
+ *
+ * @param[in] window The window instance.
+ * @return The signal to connect to
+ */
+DALI_ADAPTOR_API InterceptKeyEventSignalType& InterceptKeyEventSignal(Window window);
+
+/**
+ * @brief This signal is emitted when the window is moved.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( Window window, Dali::Window::WindowPosition position );
+ * @endcode
+ * The parameters are the moved x and y coordinates.
+ * and window means this signal was called from what window
+ *
+ * @param[in] window The window instance.
+ * @return The signal to connect to
+ */
+DALI_ADAPTOR_API MovedSignalType& MovedSignal(Window window);
+
+/**
+ * @brief This signal is emitted when the window orientation is changed.
+ *
+ * To emit Window Orientation signal, AddAvailableOrientation() or SetPreferredOrientation() should be called before device is rotated.
+ * Most of cases, AddAvailableOrientation() or SetPreferredOrientation() is callled in onCreate().
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( Window window, Dali::WindowOrientation orientation );
+ * @endcode
+ * The parameter is the changed window orientation.
+ * and window means this signal was called from what window
+ *
+ * @param[in] window The window instance.
+ * @return The signal to connect to
+ */
+DALI_ADAPTOR_API OrientationChangedSignalType& OrientationChangedSignal(Window window);
+
+/**
+ * @brief This signal is emitted when the mouse in or out event is received.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( Window window, Dali::MouseInOutEvent event );
+ * @endcode
+ *
+ * @param[in] window The window instance.
+ * @return The signal to connect to
+ */
+DALI_ADAPTOR_API MouseInOutEventSignalType& MouseInOutEventSignal(Window window);
+
} // namespace DevelWindow
} // namespace Dali