X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fwindow-devel.h;h=2a92b072706ccd57ea175cb80860920bc52773a6;hb=738fd571c706537f8897163684fcb9d3fd9d535e;hp=459c2894cf9560708309e4060628e5c96a65ba5d;hpb=abe404aa50089e1042631d5bb3254ad760552b65;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 459c289..2a92b07 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -2,7 +2,7 @@ #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. @@ -22,6 +22,9 @@ #include // INTERNAL INCLUDES +#include +#include +#include #include #include #include @@ -30,30 +33,31 @@ namespace Dali { class KeyEvent; class TouchEvent; +class HoverEvent; class WheelEvent; class RenderTaskList; struct TouchPoint; namespace DevelWindow { - -typedef Signal EventProcessingFinishedSignalType; ///< Event Processing finished signal type - -typedef Signal KeyEventSignalType; ///< Key event signal type - -typedef Signal TouchEventSignalType; ///< Touch signal type - -typedef Signal WheelEventSignalType; ///< Touched signal type - -typedef Signal VisibilityChangedSignalType; ///< Visibility changed signal type - -typedef Signal TransitionEffectEventSignalType; ///< Effect signal type and state - -typedef Signal KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type - -typedef Signal AuxiliaryMessageSignalType; ///< Auxiliary message signal type - -typedef Signal AccessibilityHighlightSignalType; ///< Accessibility Highlight signal type +typedef Signal EventProcessingFinishedSignalType; ///< Event Processing finished signal type +typedef Signal KeyEventSignalType; ///< Key event signal type +typedef Signal TouchEventSignalType; ///< Touch signal type +typedef Signal WheelEventSignalType; ///< Wheel signal type +typedef Signal VisibilityChangedSignalType; ///< Visibility changed signal type +typedef Signal TransitionEffectEventSignalType; ///< Effect signal type and state +typedef Signal KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type +typedef Signal AuxiliaryMessageSignalType; ///< Auxiliary message signal type +typedef Signal AccessibilityHighlightSignalType; ///< Accessibility Highlight signal type +typedef Signal InterceptKeyEventSignalType; ///< Intercept Key event signal type +typedef Signal MovedSignalType; ///< Window Moved signal type +typedef Signal OrientationChangedSignalType; ///< Window orientation changed signal type +typedef Signal MouseInOutEventSignalType; ///< MouseInOutEvent signal type +typedef Signal MouseRelativeEventSignalType; ///< MouseRelativeEvent signal type +typedef Signal MoveCompletedSignalType; ///< Window Moved by Server signal type +typedef Signal ResizeCompletedSignalType; ///< Window Resized by Server signal type +typedef Signal InsetsChangedSignalType; ///< InsetsChanged signal type +typedef Signal PointerConstraintsSignalType; ///< PointerConstraintsEvent signal type /** * @brief Creates an initialized handle to a new Window. @@ -64,7 +68,7 @@ typedef Signal AccessibilityHighlightSignalType; ///< Access * @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); /** @@ -225,14 +229,6 @@ DALI_ADAPTOR_API void Unparent(Window window); 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 @@ -359,6 +355,14 @@ DALI_ADAPTOR_API void RequestResizeToServer(Window window, WindowResizeDirection DALI_ADAPTOR_API void EnableFloatingMode(Window window, bool enable); /** + * @brief Returns whether the window is floating mode or not. + * + * @param[in] window The window instance. + * @return True if the window is enabled floating mode, false otherwise. + */ +DALI_ADAPTOR_API bool IsFloatingModeEnabled(Window window); + +/** * @brief Includes input region. * * This function inlcudes input regions. @@ -437,6 +441,13 @@ DALI_ADAPTOR_API void FeedWheelEvent(Window window, const Dali::WheelEvent& whee DALI_ADAPTOR_API void FeedKeyEvent(Window window, const Dali::KeyEvent& keyEvent); /** + * @brief Feed (Send) hover event to window + * @param[in] window The window instance + * @param[in] point The touch point that create a hover event + */ +DALI_ADAPTOR_API void FeedHoverEvent(Window window, const Dali::TouchPoint& point); + +/** * @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. @@ -459,6 +470,19 @@ DALI_ADAPTOR_API void Maximize(Window window, bool maximize); 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. @@ -481,6 +505,17 @@ DALI_ADAPTOR_API void Minimize(Window window, bool minimize); 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. @@ -488,6 +523,258 @@ DALI_ADAPTOR_API bool IsMinimized(Window window); */ 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 Gets the last hover event the window gets. + * + * @param[in] window The window instance. + * @return The last hover 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 HoverEvent& GetLastHoverEvent(Window window); + +/** + * @brief Sets the pointer constraints lock. + * + * @param[in] window The window instance. + * @return Returns true if PointerConstraintsLock succeeds. + */ +DALI_ADAPTOR_API bool PointerConstraintsLock(Window window); + +/** + * @brief Sets the pointer constraints unlock. + * + * @param[in] window The window instance. + * @return Returns true if PointerConstraintsUnlock succeeds. + */ +DALI_ADAPTOR_API bool PointerConstraintsUnlock(Window window); + +/** + * @brief Sets the locked pointer region + * + * @param[in] window The window instance. + * @param[in] x The x position. + * @param[in] y The y position. + * @param[in] width The width. + * @param[in] height The height + */ +DALI_ADAPTOR_API void LockedPointerRegionSet(Window window, int32_t x, int32_t y, int32_t width, int32_t height); + +/** + * @brief Sets the locked pointer cursor position hintset + * + * @param[in] window The window instance. + * @param[in] x The x position. + * @param[in] y The y position. + */ +DALI_ADAPTOR_API void LockedPointerCursorPositionHintSet(Window window, int32_t x, int32_t y); + +/** + * @brief Sets the pointer warp. The pointer moves to the set coordinates. + * + * @param[in] window The window instance. + * @param[in] x The x position. + * @param[in] y The y position. + * @return Returns true if PointerWarp succeeds. + */ +DALI_ADAPTOR_API bool PointerWarp(Window window, int32_t x, int32_t y); + +/** + * @brief Sets visibility on/off of cursor + * + * @param[in] window The window instance. + * @param[in] visible The visibility of cursor + */ +DALI_ADAPTOR_API void CursorVisibleSet(Window window, bool visible); + +/** + * @brief Requests grab key events according to the requested device subtype + * + * @param[in] window The window instance. + * @param[in] deviceSubclass The deviceSubclass type. + * @return Returns true if KeyboardGrab succeeds. + */ +DALI_ADAPTOR_API bool KeyboardGrab(Window window, Device::Subclass::Type deviceSubclass); + +/** + * @brief Requests ungrab key events + * + * @param[in] window The window instance. + * @return Returns true if KeyboardUnGrab succeeds. + */ +DALI_ADAPTOR_API bool KeyboardUnGrab(Window window); + +/** + * @brief Sets full screen sized window. + * If full screen size is set for the window, + * window will be resized with full screen size. + * In addition, the full screen sized window's z-order is the highest. + * + * @param[in] window The window instance. + * @param[in] fullscreen true to set fullscreen, false to unset. + */ +DALI_ADAPTOR_API void SetFullScreen(Window window, bool fullscreen); + +/** + * @brief Gets whether the full screen sized window or not + * + * @param[in] window The window instance. + * @return Returns true if the full screen sized window is. + */ +DALI_ADAPTOR_API bool GetFullScreen(Window window); + +/** + * @brief Enables or disables front buffer rendering. + * + * @param[in] window The window instance. + * @param[in] enable true to enable front buffer rendering, false to disable. + */ +DALI_ADAPTOR_API void SetFrontBufferRendering(Window window, bool enable); + +/** + * @brief Gets whether front buffer rendering is enabled. + * + * @param[in] window The window instance. + * @return Whether front buffer rendering has been enabled or not. + */ +DALI_ADAPTOR_API bool GetFrontBufferRendering(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); + +/** + * @brief This signal is emitted when the mouse relative event is received. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( Window window, Dali::MouseRelativeEvent event ); + * @endcode + * + * @param[in] window The window instance. + * @return The signal to connect to + */ +DALI_ADAPTOR_API MouseRelativeEventSignalType& MouseRelativeEventSignal(Window window); + +/** + * @brief This signal is emitted when window has been moved by the display server. + * To make the window move by display server, RequestMoveToServer() should be called. + * After the moving job is completed, this function will be called. + * + * 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 MoveCompletedSignalType& MoveCompletedSignal(Window window); + +/** + * @brief This signal is emitted when window has been resized by the display server. + * To make the window move by display server, RequestResizeToServer() should be called. + * After the resizing job is completed, this function will be called. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( Window window, Dali::Window::WindowPosition position ); + * @endcode + * The parameters are the resized width and height 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 ResizeCompletedSignalType& ResizeCompletedSignal(Window window); + +/** + * @brief This signal is emitted when window insets are changed by appearing or disappearing indicator, virtual keyboard, or clipboard. + * + * @param[in] window The window instance + * @return The signal to connect to + */ +DALI_ADAPTOR_API InsetsChangedSignalType& InsetsChangedSignal(Window window); + +/** + * @brief This signal is emitted when pointer is locked/unlocked + * + * @param[in] window The window instance + * @return The signal to connect to + */ +DALI_ADAPTOR_API PointerConstraintsSignalType& PointerConstraintsSignal(Window window); + } // namespace DevelWindow } // namespace Dali