[Tizen] Implement partial update
[platform/core/uifw/dali-core.git] / dali / devel-api / actors / actor-devel.h
1 #ifndef DALI_ACTOR_DEVEL_H
2 #define DALI_ACTOR_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/actors/actor.h>
23
24 namespace Dali
25 {
26
27 namespace DevelActor
28 {
29
30 namespace Property
31 {
32
33 enum Type
34 {
35   PARENT_ORIGIN               = Dali::Actor::Property::PARENT_ORIGIN,
36   PARENT_ORIGIN_X             = Dali::Actor::Property::PARENT_ORIGIN_X,
37   PARENT_ORIGIN_Y             = Dali::Actor::Property::PARENT_ORIGIN_Y,
38   PARENT_ORIGIN_Z             = Dali::Actor::Property::PARENT_ORIGIN_Z,
39   ANCHOR_POINT                = Dali::Actor::Property::ANCHOR_POINT,
40   ANCHOR_POINT_X              = Dali::Actor::Property::ANCHOR_POINT_X,
41   ANCHOR_POINT_Y              = Dali::Actor::Property::ANCHOR_POINT_Y,
42   ANCHOR_POINT_Z              = Dali::Actor::Property::ANCHOR_POINT_Z,
43   SIZE                        = Dali::Actor::Property::SIZE,
44   SIZE_WIDTH                  = Dali::Actor::Property::SIZE_WIDTH,
45   SIZE_HEIGHT                 = Dali::Actor::Property::SIZE_HEIGHT,
46   SIZE_DEPTH                  = Dali::Actor::Property::SIZE_DEPTH,
47   POSITION                    = Dali::Actor::Property::POSITION,
48   POSITION_X                  = Dali::Actor::Property::POSITION_X,
49   POSITION_Y                  = Dali::Actor::Property::POSITION_Y,
50   POSITION_Z                  = Dali::Actor::Property::POSITION_Z,
51   WORLD_POSITION              = Dali::Actor::Property::WORLD_POSITION,
52   WORLD_POSITION_X            = Dali::Actor::Property::WORLD_POSITION_X,
53   WORLD_POSITION_Y            = Dali::Actor::Property::WORLD_POSITION_Y,
54   WORLD_POSITION_Z            = Dali::Actor::Property::WORLD_POSITION_Z,
55   ORIENTATION                 = Dali::Actor::Property::ORIENTATION,
56   WORLD_ORIENTATION           = Dali::Actor::Property::WORLD_ORIENTATION,
57   SCALE                       = Dali::Actor::Property::SCALE,
58   SCALE_X                     = Dali::Actor::Property::SCALE_X,
59   SCALE_Y                     = Dali::Actor::Property::SCALE_Y,
60   SCALE_Z                     = Dali::Actor::Property::SCALE_Z,
61   WORLD_SCALE                 = Dali::Actor::Property::WORLD_SCALE,
62   VISIBLE                     = Dali::Actor::Property::VISIBLE,
63   COLOR                       = Dali::Actor::Property::COLOR,
64   COLOR_RED                   = Dali::Actor::Property::COLOR_RED,
65   COLOR_GREEN                 = Dali::Actor::Property::COLOR_GREEN,
66   COLOR_BLUE                  = Dali::Actor::Property::COLOR_BLUE,
67   COLOR_ALPHA                 = Dali::Actor::Property::COLOR_ALPHA,
68   WORLD_COLOR                 = Dali::Actor::Property::WORLD_COLOR,
69   WORLD_MATRIX                = Dali::Actor::Property::WORLD_MATRIX,
70   NAME                        = Dali::Actor::Property::NAME,
71   SENSITIVE                   = Dali::Actor::Property::SENSITIVE,
72   LEAVE_REQUIRED              = Dali::Actor::Property::LEAVE_REQUIRED,
73   INHERIT_ORIENTATION         = Dali::Actor::Property::INHERIT_ORIENTATION,
74   INHERIT_SCALE               = Dali::Actor::Property::INHERIT_SCALE,
75   COLOR_MODE                  = Dali::Actor::Property::COLOR_MODE,
76   RESERVED_PROPERTY_01        = Dali::Actor::Property::RESERVED_PROPERTY_01,
77   DRAW_MODE                   = Dali::Actor::Property::DRAW_MODE,
78   SIZE_MODE_FACTOR            = Dali::Actor::Property::SIZE_MODE_FACTOR,
79   WIDTH_RESIZE_POLICY         = Dali::Actor::Property::WIDTH_RESIZE_POLICY,
80   HEIGHT_RESIZE_POLICY        = Dali::Actor::Property::HEIGHT_RESIZE_POLICY,
81   SIZE_SCALE_POLICY           = Dali::Actor::Property::SIZE_SCALE_POLICY,
82   WIDTH_FOR_HEIGHT            = Dali::Actor::Property::WIDTH_FOR_HEIGHT,
83   HEIGHT_FOR_WIDTH            = Dali::Actor::Property::HEIGHT_FOR_WIDTH,
84   PADDING                     = Dali::Actor::Property::PADDING,
85   MINIMUM_SIZE                = Dali::Actor::Property::MINIMUM_SIZE,
86   MAXIMUM_SIZE                = Dali::Actor::Property::MAXIMUM_SIZE,
87   INHERIT_POSITION            = Dali::Actor::Property::INHERIT_POSITION,
88   CLIPPING_MODE               = Dali::Actor::Property::CLIPPING_MODE,
89   LAYOUT_DIRECTION            = Dali::Actor::Property::LAYOUT_DIRECTION,
90   INHERIT_LAYOUT_DIRECTION    = Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION,
91
92   /**
93    * @brief Sets the sibling order of the actor so depth position can be defined within the same parent.
94    * @details Name "siblingOrder", type Property::INTEGER.
95    * @note The initial value is 0.
96    * @note Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove and LowerBelow will override the
97    * sibling order. The values set by this Property will likely change.
98    */
99   SIBLING_ORDER = INHERIT_LAYOUT_DIRECTION + 1,
100
101   /**
102    * @brief The opacity of the actor.
103    * @details Name "opacity", type Property::FLOAT.
104    */
105   OPACITY = INHERIT_LAYOUT_DIRECTION + 2,
106
107   /**
108    * @brief Returns the screen position of the Actor
109    * @details Name "screenPosition", type Property::VECTOR2. Read-only
110    * @note This assumes default camera and default render-task and the Z position is ZERO.
111    * @note The last known frame is used for the calculation. May not match a position value just set.
112    */
113   SCREEN_POSITION = INHERIT_LAYOUT_DIRECTION + 3,
114
115   /**
116    * @brief Determines whether the anchor point should be used to determine the position of the actor.
117    * @details Name "positionUsesAnchorPoint", type Property::BOOLEAN.
118    * @note This is true by default.
119    * @note If false, then the top-left of the actor is used for the position.
120    * @note Setting this to false will allow scaling or rotation around the anchor-point without affecting the actor's position.
121    */
122   POSITION_USES_ANCHOR_POINT = INHERIT_LAYOUT_DIRECTION + 4,
123
124   /**
125    * @brief Returns whether the actor is culled or not.
126    * @details Name "culled", type Property::BOOLEAN. Read-only
127    * @note True means that the actor is out of the view frustum.
128    */
129   CULLED = INHERIT_LAYOUT_DIRECTION + 5,
130
131   /**
132    * @brief Sets the update size hint of the actor.
133    * @details Name "updateSizeHint", type Property::VECTOR2.
134    * @note When this value is set, the update area is determined by this value when a partial update.
135    */
136   UPDATE_SIZE_HINT = INHERIT_LAYOUT_DIRECTION + 6,
137 };
138
139 } // namespace Property
140
141 namespace VisibilityChange
142 {
143
144 enum Type
145 {
146   SELF,   ///< The visibility of the actor itself has changed.
147   PARENT  ///< The visibility of a parent has changed.
148 };
149
150 } // namespace VisibilityChange
151
152 typedef Signal< void ( Actor, bool, VisibilityChange::Type ) > VisibilityChangedSignalType; ///< Signal type of VisibilityChangedSignalType
153
154 /**
155  * @brief This signal is emitted when the visible property of this or a parent actor is changed.
156  *
157  * A callback of the following type may be connected:
158  * @code
159  *   void YourCallbackName( Actor actor, bool visible, VisibilityChange::Type& type );
160  * @endcode
161  * actor: The actor, or child of actor, whose visibility has changed
162  * visible: Whether the actor is now visible or not
163  * type: Whether the actor's visible property has changed or a parent's.
164  * @return The signal to connect to
165  * @pre The Actor has been initialized.
166  * @note This signal is NOT emitted if the actor becomes transparent (or the reverse), it's only linked with Actor::Property::VISIBLE.
167  */
168 DALI_CORE_API VisibilityChangedSignalType& VisibilityChangedSignal( Actor actor );
169
170
171 typedef Signal< void (Actor) > ChildChangedSignalType; ///< Called when the actor has a child added or removed
172
173 /**
174  * @brief This signal is emitted when a child is added to this actor.
175  *
176  * A callback of the following type may be connected:
177  * @code
178  *   void MyCallbackName( Actor child );
179  * @endcode
180  * child: The child that has been added.
181  *
182  * @note Use this signal with caution. Changing the parent of the actor
183  * within this callback is possible, but DALi will prevent further signals
184  * being sent.
185  *
186  * @return The signal to connect to
187  * @pre The Actor has been initialized
188  */
189 DALI_CORE_API ChildChangedSignalType& ChildAddedSignal( Actor actor );
190
191 /**
192  * @brief This signal is emitted when a child is removed from this actor.
193  *
194  * A callback of the following type may be connected:
195  * @code
196  *   void MyCallbackName( Actor child );
197  * @endcode
198  * child: The child that has been removed.
199  *
200  * @note Use this signal with caution. Changing the parent of the actor
201  * within this callback is possible, but DALi will prevent further signals
202  * being sent.
203  *
204  * @note If the child actor is moved from one actor to another, then
205  * this signal will be emitted followed immediately by an
206  * ChildAddedSignal() on the new parent.
207  *
208  * @return The signal to connect to
209  * @pre The Actor has been initialized
210  */
211 DALI_CORE_API ChildChangedSignalType& ChildRemovedSignal( Actor actor );
212
213
214 typedef Signal< void (Actor) > ChildOrderChangedSignalType; ///< Used when the actor's children have changed order
215
216 /**
217  * @brief This signal is emitted when an actor's children change their sibling order
218  *
219  * A callback of the following type may be connected:
220  * @code
221  *   void MyCallbackName( Actor parent );
222  * @endcode
223  * parent The parent actor of the moved children
224  *
225  * @return The signal to connect to
226  * @pre The Actor has been initialized
227  */
228 DALI_CORE_API ChildOrderChangedSignalType& ChildOrderChangedSignal( Actor actor );
229
230
231
232 } // namespace DevelActor
233
234 } // namespace Dali
235
236 #endif // DALI_ACTOR_DEVEL_H