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