X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Fwindow-devel.h;h=108b4f40cd753ac59950b2dea6a8fa482f1d6947;hb=refs%2Fchanges%2F32%2F262232%2F11;hp=af4ca19f2a0788bd9b7461b9d5e31db7c5d0d17f;hpb=f45a20b0a007099c9c6542ef0dbdddbdc917353a;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 af4ca19..108b4f4 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) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,51 +22,32 @@ #include // INTERNAL INCLUDES -#include +#include #include +#include namespace Dali { -struct KeyEvent; -class TouchData; -struct WheelEvent; +class KeyEvent; +class TouchEvent; +class WheelEvent; class RenderTaskList; namespace DevelWindow { -/** - * @brief Enumeration for transition effect's state. - */ -enum class EffectState -{ - NONE = 0, ///< None state - START, ///< Transition effect is started. - END ///< Transition effect is ended. -}; - -/** - * @brief Enumeration for transition effect's type. - */ -enum class EffectType -{ - NONE = 0, ///< None type - SHOW, ///< Window show effect. - HIDE, ///< Window hide effect. -}; +typedef Signal EventProcessingFinishedSignalType; ///< Event Processing finished signal type -typedef Signal< void () > EventProcessingFinishedSignalType; ///< Event Processing finished signal type +typedef Signal KeyEventSignalType; ///< Key event signal type -typedef Signal< void (const KeyEvent&) > KeyEventSignalType; ///< Key event signal type +typedef Signal TouchEventSignalType; ///< Touch signal type -typedef Signal< void (const TouchData&) > TouchSignalType; ///< Touch signal type +typedef Signal WheelEventSignalType; ///< Touched signal type -typedef Signal< void (const WheelEvent&) > WheelEventSignalType; ///< Touched signal type +typedef Signal VisibilityChangedSignalType; ///< Visibility changed signal type -typedef Signal< void ( Window, bool ) > VisibilityChangedSignalType; ///< Visibility changed signal type +typedef Signal TransitionEffectEventSignalType; ///< Effect signal type and state -typedef Signal< void (Window, EffectState, EffectType) > TransitionEffectEventSignalType; ///< Effect signal type and state - -typedef Signal< void () > KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type +typedef Signal KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type /** * @brief Creates an initialized handle to a new Window. @@ -99,7 +80,7 @@ DALI_ADAPTOR_API Window New(Any surface, PositionSize windowPosition, const std: * @param[in] window The window instance * @param[in] positionSize The new window position and size */ -DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize ); +DALI_ADAPTOR_API void SetPositionSize(Window window, PositionSize positionSize); /** * @brief Retrieve the window that the given actor is added to. @@ -107,7 +88,7 @@ DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize * @param[in] actor The actor * @return The window the actor is added to or an empty handle if the actor is not added to any window. */ -DALI_ADAPTOR_API Window Get( Actor actor ); +DALI_ADAPTOR_API Window Get(Actor actor); /** * @brief This signal is emitted just after the event processing is finished. @@ -115,7 +96,7 @@ DALI_ADAPTOR_API Window Get( Actor actor ); * @param[in] window The window instance * @return The signal to connect to */ -DALI_ADAPTOR_API EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window ); +DALI_ADAPTOR_API EventProcessingFinishedSignalType& EventProcessingFinishedSignal(Window window); /** * @brief This signal is emitted when wheel event is received. @@ -127,7 +108,7 @@ DALI_ADAPTOR_API EventProcessingFinishedSignalType& EventProcessingFinishedSigna * @param[in] window The window instance * @return The signal to connect to */ -DALI_ADAPTOR_API WheelEventSignalType& WheelEventSignal( Window window ); +DALI_ADAPTOR_API WheelEventSignalType& WheelEventSignal(Window window); /** * @brief This signal is emitted when the window is shown or hidden. @@ -139,7 +120,7 @@ DALI_ADAPTOR_API WheelEventSignalType& WheelEventSignal( Window window ); * @param[in] window The window instance * @return The signal to connect to */ -DALI_ADAPTOR_API VisibilityChangedSignalType& VisibilityChangedSignal( Window window ); +DALI_ADAPTOR_API VisibilityChangedSignalType& VisibilityChangedSignal(Window window); /** * @brief This signal is emitted for transition effect. @@ -154,7 +135,7 @@ DALI_ADAPTOR_API VisibilityChangedSignalType& VisibilityChangedSignal( Window wi * @param[in] window The window instance * @return The signal to connect to */ -DALI_ADAPTOR_API TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window ); +DALI_ADAPTOR_API TransitionEffectEventSignalType& TransitionEffectEventSignal(Window window); /** * @brief This signal is emitted just after the keyboard repeat setting is changed globally. @@ -162,7 +143,7 @@ DALI_ADAPTOR_API TransitionEffectEventSignalType& TransitionEffectEventSignal( W * @param[in] window The window instance * @return The signal to connect to */ -DALI_ADAPTOR_API KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal( Window window ); +DALI_ADAPTOR_API KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal(Window window); /** * @brief Sets parent window of the window. @@ -174,7 +155,7 @@ DALI_ADAPTOR_API KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettings * @param[in] window The window instance * @param[in] parent The parent window instance */ -DALI_ADAPTOR_API void SetParent( Window window, Window parent ); +DALI_ADAPTOR_API void SetParent(Window window, Window parent); /** * @brief Unsets parent window of the window. @@ -183,7 +164,7 @@ DALI_ADAPTOR_API void SetParent( Window window, Window parent ); * * @param[in] window The window instance */ -DALI_ADAPTOR_API void Unparent( Window window ); +DALI_ADAPTOR_API void Unparent(Window window); /** * @brief Gets parent window of the window. @@ -191,7 +172,7 @@ DALI_ADAPTOR_API void Unparent( Window window ); * @param[in] window The window instance * @return The parent window of the window */ -DALI_ADAPTOR_API Window GetParent( Window window ); +DALI_ADAPTOR_API Window GetParent(Window window); /** * @brief Downcast sceneHolder to window @@ -199,7 +180,7 @@ DALI_ADAPTOR_API Window GetParent( Window window ); * @param[in] handle The handle need to downcast * @return The window cast from SceneHolder */ -DALI_ADAPTOR_API Window DownCast( BaseHandle handle ); +DALI_ADAPTOR_API Window DownCast(BaseHandle handle); /** * @brief Gets current orientation of the window. @@ -207,34 +188,38 @@ DALI_ADAPTOR_API Window DownCast( BaseHandle handle ); * @param[in] window The window instance * @return The current window orientation if previously set, or none */ -DALI_ADAPTOR_API Dali::Window::WindowOrientation GetCurrentOrientation( Window window ); +DALI_ADAPTOR_API WindowOrientation GetCurrentOrientation(Window window); /** - * @brief Sets available orientations of the window. + * @brief Gets current physical orientation of the window. * - * This API is for setting several orientations one time. + * It means current physical rotation angle of the window. + * If the height of the display device's area is greater than the width, + * default current orientation is PORTRAIT and current physical orientation angle is 0. + * If the width of the display device's area is greater than the height, + * default current orientation is LANDSCAPE and current physical orientation angle is 0. * * @param[in] window The window instance - * @param[in] orientations The available orientation list to add + * @return The current physical orientation degree of the window. It is one of them as 0, 90, 180 and 270. */ -DALI_ADAPTOR_API void SetAvailableOrientations( Window window, const Dali::Vector& orientations ); +DALI_ADAPTOR_API int GetPhysicalOrientation(Window window); /** - * @brief Gets current window ID. + * @brief Sets available orientations of the window. + * + * This API is for setting several orientations one time. * * @param[in] window The window instance + * @param[in] orientations The available orientation list to add */ -DALI_ADAPTOR_API int32_t GetNativeId( Window window ); +DALI_ADAPTOR_API void SetAvailableOrientations(Window window, const Dali::Vector& orientations); /** - * @brief Sets damaged areas of the window. - * - * This API is for setting static damaged areas of the window for partial update. + * @brief Gets current window ID. * * @param[in] window The window instance - * @param[in] areas The damaged areas list to set */ -DALI_ADAPTOR_API void SetDamagedAreas(Window window, std::vector>& areas); +DALI_ADAPTOR_API int32_t GetNativeId(Window window); /** * @brief Adds a callback that is called when the frame rendering is done by the graphics driver. @@ -251,7 +236,7 @@ DALI_ADAPTOR_API void SetDamagedAreas(Window window, std::vector * * @note Ownership of the callback is passed onto this class. */ -DALI_ADAPTOR_API void AddFrameRenderedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId ); +DALI_ADAPTOR_API void AddFrameRenderedCallback(Window window, std::unique_ptr callback, int32_t frameId); /** * @brief Adds a callback that is called when the frame is displayed on the display. @@ -268,7 +253,93 @@ DALI_ADAPTOR_API void AddFrameRenderedCallback( Window window, std::unique_ptr< * * @note Ownership of the callback is passed onto this class. */ -DALI_ADAPTOR_API void AddFramePresentedCallback( Window window, std::unique_ptr< CallbackBase > callback, int32_t frameId ); +DALI_ADAPTOR_API void AddFramePresentedCallback(Window window, std::unique_ptr callback, int32_t frameId); + +/** + * @brief Sets window position and size for specific orientation. + * This api reserves the position and size per orientation to display server. + * When the device is rotated, the window is moved/resized with the reserved position/size by display server. + * + * @param[in] window The window instance + * @param[in] positionSize The reserved position and size for the orientation + * @param[in] orientation The orientation + * + * @note Currently, it only works when the window's type is WindowType::IME. + * @note To set WindowType::IME, use Application New(... WindowType type), not Window::SetType(). + * @note This function is only useful in Tizen world. + */ +DALI_ADAPTOR_API void SetPositionSizeWithOrientation(Window window, PositionSize positionSize, WindowOrientation orientation); + +/** + * @brief Requests to display server for the window is moved by display server. + * + * This function should be called in mouse down event callback function. + * After this function is called in mouse down event callback function, the window is moved with mouse move event. + * When mouse up event happens, the window moved work is finished. + * + * @param[in] window The window instance + */ +DALI_ADAPTOR_API void RequestMoveToServer(Window window); + +/** + * @brief Requests to display server for the window is resized by display server. + * + * This function should be called in mouse down event callback function. + * After this function is called in mouse down event callback function, the window is resized with mouse move event. + * The direction is selected one of eight ways. + * When mouse up event happens, the window resized work is finished. + * + * @param[in] window The window instance + * @param[in] direction it is indicated the window's side or edge for starting point. + */ +DALI_ADAPTOR_API void RequestResizeToServer(Window window, WindowResizeDirection direction); + +/** + * @brief Enables the floating mode of window. + * + * The floating mode is to support making partial size window easliy. + * It is useful to make popup style window and this window is always upper than the other normal window. + * In addition, it is easy to change between popup style and normal style window. + * + * A special display server(as a Tizen display server) supports this mode. + * + * @param[in] window The window instance. + * @param[in] enable Enable floating mode or not. + */ +DALI_ADAPTOR_API void EnableFloatingMode(Window window, bool enable); + +/** + * @brief Includes input region. + * + * This function inlcudes input regions. + * It can be used multiple times and supports multiple regions. + * It means input region will be extended. + * + * This input is related to mouse and touch event. + * If device has touch screen, this function is useful. + * Otherwise device does not have that, we can use it after connecting mouse to the device. + * + * @param[in] window The window instance. + * @param[in] inputRegion The added region to accept input events. + */ +DALI_ADAPTOR_API void IncludeInputRegion(Window window, const Rect& inputRegion); + +/** + * @brief Excludes input region. + * + * This function excludes input regions. + * It can be used multiple times and supports multiple regions. + * It means input region will be reduced. + * Nofice, should be set input area by IncludeInputRegion() before this function is used. + * + * This input is related to mouse and touch event. + * If device has touch screen, this function is useful. + * Otherwise device does not have that, we can use it after connecting mouse to the device. + * + * @param[in] window The window instance. + * @param[in] inputRegion The subtracted region to except input events. + */ +DALI_ADAPTOR_API void ExcludeInputRegion(Window window, const Rect& inputRegion); } // namespace DevelWindow