2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
19 * @file FUiAnimVisualElementPropertyAnimation.cpp
20 * @brief This file contains implementation of VisualElementPropertyAnimation class
22 * This file contains implementation VisualElementPropertyAnimation class.
25 #include <FBaseSysLog.h>
27 #include <FUiAnimVisualElementPropertyAnimation.h>
29 #include "FUiAnim_VisualElementPropertyAnimationImpl.h"
31 namespace Tizen { namespace Ui { namespace Animations
34 VisualElementPropertyAnimation::VisualElementPropertyAnimation(void)
35 : VisualElementValueAnimation(new (std::nothrow) _VisualElementPropertyAnimationImpl())
37 if (_pAnimationImpl == null)
39 SetLastResult(E_OUT_OF_MEMORY);
43 VisualElementPropertyAnimation::~VisualElementPropertyAnimation(void)
48 VisualElementPropertyAnimation::VisualElementPropertyAnimation(const VisualElementPropertyAnimation& animation)
49 : VisualElementValueAnimation(null)
53 const _VisualElementPropertyAnimationImpl* pAnimationImpl = _VisualElementPropertyAnimationImpl::GetInstance(animation);
55 _pAnimationImpl = new (std::nothrow) _VisualElementPropertyAnimationImpl(*pAnimationImpl);
56 SysTryReturnVoidResult(NID_UI_ANIM, (_pAnimationImpl), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
59 VisualElementPropertyAnimation&
60 VisualElementPropertyAnimation::operator =(const VisualElementPropertyAnimation& rhs)
66 _VisualElementPropertyAnimationImpl* pAnimationImpl = _VisualElementPropertyAnimationImpl::GetInstance(*this);
67 const _VisualElementPropertyAnimationImpl* pRhsAnimationImpl = _VisualElementPropertyAnimationImpl::GetInstance(rhs);
69 result r = pAnimationImpl->CopyAnimationValue(*pRhsAnimationImpl);
70 SysTryReturn(NID_UI_ANIM, (r == E_SUCCESS), *this, r, "[%s] Failed to copy the animation value.", GetErrorMessage(r));
77 VisualElementPropertyAnimation::operator ==(const VisualElementPropertyAnimation& rhs) const
79 return VisualElementValueAnimation::operator ==(rhs);
83 VisualElementPropertyAnimation::operator !=(const VisualElementPropertyAnimation& rhs) const
85 return (!operator ==(rhs));
89 VisualElementPropertyAnimation::Equals(const Tizen::Base::Object& obj) const
91 const VisualElementPropertyAnimation* pAnimation = dynamic_cast< const VisualElementPropertyAnimation* >(&obj);
93 if (pAnimation == null)
98 return (*this == *pAnimation);
102 VisualElementPropertyAnimation::GetHashCode(void) const
104 return VisualElementValueAnimation::GetHashCode();
107 VisualElementAnimation*
108 VisualElementPropertyAnimation::CloneN(void) const
110 VisualElementPropertyAnimation* pCloned = new (std::nothrow) VisualElementPropertyAnimation(*this);
111 SysTryReturn(NID_UI_ANIM, (pCloned != null), null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
117 VisualElementPropertyAnimation::SetPropertyName(const Tizen::Base::String& property)
119 _VisualElementPropertyAnimationImpl* pAnimationImpl = _VisualElementPropertyAnimationImpl::GetInstance(*this);
121 SysTryReturnResult(NID_UI_ANIM, (property.IsEmpty() == false), E_INVALID_ARG, "Invalid argument(s) is used. property is empty.");
123 pAnimationImpl->SetPropertyName(property);
129 VisualElementPropertyAnimation::GetPropertyName(void) const
131 const _VisualElementPropertyAnimationImpl* pAnimationImpl = _VisualElementPropertyAnimationImpl::GetInstance(*this);
133 return pAnimationImpl->GetPropertyName();
136 }}} // Tizen::Ui::Animations