cluster-style.h
4.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#ifndef __DALI_DEMO_CLUSTER_STYLE_H__
#define __DALI_DEMO_CLUSTER_STYLE_H__
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// EXTERNAL INCLUDES
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/animation/alpha-function.h>
#include <dali/public-api/animation/time-period.h>
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/object/base-handle.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/enums.h>
namespace Dali
{
class Actor;
namespace Demo
{
namespace Internal DALI_INTERNAL
{
class ClusterStyle;
class ClusterStyleRandom;
}
class ClusterStyle;
typedef IntrusivePtr<ClusterStyle> ClusterStylePtr; ///< Pointer to a Dali::Demo::ClusterStyle object
/**
* @brief A ClusterStyle describes the constraints which are imposed on the child actors in the cluster.
*/
class ClusterStyle : public Dali::BaseHandle
{
public:
static const unsigned int UNLIMITED_CHILDREN; ///< Constant that represents an unlimited number of children.
public:
/**
* @brief Destructor
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
*/
~ClusterStyle();
/**
* @brief Query the maximum number of children this Style can handle.
*
* If return value is UNLIMITED_CHILDREN, then this style has no
* limit.
* @return The maximum number of children.
*/
unsigned int GetMaximumNumberOfChildren() const;
/**
* @brief Applies style (position) to child actor over a specified time duration.
*
* @param[in] child The child actor to apply
* @param[in] index The style position index for the actor to transform to.
* @param[in] alpha The alpha function to use.
* @param[in] durationSeconds The time period to apply this style.
*/
void ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds);
/**
* @brief Applies style to background actor over a specified time duration.
*
* @param[in] background The background actor to apply
* @param[in] alpha The alpha function to use.
* @param[in] durationSeconds The time period to apply this style.
*/
void ApplyStyleToBackground(Actor background, AlphaFunction alpha, const TimePeriod& durationSeconds);
/**
* @brief Applies style to title actor over a specified time duration.
*
* @param[in] title The title actor to apply
* @param[in] alpha The alpha function to use.
* @param[in] durationSeconds The time period to apply this style.
*/
void ApplyStyleToTitle(Actor title, AlphaFunction alpha, const TimePeriod& durationSeconds);
protected:
/**
* @brief Create a new ClusterStyle; Only derived versions are instantiatable.
*/
ClusterStyle();
public: // Not intended for application developers
/**
* @brief This constructor is used by Dali New() methods.
*
* @param [in] internal A pointer to a newly allocated Dali resource
*/
explicit DALI_INTERNAL ClusterStyle(Internal::ClusterStyle* internal);
};
/**
* @brief A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
*/
class ClusterStyleStandard : public ClusterStyle
{
public:
/**
* @brief Cluster Style type.
*/
enum StyleType
{
ClusterStyle1, ///< Style number 1
ClusterStyle2, ///< Style number 2
ClusterStyle3, ///< Style number 3
ClusterStyle4, ///< Style number 4
TotalClusterStyles ///< The number of styles
};
public:
/**
* @brief Create an initialized style.
*/
static ClusterStyleStandard New(StyleType style);
public: // Not intended for application developers
/**
* @brief This constructor is used by Dali New() methods.
*
* @param [in] internal A pointer to a newly allocated Dali resource
*/
explicit DALI_INTERNAL ClusterStyleStandard(Internal::ClusterStyle* internal);
};
/**
* @brief A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
*/
class ClusterStyleRandom : public ClusterStyle
{
public:
/**
* @brief Create an initialized style.
*/
static ClusterStyleRandom New();
public: // Not intended for application developers
/**
* @brief This constructor is used by Dali New() methods.
*
* @param [in] internal A pointer to a newly allocated Dali resource
*/
explicit DALI_INTERNAL ClusterStyleRandom(Internal::ClusterStyle* internal);
};
} // namespace Demo
} // namespace Dali
#endif // __DALI_TOOLKIT_CLUSTER_STYLE_H__