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 class RenderTaskList;
30
31 namespace DevelWindow
32 {
33
34 typedef Signal< void () > EventProcessingFinishedSignalType;       ///< Event Processing finished signal type
35
36 typedef Signal< void (const KeyEvent&) > KeyEventSignalType;       ///< Key event signal type
37
38 typedef Signal< void (const TouchData&) > TouchSignalType;         ///< Touch signal type
39
40 typedef Signal< void (const WheelEvent&) > WheelEventSignalType;   ///< Touched signal type
41
42 /**
43  * @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  *
45  * @param[in] window The window instance
46  * @param[in] positionSize The new window position and size
47  */
48 DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize );
49
50 /**
51  * @brief Retrieves the list of render-tasks in the window.
52  *
53  * @param[in] window The window instance
54  * @return A valid handle to a RenderTaskList
55  */
56 DALI_ADAPTOR_API Dali::RenderTaskList GetRenderTaskList( Window window );
57
58 /**
59  * @brief Retrieve the window that the given actor is added to.
60  *
61  * @param[in] actor The actor
62  * @return The window the actor is added to or an empty handle if the actor is not added to any window.
63  */
64 DALI_ADAPTOR_API Window Get( Actor actor );
65
66 /**
67  * @brief This signal is emitted just after the event processing is finished.
68  *
69  * @param[in] window The window instance
70  * @return The signal to connect to
71  */
72 DALI_ADAPTOR_API EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window );
73
74 /**
75  * @brief This signal is emitted when key event is received.
76  *
77  * A callback of the following type may be connected:
78  * @code
79  *   void YourCallbackName(const KeyEvent& event);
80  * @endcode
81  * @param[in] window The window instance
82  * @return The signal to connect to
83  */
84 DALI_ADAPTOR_API KeyEventSignalType& KeyEventSignal( Window window );
85
86 /**
87  * @brief This signal is emitted when the screen is touched and when the touch ends
88  * (i.e. the down & up touch events only).
89  *
90  * If there are multiple touch points, then this will be emitted when the first touch occurs and
91  * then when the last finger is lifted.
92  * An interrupted event will also be emitted (if it occurs).
93  * A callback of the following type may be connected:
94  * @code
95  *   void YourCallbackName( TouchData event );
96  * @endcode
97  *
98  * @param[in] window The window instance
99  * @return The touch signal to connect to
100  * @note Motion events are not emitted.
101  */
102 DALI_ADAPTOR_API TouchSignalType& TouchSignal( Window window );
103
104 /**
105  * @brief This signal is emitted when wheel event is received.
106  *
107  * A callback of the following type may be connected:
108  * @code
109  *   void YourCallbackName(const WheelEvent& event);
110  * @endcode
111  * @param[in] window The window instance
112  * @return The signal to connect to
113  */
114 DALI_ADAPTOR_API WheelEventSignalType& WheelEventSignal( Window window );
115
116 /**
117  * @brief Sets parent window of the window.
118  *
119  * After setting that, these windows do together when raise-up, lower and iconified/deiconified.
120  * Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
121  * If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
122  *
123  * @param[in] window The window instance
124  * @param[in] parent The parent window instance
125  */
126 DALI_ADAPTOR_API void SetParent( Window window, Window parent );
127
128 /**
129  * @brief Unsets parent window of the window.
130  *
131  * After unsetting, the window is disconnected his parent window.
132  *
133  * @param[in] window The window instance
134  */
135 DALI_ADAPTOR_API void Unparent( Window window );
136
137 /**
138  * @brief Gets parent window of the window.
139  *
140  * @param[in] window The window instance
141  * @return The parent window of the window
142  */
143 DALI_ADAPTOR_API Window GetParent( Window window );
144
145 /**
146  * @brief Downcast sceneHolder to window
147  *
148  * @param[in] handle The handle need to downcast
149  * @return The window cast from SceneHolder
150  */
151 DALI_ADAPTOR_API Window DownCast(  BaseHandle handle );
152
153 } // namespace DevelWindow
154
155 } // namespace Dali
156
157 #endif // DALI_WINDOW_DEVEL_H