Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiAnimSequentialAnimationGroup.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FUiAnimSequentialAnimationGroup.h
20  * @brief       This is the header file for the %SequentialAnimationGroup class.
21  *
22  * This header file contains the declarations of the %SequentialAnimationGroup class.
23  */
24
25 #ifndef _FUI_ANIM_SEQUENTIAL_ANIMATION_GROUP_H_
26 #define _FUI_ANIM_SEQUENTIAL_ANIMATION_GROUP_H_
27
28 #include <FBaseTypes.h>
29 #include <FBaseObject.h>
30
31 #include <FUiAnimAnimationBase.h>
32 #include <FUiAnimAnimationGroup.h>
33
34
35 namespace Tizen { namespace Ui { namespace Animations
36 {
37
38
39 /**
40  * @class       SequentialAnimationGroup
41  * @brief       This class is used to group a set of animations together.
42  *
43  * @since       2.0
44  *
45  * @final   This class is not intended for extension.
46  *
47  * The %SequentialAnimationGroup class is used to group a set of animations together in sequence.
48  */
49 class _OSP_EXPORT_ SequentialAnimationGroup
50         : public AnimationGroup
51 {
52 public:
53
54         /**
55          * This is the default constructor for this class.
56          *
57          * @since       2.0
58          *
59          * @exception   E_SUCCESS               The method is successful.
60          * @exception   E_OUT_OF_MEMORY The memory is insufficient.
61          * @remarks             The specific error code can be accessed using the GetLastResult() method.
62          */
63         SequentialAnimationGroup(void);
64
65
66         /**
67          * This is the destructor for this class.
68          *
69          * @since       2.0
70          */
71         virtual ~SequentialAnimationGroup(void);
72
73
74         /**
75          * This is the copy constructor for the %SequentialAnimationGroup class.
76          *
77          * @since       2.0
78          *
79          * @param[in]   animationGroup          An instance of %SequentialAnimationGroup
80          * @exception   E_SUCCESS               The method is successful.
81          * @exception   E_OUT_OF_MEMORY The memory is insufficient.
82          * @remarks             The specific error code can be accessed using the GetLastResult() method.
83          */
84         SequentialAnimationGroup(const SequentialAnimationGroup& animationGroup);
85
86
87         /**
88          * Assigns the value of the specified instance to the current instance of %SequentialAnimationGroup.
89          *
90          * @since               2.0
91          *
92          * @param[in]   rhs             An instance of %SequentialAnimationGroup
93          * @exception   E_SUCCESS               The method is successful.
94          * @exception   E_OUT_OF_MEMORY The memory is insufficient.
95          * @remarks             The specific error code can be accessed using the GetLastResult() method.
96          */
97         SequentialAnimationGroup& operator =(const SequentialAnimationGroup& rhs);
98
99
100         /**
101          * Checks whether the specified instance and the current instance of %SequentialAnimationGroup have equal animation values.
102          *
103          * @since       2.0
104          *
105          * @return              @c true if the animation of the two instances of %SequentialAnimationGroup have equal values, @n
106          *                              else @c false
107          * @param[in]   rhs             An instance of %SequentialAnimationGroup
108          */
109         bool operator ==(const SequentialAnimationGroup& rhs) const;
110
111
112         /**
113          * Checks whether the specified instance and the current instance of %SequentialAnimationGroup have different animation values.
114          *
115          * @since       2.0
116          *
117          * @return              @c true if the values of the animations of the two instances of %SequentialAnimationGroup are not equal, @n
118          *                              else @c false
119          * @param[in]   rhs             An instance of %SequentialAnimationGroup
120          */
121         bool operator !=(const SequentialAnimationGroup& rhs) const;
122
123
124         /**
125          * Checks whether the value of the current instance of %SequentialAnimationGroup is equal to the value of the specified instance.
126          *
127          * @since       2.0
128          *
129          * @return              @c true if the value of the current instance is equal to the value of the specified instance, @n
130          *                              else @c false
131          * @param[in]   obj             An instance of %SequentialAnimationGroup
132          * @remarks     The %SequentialAnimationGroup class has a semantic value. @n
133          *                              This means that this method checks whether the two instances have the same animation.
134          */
135         virtual bool Equals(const Tizen::Base::Object& obj) const;
136
137
138         /**
139          * Gets the hash value of the current instance.
140          *
141          * @since       2.0
142          *
143          * @return              The hash value of the current instance
144          * @remarks     The two equal instances must return the same hash value. For better performance, the used hash function must generate a random
145          *                              distribution for all inputs.
146          */
147         virtual int GetHashCode(void) const;
148
149
150         /**
151          * Removes all the animations from the animation group.
152          *
153          * @since       2.0
154          */
155         virtual void RemoveAllAnimations(void);
156
157
158         /**
159          * Gets the number of animations currently stored in a group.
160          *
161          * @since       2.0
162          *
163          * @return      The total number of animations stored in a group
164          */
165         virtual int GetAnimationCount(void) const;
166
167
168         /**
169          * Adds the specified animation to the animation group.
170          *
171          * @since       2.0
172          *
173          * @return              An error code
174          * @param[in]   animTarget                      The animation target type @n
175          *                                  The animation is applied to the specified animation target type.
176          * @param[in]   animation                       An instance of AnimationBase
177          * @exception   E_SUCCESS                       The method is successful.
178          * @exception   E_INVALID_ARG       A specified input parameter is invalid.
179          * @exception   E_SYSTEM                        A system error has occurred.
180          */
181         result AddAnimation(AnimationTargetType animTarget, const AnimationBase& animation);
182
183
184         /**
185          * Sets the specified @c animation to the animation group.
186          *
187          * @since   2.0
188          *
189          * @return              An error code
190          * @param[in]   index                           The index at which the animation is set
191          * @param[in]   animTarget                      The AnimationTargetType to which the animation is applied
192          * @param[in]   animation                       An instance of AnimationBase
193          * @exception   E_SUCCESS                       The method is successful.
194          * @exception   E_INVALID_ARG       A specified input parameter is invalid.
195          * @exception   E_OUT_OF_RANGE          The specified @c index is out of range.
196          * @exception   E_SYSTEM                        A system error has occurred.
197          * @remarks If an animation is added to the same index which already has an animation associated with it, the old animation will be overwritten with the new one.
198          */
199         result SetAnimationAt(int index, AnimationTargetType animTarget, const AnimationBase& animation);
200
201
202         /**
203          * Inserts the specified @c animation to the animation group.
204          *
205          * @since   2.0
206          *
207          * @return              An error code
208          * @param[in]   index                           The index at which the animation is inserted
209          * @param[in]   animTarget                      The AnimationTargetType to which the animation is applied
210          * @param[in]   animation                       An instance of AnimationBase
211          * @exception   E_SUCCESS                       The method is successful.
212          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
213          * @exception   E_OUT_OF_RANGE      The specified @c index is out of range.
214          * @exception   E_SYSTEM                        A system error has occurred.
215          */
216         result InsertAnimationAt(int index, AnimationTargetType animTarget, const AnimationBase& animation);
217
218
219         /**
220          * Removes the animation from the animation group at the specified @c index.
221          *
222          * @since       2.0
223          *
224          * @return              An error code
225          * @param[in]   index                           An index value in the animation group list
226          * @exception   E_SUCCESS                       The method is successful.
227          * @exception   E_OUT_OF_RANGE          The specified @c index is out of range.
228          * @exception   E_SYSTEM                        A system error has occurred.
229          */
230         result RemoveAnimationAt(int index);
231
232
233         /**
234          * Gets the animation object at the specified @c index.
235          *
236          * @since       2.0
237          *
238          * @return      The animation object at the specified @c index value in the animation group, @n
239          *                              else @c null if the @c index is invalid
240          * @param[in]   index                   The index value in the animation group list
241          */
242         AnimationBase* GetAnimationAtN(int index) const;
243
244
245         /**
246          * Gets the target type of the animation at the specified @c index.
247          *
248          * @since       2.0
249          *
250          * @return      The target type of the animation at the specified @c index value in the animation group, @n
251          *                              else @c ANIMATION_TARGET_NONE if the specified @c index is invalid
252          * @param[in]   index                   The index value in the animation group list
253          */
254         AnimationTargetType GetAnimationTargetTypeAt(int index) const;
255
256
257         /**
258          * Gets the type information of this instance.
259          *
260          * @since      2.0
261          *
262          * @return     The type information of this instance
263          */
264         virtual AnimationGroupType GetType(void) const;
265
266
267 protected:
268
269         friend class _SequentialAnimationGroupImpl;
270
271
272         //
273         // This variable is for internal use only. Using this variable can cause behavioral, security-related,
274         // and consistency-related issues in the application.
275         //
276         // This variable is for internal usage.
277         //
278         // @since        2.0
279         //
280         class _SequentialAnimationGroupImpl* _pSequentialAnimationGroupImpl;
281 };              // SequentialAnimationGroup
282
283
284 }}}             // Tizen::Ui::Animations
285
286 #endif  // _FUI_ANIM_SEQUENTIAL_ANIMATION_GROUP_H_