1 #ifndef DALI_WINDOW_DEVEL_H
2 #define DALI_WINDOW_DEVEL_H
5 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/adaptor-framework/window.h>
33 typedef Signal< void () > EventProcessingFinishedSignalType; ///< Event Processing finished signal type
35 typedef Signal< void (const KeyEvent&) > KeyEventSignalType; ///< Key event signal type
37 typedef Signal< void (const TouchData&) > TouchSignalType; ///< Touch signal type
39 typedef Signal< void (const WheelEvent&) > WheelEventSignalType; ///< Touched signal type
42 * @brief Sets position and size of the window. This API guarantees that both moving and resizing of window will appear on the screen at once.
44 * @param[in] window The window instance
45 * @param[in] positionSize The new window position and size
47 DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize );
50 * @brief Retrieve the window that the given actor is added to.
52 * @param[in] actor The actor
53 * @return The window the actor is added to or an empty handle if the actor is not added to any window.
55 DALI_ADAPTOR_API Window Get( Actor actor );
58 * @brief Adds a child Actor to the Window.
60 * The child will be referenced.
61 * @param[in] window The window instance
62 * @param[in] actor The child
63 * @pre The actor has been initialized.
64 * @pre The actor does not have a parent.
66 DALI_ADAPTOR_API void Add( Window window, Dali::Actor actor );
69 * @brief Removes a child Actor from the Window.
71 * The child will be unreferenced.
72 * @param[in] window The window instance
73 * @param[in] actor The child
74 * @pre The actor has been added to the stage.
76 DALI_ADAPTOR_API void Remove( Window window, Dali::Actor actor );
79 * @brief Sets the background color of the window.
81 * @param[in] window The window instance
82 * @param[in] color The new background color
84 DALI_ADAPTOR_API void SetBackgroundColor( Window window, Vector4 color );
87 * @brief Gets the background color of the surface.
89 * @param[in] window The window instance
90 * @return The background color
92 DALI_ADAPTOR_API Vector4 GetBackgroundColor( Window window );
95 * @brief Returns the Scene's Root Layer.
97 * @param[in] window The window instance
98 * @return The root layer
100 DALI_ADAPTOR_API Dali::Layer GetRootLayer( Window window );
103 * @brief Queries the number of on-stage layers.
105 * Note that a default layer is always provided (count >= 1).
106 * @param[in] window The window instance
107 * @return The number of layers
109 DALI_ADAPTOR_API uint32_t GetLayerCount( Window window );
112 * @brief Retrieves the layer at a specified depth.
114 * @param[in] window The window instance
115 * @param[in] depth The depth
116 * @return The layer found at the given depth
117 * @pre Depth is less than layer count; see GetLayerCount().
119 DALI_ADAPTOR_API Dali::Layer GetLayer( Window window, uint32_t depth );
122 * @brief This signal is emitted just after the event processing is finished.
124 * @param[in] window The window instance
125 * @return The signal to connect to
127 DALI_ADAPTOR_API EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window );
130 * @brief This signal is emitted when key event is received.
132 * A callback of the following type may be connected:
134 * void YourCallbackName(const KeyEvent& event);
136 * @param[in] window The window instance
137 * @return The signal to connect to
139 DALI_ADAPTOR_API KeyEventSignalType& KeyEventSignal( Window window );
142 * @brief This signal is emitted when the screen is touched and when the touch ends
143 * (i.e. the down & up touch events only).
145 * If there are multiple touch points, then this will be emitted when the first touch occurs and
146 * then when the last finger is lifted.
147 * An interrupted event will also be emitted (if it occurs).
148 * A callback of the following type may be connected:
150 * void YourCallbackName( TouchData event );
153 * @param[in] window The window instance
154 * @return The touch signal to connect to
155 * @note Motion events are not emitted.
157 DALI_ADAPTOR_API TouchSignalType& TouchSignal( Window window );
160 * @brief This signal is emitted when wheel event is received.
162 * A callback of the following type may be connected:
164 * void YourCallbackName(const WheelEvent& event);
166 * @param[in] window The window instance
167 * @return The signal to connect to
169 DALI_ADAPTOR_API WheelEventSignalType& WheelEventSignal( Window window );
171 } // namespace DevelWindow
175 #endif // DALI_WINDOW_DEVEL_H