3081dbe5687dad238321e93912cdd2eff0c1bcc4
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / controls / cluster / cluster-style.cpp
1 /*
2  * Copyright (c) 2014 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 #include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
19 #include <dali-toolkit/internal/controls/cluster/cluster-style-impl.h>
20
21 using namespace Dali;
22 using namespace Dali::Toolkit;
23 using namespace std;
24
25 namespace Dali
26 {
27
28 namespace Toolkit
29 {
30
31 // ClusterStyle ///////////////////////////////////////////////////////////////
32
33 const unsigned int ClusterStyle::UNLIMITED_CHILDREN = std::numeric_limits<unsigned int>::max();
34
35 ClusterStyle::ClusterStyle()
36 {
37 }
38
39 ClusterStyle::~ClusterStyle()
40 {
41 }
42
43 ClusterStyle::ClusterStyle(Internal::ClusterStyle* internal)
44 : BaseHandle(internal)
45 {
46 }
47
48 unsigned int ClusterStyle::GetMaximumNumberOfChildren() const
49 {
50   return GetImpl(*this).GetMaximumNumberOfChildren();
51 }
52
53 void ClusterStyle::ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds)
54 {
55   GetImpl(*this).ApplyStyle(child, index, alpha, durationSeconds);
56 }
57
58 void ClusterStyle::ApplyStyleToBackground(Actor background, AlphaFunction alpha, const TimePeriod& durationSeconds)
59 {
60   GetImpl(*this).ApplyStyleToBackground(background, alpha, durationSeconds);
61 }
62
63 void ClusterStyle::ApplyStyleToTitle(Actor title, AlphaFunction alpha, const TimePeriod& durationSeconds)
64 {
65   GetImpl(*this).ApplyStyleToTitle(title, alpha, durationSeconds);
66 }
67
68 // ClusterStyleStandard ///////////////////////////////////////////////////////
69
70 ClusterStyleStandard ClusterStyleStandard::New(StyleType style)
71 {
72   Internal::ClusterStylePtr internal = Internal::ClusterStyleStandard::New(style);
73
74   return ClusterStyleStandard(internal.Get());
75 }
76
77 ClusterStyleStandard::ClusterStyleStandard(Internal::ClusterStyle* internal)
78 : ClusterStyle(internal)
79 {
80 }
81
82 // ClusterStyleRandom /////////////////////////////////////////////////////////
83
84 ClusterStyleRandom ClusterStyleRandom::New()
85 {
86   Internal::ClusterStylePtr internal = Internal::ClusterStyleRandom::New();
87
88   return ClusterStyleRandom(internal.Get());
89 }
90
91 ClusterStyleRandom::ClusterStyleRandom(Internal::ClusterStyle* internal)
92 : ClusterStyle(internal)
93 {
94 }
95
96 } // namespace Toolkit
97
98 } // namespace Dali