Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / window.h
index 404fd3e..fe28f45 100755 (executable)
@@ -1,8 +1,8 @@
-#ifndef __DALI_WINDOW_H__
-#define __DALI_WINDOW_H__
+#ifndef DALI_WINDOW_H
+#define DALI_WINDOW_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -68,9 +68,10 @@ public:
   typedef Uint16Pair WindowPosition;      ///< Window position type @SINCE_1_2.60
 
   typedef Signal< void (bool) > IndicatorSignalType;  ///< @DEPRECATED_1_4.9 @brief Indicator state signal type @SINCE_1_0.0
-  typedef Signal< void (bool) > FocusSignalType;         ///< Window focus signal type @SINCE_1_2.60
-  typedef Signal< void (WindowSize) > ResizedSignalType; ///< Window resized signal type @SINCE_1_2.60
-
+  typedef Signal< void (bool) > FocusSignalType;         ///< @DEPRECATED_1_4.35 @brief Window focus signal type @SINCE_1_2.60
+  typedef Signal< void (WindowSize) > ResizedSignalType; ///< @DEPRECATED_1_4.35 @brief Window resized signal type @SINCE_1_2.60
+  typedef Signal< void (Window,bool) > FocusChangeSignalType;         ///< Window focus signal type @SINCE_1_4.35
+  typedef Signal< void (Window,WindowSize) > ResizeSignalType; ///< Window resized signal type @SINCE_1_4.35
 public:
 
   // Enumerations
@@ -171,6 +172,7 @@ public:
    * @param[in] name The Window title
    * @param[in] isTransparent Whether Window is transparent
    * @return A new window
+   * @note This creates an extra window in addition to the default main window
    */
   static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
 
@@ -181,6 +183,7 @@ public:
    * @param[in] name The Window title
    * @param[in] className The Window class name
    * @param[in] isTransparent Whether Window is transparent
+   * @note This creates an extra window in addition to the default main window
    * @return A new Window
    */
   static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
@@ -220,6 +223,73 @@ public:
   Window& operator=(const Window& rhs);
 
   /**
+   * @brief Adds a child Actor to the Window.
+   *
+   * The child will be referenced.
+   *
+   * @SINCE_1_4.19
+   * @param[in] actor The child
+   * @pre The actor has been initialized.
+   * @pre The actor does not have a parent.
+   */
+  void Add( Actor actor );
+
+  /**
+   * @brief Removes a child Actor from the Window.
+   *
+   * The child will be unreferenced.
+   *
+   * @SINCE_1_4.19
+   * @param[in] actor The child
+   * @pre The actor has been added to the stage.
+   */
+  void Remove( Actor actor );
+
+  /**
+   * @brief Sets the background color of the Window.
+   *
+   * @SINCE_1_4.19
+   * @param[in] color The new background color
+   */
+  void SetBackgroundColor( const Vector4& color );
+
+  /**
+   * @brief Gets the background color of the Window.
+   *
+   * @SINCE_1_4.19
+   * @return The background color
+   */
+  Vector4 GetBackgroundColor() const;
+
+  /**
+   * @brief Returns the root Layer of the Window.
+   *
+   * @SINCE_1_4.19
+   * @return The root layer
+   */
+  Layer GetRootLayer() const;
+
+  /**
+   * @brief Queries the number of on-scene layers in the Window.
+   *
+   * Note that a default layer is always provided (count >= 1).
+   *
+   * @SINCE_1_4.19
+   * @return The number of layers
+   */
+  uint32_t GetLayerCount() const;
+
+  /**
+   * @brief Retrieves the layer at a specified depth in the Window.
+   *
+   * @SINCE_1_4.19
+   * @param[in] depth The depth
+   * @return The layer found at the given depth
+   * @pre Depth is less than layer count; see GetLayerCount().
+   */
+  Layer GetLayer( uint32_t depth ) const;
+
+  /**
    * @DEPRECATED_1_4.9
    * @brief This sets whether the indicator bar should be shown or not.
    * @SINCE_1_0.0
@@ -301,12 +371,13 @@ public:
   WindowOrientation GetPreferredOrientation();
 
   /**
-   * @brief Returns the Drag & drop detector which can be used to receive drag & drop events.
+   * @DEPRECATED_1_4.19 Was not intended for Application developers
+   * @brief Returns an empty handle.
    * @note  Not intended for application developers.
    * @SINCE_1_0.0
-   * @return A handle to the DragAndDropDetector
+   * @return An empty handle
    */
-  DragAndDropDetector GetDragAndDropDetector() const;
+  DragAndDropDetector GetDragAndDropDetector() const DALI_DEPRECATED_API;
 
   /**
    * @brief Gets the native handle of the window.
@@ -567,6 +638,7 @@ public: // Signals
   IndicatorSignalType& IndicatorVisibilityChangedSignal() DALI_DEPRECATED_API;
 
   /**
+   * @DEPRECATED_1_4.35
    * @brief The user should connect to this signal to get a timing when window gains focus or loses focus.
    *
    * A callback of the following type may be connected:
@@ -578,7 +650,7 @@ public: // Signals
    * @SINCE_1_2.60
    * @return The signal to connect to
    */
-  FocusSignalType& FocusChangedSignal();
+  FocusSignalType& FocusChangedSignal() DALI_DEPRECATED_API;
 
   /**
    * @brief This signal is emitted when the window is resized.
@@ -592,7 +664,37 @@ public: // Signals
    * @SINCE_1_2.60
    * @return The signal to connect to
    */
-  ResizedSignalType& ResizedSignal();
+  ResizedSignalType& ResizedSignal() DALI_DEPRECATED_API;
+
+  /**
+   * @brief The user should connect to this signal to get a timing when window gains focus or loses focus.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName( Window window, bool focusIn );
+   * @endcode
+   * The parameter is true if window gains focus, otherwise false.
+   * and window means this signal was called from what window
+   *
+   * @SINCE_1_4.35
+   * @return The signal to connect to
+   */
+  FocusChangeSignalType& FocusChangeSignal();
+
+  /**
+   * @brief This signal is emitted when the window is resized.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName( Window window, int width, int height );
+   * @endcode
+   * The parameters are the resized width and height.
+   * and window means this signal was called from what window
+   *
+   * @SINCE_1_4.35
+   * @return The signal to connect to
+   */
+  ResizeSignalType& ResizeSignal();
 
 public: // Not intended for application developers
   /// @cond internal