[dali_2.0.4] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / actor-siblings.h
1 #ifndef DALI_INTERNAL_ACTOR_SIBLINGS_H
2 #define DALI_INTERNAL_ACTOR_SIBLINGS_H
3 /*
4  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use actor file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 // INTERNAL INCLUDES
20 #include <dali/internal/event/actors/actor-impl.h>
21
22 namespace Dali
23 {
24 namespace Internal
25 {
26
27 struct Actor::SiblingHandler
28 {
29   /**
30    * @brief Change the sibling order of the given actor.
31    *
32    * @param[in,out] siblings The container of siblings
33    * @param[in] actor The actor to change
34    * @param[in] order The new order for the actor
35    * @return true if order has been modified
36    */
37   static bool SetSiblingOrder( ActorContainer& siblings, Actor& actor, uint32_t order );
38
39   /**
40    * @brief Get the sibling order of the given actor.
41    *
42    * @param[in] siblings The container of siblings
43    * @param[in] actor The actor to query
44    * @return the order in the sibling array of the actor
45    */
46   static uint32_t GetSiblingOrder(const ActorContainer& siblings, const Actor& actor);
47
48   /**
49    * @brief Raise the actor within the siblings list by one
50    * @param[in,out] siblings The container of siblings
51    * @param[in] actor The actor to move
52    * @return true if order has been modified
53    */
54   static bool Raise(ActorContainer& siblings, Actor& actor);
55
56   /**
57    * @brief Lower the actor within the siblings list by one
58    * @param[in,out] siblings The container of siblings
59    * @param[in] actor The actor to move
60    * @return true if order has been modified
61    */
62   static bool Lower(ActorContainer& siblings, Actor& actor);
63
64   /**
65    * @brief Raise the actor to the top of the siblings list.
66    *
67    * @param[in,out] siblings The container of siblings
68    * @param[in] actor The actor to move
69    * @return true if order has been modified
70    */
71   static bool RaiseToTop(ActorContainer& siblings, Actor& actor);
72
73   /**
74    * @brief Lower the actor to the bottom of the siblings list.
75    *
76    * @param[in,out] siblings The container of siblings
77    * @param[in] actor The actor to move
78    * @return true if order has been modified
79    */
80   static bool LowerToBottom(ActorContainer& siblings, Actor& actor);
81
82   /**
83    * @brief Raise the actor above the target actor within the siblings list.
84    *
85    * @param[in,out] siblings The container of siblings
86    * @param[in] actor The actor to move
87    * @param[in] target The target actor
88    * @return true if order has been modified
89    */
90   static bool RaiseAbove(ActorContainer& siblings, Actor& actor, Actor& target);
91
92   /**
93    * @brief Lower the actor below the target actor within the siblings list.
94    *
95    * @param[in,out] siblings The container of siblings
96    * @param[in] actor The actor to move
97    * @param[in] target The target actor
98    * @return true if order has been modified
99    */
100   static bool LowerBelow(ActorContainer& siblings, Actor& actor, Actor& target);
101 };
102
103 } // namespace Internal
104
105 } // namespace Dali
106
107
108 #endif