Formatting API
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / window-devel.h
old mode 100755 (executable)
new mode 100644 (file)
index 958b940..613a9c2
@@ -2,7 +2,7 @@
 #define DALI_WINDOW_DEVEL_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  *
  */
 
+// EXTERNAL INCLUDES
+#include <memory>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/window.h>
+#include <dali/public-api/common/vector-wrapper.h>
 
 namespace Dali
 {
 class KeyEvent;
-class TouchData;
+class TouchEvent;
 class WheelEvent;
 class RenderTaskList;
 
@@ -35,32 +39,34 @@ namespace DevelWindow
  */
 enum class EffectState
 {
-  NONE = 0,    ///< None state
-  START,       ///< Transition effect is started.
-  END          ///< Transition effect is ended.
+  NONE = 0, ///< None state
+  START,    ///< Transition effect is started.
+  END       ///< Transition effect is ended.
 };
 
 /**
  * @brief Enumeration for transition effect's type.
  */
-enum class  EffectType
+enum class EffectType
 {
-  NONE = 0,    ///< None type
-  SHOW,        ///< Window show effect.
-  HIDE,        ///< Window hide effect.
+  NONE = 0, ///< None type
+  SHOW,     ///< Window show effect.
+  HIDE,     ///< Window hide effect.
 };
 
-typedef Signal< void () > EventProcessingFinishedSignalType;       ///< Event Processing finished 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 KeyEvent&) > KeyEventSignalType;       ///< Key event signal type
+typedef Signal<void(const TouchEvent&)> TouchEventSignalType; ///< Touch signal type
 
-typedef Signal< void (const TouchData&) > TouchSignalType;         ///< Touch signal type
+typedef Signal<void(const WheelEvent&)> WheelEventSignalType; ///< Touched 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, bool ) > VisibilityChangedSignalType; ///< Visibility changed signal type
+typedef Signal<void(Window, EffectState, EffectType)> 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
 
 /**
  * @brief Creates an initialized handle to a new Window.
@@ -93,15 +99,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 );
-
-/**
- * @brief Retrieves the list of render-tasks in the window.
- *
- * @param[in] window The window instance
- * @return A valid handle to a RenderTaskList
- */
-DALI_ADAPTOR_API Dali::RenderTaskList GetRenderTaskList( Window window );
+DALI_ADAPTOR_API void SetPositionSize(Window window, PositionSize positionSize);
 
 /**
  * @brief Retrieve the window that the given actor is added to.
@@ -109,7 +107,7 @@ DALI_ADAPTOR_API Dali::RenderTaskList GetRenderTaskList( Window window );
  * @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.
@@ -117,37 +115,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 );
-
-/**
- * @brief This signal is emitted when key event is received.
- *
- * A callback of the following type may be connected:
- * @code
- *   void YourCallbackName(const KeyEvent& event);
- * @endcode
- * @param[in] window The window instance
- * @return The signal to connect to
- */
-DALI_ADAPTOR_API KeyEventSignalType& KeyEventSignal( Window window );
-
-/**
- * @brief This signal is emitted when the screen is touched and when the touch ends
- * (i.e. the down & up touch events only).
- *
- * If there are multiple touch points, then this will be emitted when the first touch occurs and
- * then when the last finger is lifted.
- * An interrupted event will also be emitted (if it occurs).
- * A callback of the following type may be connected:
- * @code
- *   void YourCallbackName( TouchData event );
- * @endcode
- *
- * @param[in] window The window instance
- * @return The touch signal to connect to
- * @note Motion events are not emitted.
- */
-DALI_ADAPTOR_API TouchSignalType& TouchSignal( Window window );
+DALI_ADAPTOR_API EventProcessingFinishedSignalType& EventProcessingFinishedSignal(Window window);
 
 /**
  * @brief This signal is emitted when wheel event is received.
@@ -159,7 +127,7 @@ DALI_ADAPTOR_API TouchSignalType& TouchSignal( Window window );
  * @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.
@@ -171,7 +139,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.
@@ -186,7 +154,15 @@ 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.
+ *
+ * @param[in] window The window instance
+ * @return The signal to connect to
+ */
+DALI_ADAPTOR_API KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal(Window window);
 
 /**
  * @brief Sets parent window of the window.
@@ -198,7 +174,7 @@ DALI_ADAPTOR_API TransitionEffectEventSignalType& TransitionEffectEventSignal( W
  * @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.
@@ -207,7 +183,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.
@@ -215,7 +191,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
@@ -223,7 +199,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.
@@ -231,7 +207,7 @@ 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 Dali::Window::WindowOrientation GetCurrentOrientation(Window window);
 
 /**
  * @brief Sets available orientations of the window.
@@ -241,14 +217,48 @@ DALI_ADAPTOR_API Dali::Window::WindowOrientation GetCurrentOrientation( Window w
  * @param[in] window The window instance
  * @param[in] orientations The available orientation list to add
  */
-DALI_ADAPTOR_API void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations );
+DALI_ADAPTOR_API void SetAvailableOrientations(Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations);
 
 /**
  * @brief Gets current window ID.
  *
  * @param[in] window The window instance
  */
-DALI_ADAPTOR_API int32_t GetNativeId( Window window );
+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.
+ *
+ * @param[in] window The window instance
+ * @param[in] callback The function to call
+ * @param[in] frameId The Id to specify the frame. It will be passed when the callback is called.
+ *
+ * @note A callback of the following type may be used:
+ * @code
+ *   void MyFunction( int frameId );
+ * @endcode
+ * This callback will be deleted once it is called.
+ *
+ * @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);
+
+/**
+ * @brief Adds a callback that is called when the frame is displayed on the display.
+ *
+ * @param[in] window The window instance
+ * @param[in] callback The function to call
+ * @param[in] frameId The Id to specify the frame. It will be passed when the callback is called.
+ *
+ * @note A callback of the following type may be used:
+ * @code
+ *   void MyFunction( int frameId );
+ * @endcode
+ * This callback will be deleted once it is called.
+ *
+ * @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);
 
 } // namespace DevelWindow