#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.
#include <memory>
// INTERNAL INCLUDES
+#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>
-#include <dali/public-api/adaptor-framework/window-enumerations.h>
namespace Dali
{
namespace DevelWindow
{
-
typedef Signal<void()> EventProcessingFinishedSignalType; ///< Event Processing finished signal type
typedef Signal<void(const KeyEvent&)> KeyEventSignalType; ///< Key event signal type
DALI_ADAPTOR_API WindowOrientation GetCurrentOrientation(Window window);
/**
+ * @brief Gets current physical orientation of the window.
+ *
+ * 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
+ * @return The current physical orientation degree of the window. It is one of them as 0, 90, 180 and 270.
+ */
+DALI_ADAPTOR_API int GetPhysicalOrientation(Window window);
+
+/**
* @brief Sets available orientations of the window.
*
* This API is for setting several orientations one time.
*/
DALI_ADAPTOR_API void AddFramePresentedCallback(Window window, std::unique_ptr<CallbackBase> 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<int>& 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<int>& inputRegion);
+
} // namespace DevelWindow
} // namespace Dali