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 FUiAnim_VisualElementPropertyAnimationImpl.cpp
20 * @brief This file contains implementation of _VisualElementPropertyAnimationImpl class
22 * This file contains implementation _VisualElementValueAnimationImpl class.
25 #include <FBaseSysLog.h>
27 #include <FUiAnimVisualElementPropertyAnimation.h>
28 #include <FUiAnimVisualElement.h>
29 #include <FUiAnim_VisualElementImpl.h>
31 #include "FUiAnim_VisualElementPropertyAnimationImpl.h"
33 namespace Tizen { namespace Ui { namespace Animations
37 _VisualElementPropertyAnimationImpl::_VisualElementPropertyAnimationImpl(void)
42 _VisualElementPropertyAnimationImpl::_VisualElementPropertyAnimationImpl(const _VisualElementPropertyAnimationImpl& animationImpl)
44 result r = CopyAnimationValue(animationImpl);
46 SysTryReturnVoidResult(NID_UI_ANIM, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
49 _VisualElementPropertyAnimationImpl::~_VisualElementPropertyAnimationImpl(void)
55 _VisualElementPropertyAnimationImpl::Equals(const Tizen::Base::Object& obj) const
62 const _VisualElementPropertyAnimationImpl* pAnimationImpl = dynamic_cast< const _VisualElementPropertyAnimationImpl* >(&obj);
64 if (pAnimationImpl == null)
69 return (_VisualElementValueAnimationImpl::Equals(obj) && __property == pAnimationImpl->__property);
73 _VisualElementPropertyAnimationImpl::GetHashCode(void) const
75 return (_VisualElementValueAnimationImpl::GetHashCode() + __property.GetHashCode());
79 _VisualElementPropertyAnimationImpl::CopyAnimationValue(const _VisualElementPropertyAnimationImpl& animationImpl)
81 result r = _VisualElementValueAnimationImpl::CopyAnimationValue(animationImpl);
82 SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), r, "Propagating.");
84 __property = animationImpl.__property;
90 _VisualElementPropertyAnimationImpl::SetPropertyName(const Tizen::Base::String& property)
92 __property = property;
96 _VisualElementPropertyAnimationImpl::GetPropertyName(void) const
101 _VisualElementPropertyAnimationImpl*
102 _VisualElementPropertyAnimationImpl::GetInstance(VisualElementPropertyAnimation& animation)
104 return dynamic_cast<_VisualElementPropertyAnimationImpl*>(animation._pAnimationImpl);
107 const _VisualElementPropertyAnimationImpl*
108 _VisualElementPropertyAnimationImpl::GetInstance(const VisualElementPropertyAnimation& animation)
110 return dynamic_cast<const _VisualElementPropertyAnimationImpl*>(animation._pAnimationImpl);
114 _VisualElementPropertyAnimationImpl::IsValidValues(void) const
116 SysTryReturn(NID_UI_ANIM, (__property.IsEmpty() == false), false, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The property name is not set.");
117 SysTryReturn(NID_UI_ANIM, (__start.IsEmpty() == false || __end.IsEmpty() == false), false, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The start value and end value is invalid.");
119 if (__start.IsEmpty() == false && __end.IsEmpty() == false)
121 SysTryReturn(NID_UI_ANIM, (__start.GetType() == __end.GetType()), false, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The types of variant are different.");
128 _VisualElementPropertyAnimationImpl::OnTickOccurred(VisualElement& target, const Tizen::Ui::Variant& currentValue)
130 _VisualElementImpl::GetInstance(target)->SetPropertyI(__property, currentValue);
133 }}} // Tizen::Ui::Animations