Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / window-devel.h
1 #ifndef DALI_WINDOW_DEVEL_H
2 #define DALI_WINDOW_DEVEL_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/adaptor-framework/window.h>
23
24 namespace Dali
25 {
26 class KeyEvent;
27 class TouchData;
28 class WheelEvent;
29
30 namespace DevelWindow
31 {
32
33 typedef Signal< void () > EventProcessingFinishedSignalType;       ///< Event Processing finished signal type
34
35 typedef Signal< void (const KeyEvent&) > KeyEventSignalType;       ///< Key event signal type
36
37 typedef Signal< void (const TouchData&) > TouchSignalType;         ///< Touch signal type
38
39 typedef Signal< void (const WheelEvent&) > WheelEventSignalType;   ///< Touched signal type
40
41 /**
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.
43  *
44  * @param[in] window The window instance
45  * @param[in] positionSize The new window position and size
46  */
47 DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize );
48
49 /**
50  * @brief Adds a child Actor to the Window.
51  *
52  * The child will be referenced.
53  * @param[in] window The window instance
54  * @param[in] actor The child
55  * @pre The actor has been initialized.
56  * @pre The actor does not have a parent.
57  */
58 DALI_ADAPTOR_API void Add( Window window, Dali::Actor actor );
59
60 /**
61  * @brief Removes a child Actor from the Window.
62  *
63  * The child will be unreferenced.
64  * @param[in] window The window instance
65  * @param[in] actor The child
66  * @pre The actor has been added to the stage.
67  */
68 DALI_ADAPTOR_API void Remove( Window window, Dali::Actor actor );
69
70 /**
71  * @brief Sets the background color of the window.
72  *
73  * @param[in] window The window instance
74  * @param[in] color The new background color
75  */
76 DALI_ADAPTOR_API void SetBackgroundColor( Window window, Vector4 color );
77
78 /**
79  * @brief Gets the background color of the surface.
80  *
81  * @param[in] window The window instance
82  * @return The background color
83  */
84 DALI_ADAPTOR_API Vector4 GetBackgroundColor( Window window );
85
86 /**
87  * @brief Returns the Scene's Root Layer.
88  *
89  * @param[in] window The window instance
90  * @return The root layer
91  */
92 DALI_ADAPTOR_API Dali::Layer GetRootLayer( Window window );
93
94 /**
95  * @brief Queries the number of on-stage layers.
96  *
97  * Note that a default layer is always provided (count >= 1).
98  * @param[in] window The window instance
99  * @return The number of layers
100  */
101 DALI_ADAPTOR_API uint32_t GetLayerCount( Window window );
102
103 /**
104  * @brief Retrieves the layer at a specified depth.
105  *
106  * @param[in] window The window instance
107  * @param[in] depth The depth
108  * @return The layer found at the given depth
109  * @pre Depth is less than layer count; see GetLayerCount().
110  */
111 DALI_ADAPTOR_API Dali::Layer GetLayer( Window window, uint32_t depth );
112
113 /**
114  * @brief This signal is emitted just after the event processing is finished.
115  *
116  * @param[in] window The window instance
117  * @return The signal to connect to
118  */
119 DALI_ADAPTOR_API EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window );
120
121 /**
122  * @brief This signal is emitted when key event is received.
123  *
124  * A callback of the following type may be connected:
125  * @code
126  *   void YourCallbackName(const KeyEvent& event);
127  * @endcode
128  * @param[in] window The window instance
129  * @return The signal to connect to
130  */
131 DALI_ADAPTOR_API KeyEventSignalType& KeyEventSignal( Window window );
132
133 /**
134  * @brief This signal is emitted when the screen is touched and when the touch ends
135  * (i.e. the down & up touch events only).
136  *
137  * If there are multiple touch points, then this will be emitted when the first touch occurs and
138  * then when the last finger is lifted.
139  * An interrupted event will also be emitted (if it occurs).
140  * A callback of the following type may be connected:
141  * @code
142  *   void YourCallbackName( TouchData event );
143  * @endcode
144  *
145  * @param[in] window The window instance
146  * @return The touch signal to connect to
147  * @note Motion events are not emitted.
148  */
149 DALI_ADAPTOR_API TouchSignalType& TouchSignal( Window window );
150
151 /**
152  * @brief This signal is emitted when wheel event is received.
153  *
154  * A callback of the following type may be connected:
155  * @code
156  *   void YourCallbackName(const WheelEvent& event);
157  * @endcode
158  * @param[in] window The window instance
159  * @return The signal to connect to
160  */
161 DALI_ADAPTOR_API WheelEventSignalType& WheelEventSignal( Window window );
162
163 } // namespace DevelWindow
164
165 } // namespace Dali
166
167 #endif // DALI_WINDOW_DEVEL_H