Formatting API
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / bubble-effect / bubble-emitter.cpp
1 /*
2  * Copyright (c) 2020 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)
56 : Control(handle)
57 {
58 }
59
60 BubbleEmitter& BubbleEmitter::operator=(const BubbleEmitter& rhs)
61 {
62   if(&rhs != this)
63   {
64     Control::operator=(rhs);
65   }
66   return *this;
67 }
68
69 BubbleEmitter BubbleEmitter::DownCast(BaseHandle handle)
70 {
71   return Control::DownCast<BubbleEmitter, Internal::BubbleEmitter>(handle);
72 }
73
74 Actor BubbleEmitter::GetRootActor()
75 {
76   return GetImpl(*this).GetRootActor();
77 }
78
79 void BubbleEmitter::SetBackground(Dali::Texture bgTexture, const Vector3& hsvDelta)
80 {
81   GetImpl(*this).SetBackground(bgTexture, hsvDelta);
82 }
83
84 void BubbleEmitter::SetBubbleShape(Dali::Texture shapeTexture)
85 {
86   GetImpl(*this).SetBubbleShape(shapeTexture);
87 }
88
89 void BubbleEmitter::SetBubbleScale(float scale)
90 {
91   GetImpl(*this).SetBubbleScale(scale);
92 }
93
94 void BubbleEmitter::SetBubbleDensity(unsigned int density)
95 {
96   GetImpl(*this).SetBubbleDensity(density);
97 }
98
99 void BubbleEmitter::EmitBubble(Animation& animation, const Vector2& emitPosition, const Vector2& direction, const Vector2& displacement)
100 {
101   GetImpl(*this).EmitBubble(animation, emitPosition, direction, displacement);
102 }
103
104 void BubbleEmitter::Restore()
105 {
106   GetImpl(*this).Restore();
107 }
108
109 } // namespace Toolkit
110
111 } // namespace Dali