[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / bubble-effect / bubble-emitter.cpp
1 /*
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28 BubbleEmitter::BubbleEmitter()
29 {
30 }
31
32 BubbleEmitter::~BubbleEmitter()
33 {
34 }
35
36 BubbleEmitter::BubbleEmitter(Internal::BubbleEmitter& implementation)
37 : Control(implementation)
38 {
39 }
40
41 BubbleEmitter::BubbleEmitter(Dali::Internal::CustomActor* internal)
42 : Control(internal)
43 {
44   VerifyCustomActorPointer<Internal::BubbleEmitter>(internal);
45 }
46
47 BubbleEmitter BubbleEmitter::New(const Vector2& winSize,
48                                  Dali::Texture  shapeTexture,
49                                  unsigned int   maximumNumberOfBubble,
50                                  const Vector2& bubbleSizeRange)
51 {
52   return Internal::BubbleEmitter::New(winSize, shapeTexture, maximumNumberOfBubble, bubbleSizeRange);
53 }
54
55 BubbleEmitter::BubbleEmitter(const BubbleEmitter& handle) = default;
56
57 BubbleEmitter& BubbleEmitter::operator=(const BubbleEmitter& rhs) = default;
58
59 BubbleEmitter::BubbleEmitter(BubbleEmitter&& handle) = default;
60
61 BubbleEmitter& BubbleEmitter::operator=(BubbleEmitter&& rhs) = default;
62
63 BubbleEmitter BubbleEmitter::DownCast(BaseHandle handle)
64 {
65   return Control::DownCast<BubbleEmitter, Internal::BubbleEmitter>(handle);
66 }
67
68 Actor BubbleEmitter::GetRootActor()
69 {
70   return GetImpl(*this).GetRootActor();
71 }
72
73 void BubbleEmitter::SetBackground(Dali::Texture bgTexture, const Vector3& hsvDelta)
74 {
75   GetImpl(*this).SetBackground(bgTexture, hsvDelta);
76 }
77
78 void BubbleEmitter::SetBubbleShape(Dali::Texture shapeTexture)
79 {
80   GetImpl(*this).SetBubbleShape(shapeTexture);
81 }
82
83 void BubbleEmitter::SetBubbleScale(float scale)
84 {
85   GetImpl(*this).SetBubbleScale(scale);
86 }
87
88 void BubbleEmitter::SetBubbleDensity(unsigned int density)
89 {
90   GetImpl(*this).SetBubbleDensity(density);
91 }
92
93 void BubbleEmitter::EmitBubble(Animation& animation, const Vector2& emitPosition, const Vector2& direction, const Vector2& displacement)
94 {
95   GetImpl(*this).EmitBubble(animation, emitPosition, direction, displacement);
96 }
97
98 void BubbleEmitter::Restore()
99 {
100   GetImpl(*this).Restore();
101 }
102
103 } // namespace Toolkit
104
105 } // namespace Dali