Fixed invalid text selection behaviour
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / transition-effects / cube-transition-cross-effect-impl.h
1 #ifndef DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H
2 #define DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H
3
4 /*
5  * Copyright (c) 2021 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 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
25 #include <dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h>
26
27 namespace Dali
28 {
29 namespace Toolkit
30 {
31 class CubeTransitionCrossEffect;
32
33 namespace Internal
34 {
35 class CubeTransitionEffect;
36
37 class CubeTransitionCrossEffect : public CubeTransitionEffect
38 {
39 public:
40   /**
41    * @copydoc Toolkit::CubeTransitionCrossEffect::New
42    */
43   static Toolkit::CubeTransitionCrossEffect New(unsigned int numRows, unsigned int numColumns);
44
45 protected:
46   /**
47     * @copydoc Toolkit::Internal::CubeTransitionEffect::OnInitialize
48     */
49   void OnInitialize() override;
50
51   /**
52     * @copydoc Toolkit::Internal::CubeTransitionEffect::OnStartTransition
53     */
54   void OnStartTransition(Vector2 panPosition, Vector2 panDisplacement) override;
55
56 private:
57   /**
58     * @brief Construct a new CubeTransitionCrossEffect object
59     *
60     * @param[in] numRows How many rows of cubes
61     * @param[in] numColumns How many columns of cubes
62     */
63   CubeTransitionCrossEffect(unsigned int numRows, unsigned int numColumns);
64
65   /**
66     * @brief Set up animation to an Actor
67     * This will also displace the cubes in the z direction by mCubeDisplacement and spread them apart on the xy plane
68     * given by the closeness of displacementCentre to the XY plane at 0.
69     *
70     * @param[in] actorIndex The index of the cube in the cube array
71     * @param[in] angle The angle of the rotation animation
72     * @param[in] the centre to "explode" the tiles outwards from
73     */
74   void SetupAnimation(unsigned int actorIndex, unsigned int x, unsigned int y, float angle, const Vector3 axis, const Vector3& displacementCentre);
75
76 private:
77   /**
78     * The factor that determines how spread apart from each other the cubes will go
79     * when they are displaced during the transition animation.
80     * The larger the value the more the spread apart the cubes will be.
81     * it should be in the range (0.0, +infinity)
82     */
83   float mDisplacementSpreadFactor;
84
85 }; //class CubeTransitionCrossEffect
86
87 } // namespace Internal
88
89 // Helpers for public-api forwarding methods
90
91 inline Internal::CubeTransitionCrossEffect& GetImpl(Dali::Toolkit::CubeTransitionCrossEffect& obj)
92 {
93   DALI_ASSERT_ALWAYS(obj);
94
95   Dali::RefObject& handle = obj.GetImplementation();
96
97   return static_cast<Internal::CubeTransitionCrossEffect&>(handle);
98 }
99
100 inline const Internal::CubeTransitionCrossEffect& GetImpl(const Dali::Toolkit::CubeTransitionCrossEffect& obj)
101 {
102   DALI_ASSERT_ALWAYS(obj);
103
104   const Dali::RefObject& handle = obj.GetImplementation();
105
106   return static_cast<const Internal::CubeTransitionCrossEffect&>(handle);
107 }
108
109 } // namespace Toolkit
110
111 } // namespace Dali
112
113 #endif // DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H