Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / animations / FUiAnimAnimationGroup.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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        FUiAnimAnimationGroup.cpp
20  * @brief       This file contains implementation of Animation Group class
21  *
22  * This file contains implementation of Animation Group class.
23  */
24
25
26 #include <new>
27
28 #include <FBaseSysLog.h>
29 #include <FBaseColArrayList.h>
30 #include <FBaseColArrayListT.h>
31
32 #include <FUiAnimAnimationGroup.h>
33 #include <FUiAnimDimensionAnimation.h>
34 #include <FUiAnimFloatAnimation.h>
35 #include <FUiAnimRectangleAnimation.h>
36 #include <FUiAnimIntegerAnimation.h>
37 #include <FUiAnimPointAnimation.h>
38 #include <FUiAnimRotateAnimation.h>
39
40 #include "FUiAnim_AnimationGroupImpl.h"
41
42
43 using namespace Tizen::Base;
44 using namespace Tizen::Base::Collection;
45 using namespace Tizen::Ui;
46
47
48 namespace Tizen { namespace Ui { namespace Animations
49 {
50
51 AnimationGroup::AnimationGroup(void)
52         : _pAnimationGroupImpl(null)
53 {
54         ClearLastResult();
55
56         result r = E_SUCCESS;
57
58         _pAnimationGroupImpl = new (std::nothrow) _AnimationGroupImpl(this);
59         SysTryReturnVoidResult(NID_UI_ANIM, (_pAnimationGroupImpl != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
60
61         r = _pAnimationGroupImpl->Construct();
62         if (r != E_SUCCESS)
63         {
64                 SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] Failed to construct _AnimationGroupImpl instance.");
65                 delete _pAnimationGroupImpl;
66                 _pAnimationGroupImpl = null;
67         }
68 }
69
70 AnimationGroup::~AnimationGroup(void)
71 {
72         delete _pAnimationGroupImpl;
73         _pAnimationGroupImpl = null;
74 }
75
76 AnimationGroup::AnimationGroup(const AnimationGroup& animationGroup)
77 {
78         ClearLastResult();
79
80         result r = E_SUCCESS;
81
82         _pAnimationGroupImpl = new (std::nothrow) _AnimationGroupImpl(this);
83         SysTryReturnVoidResult(NID_UI_ANIM, (_pAnimationGroupImpl != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
84
85         r = _pAnimationGroupImpl->Construct();
86         if (r != E_SUCCESS)
87         {
88                 SysLogException(NID_UI_ANIM, r, "[%s] Failed to construct _AnimationGroupImpl instance.", GetErrorMessage(r));
89
90                 delete _pAnimationGroupImpl;
91                 _pAnimationGroupImpl = null;
92         }
93 }
94
95 }}}   // Tizen::Ui::Animations