1 #ifndef DALI_INTEGRATION_SCENEHOLDER_H
2 #define DALI_INTEGRATION_SCENEHOLDER_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/dali-adaptor-common.h>
23 #include <dali/public-api/object/base-handle.h>
24 #include <dali/public-api/math/vector4.h>
36 namespace Internal DALI_INTERNAL
52 * @brief SceneHolder is responsible for creating a Scene for rendering.
54 class DALI_ADAPTOR_API SceneHolder : public BaseHandle
59 * @brief Create an uninitialized SceneHolder handle.
66 * This is non-virtual since derived Handle types must not contain data or virtual methods.
71 * @brief This copy constructor is required for (smart) pointer semantics.
73 * @param [in] handle A reference to the copied handle
75 SceneHolder( const SceneHolder& handle );
78 * @brief This assignment operator is required for (smart) pointer semantics.
80 * @param [in] rhs A reference to the copied handle
81 * @return A reference to this
83 SceneHolder& operator=( const SceneHolder& rhs );
86 * @brief Adds a child Actor to the SceneHolder.
88 * The child will be referenced.
89 * @param[in] actor The child
90 * @pre The actor has been initialized.
91 * @pre The actor does not have a parent.
93 void Add( Actor actor );
96 * @brief Removes a child Actor from the SceneHolder.
98 * The child will be unreferenced.
99 * @param[in] actor The child
100 * @pre The actor has been added to the SceneHolder.
102 void Remove( Actor actor );
105 * @brief Returns the Scene's Root Layer.
107 * @return The root layer
109 Layer GetRootLayer() const;
112 * @brief Sets the background color.
114 * @param[in] color The new background color
116 void SetBackgroundColor( Vector4 color );
119 * @brief Gets the background color.
121 * @return The background color
123 Vector4 GetBackgroundColor() const;
126 * @brief Gets the native handle.
128 * When users call this function, it wraps the actual type used by the underlying system.
130 * @return The native handle or an empty handle
132 Any GetNativeHandle() const;
135 * @brief Feed (Send) touch event to core
136 * @param[in] point The touch point
137 * @param[in] timeStamp The time stamp
139 void FeedTouchPoint( Dali::TouchPoint& point, int timeStamp );
142 * @brief Feed (Send) wheel event to core
143 * @param[in] wheelEvent The wheel event
145 void FeedWheelEvent( Dali::WheelEvent& wheelEvent );
148 * @brief Feed (Send) key event to core
149 * @param[in] keyEvent The key event holding the key information.
151 void FeedKeyEvent( Dali::KeyEvent& keyEvent );
153 public: // Not intended for application developers
156 * @brief This constructor is used internally to create additional SceneHolder handles.
158 * @param[in] sceneHolder A pointer to a newly allocated Dali resource
160 explicit DALI_INTERNAL SceneHolder( Internal::Adaptor::SceneHolder* sceneHolder );
164 } // namespace Integration
168 #endif // DALI_INTEGRATION_SCENEHOLDER_H