2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0/
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 FUiCtrl_PublicAnimationEvent.cpp
20 * @brief This is the implementation for the AnimationEvent class.
24 #include <FBaseErrors.h>
25 #include <FUiIAnimationEventListener.h>
26 #include <FBaseSysLog.h>
27 #include "FUiCtrl_PublicAnimationEvent.h"
29 using namespace Tizen::Ui;
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Runtime;
33 namespace Tizen { namespace Ui { namespace Controls
36 class _PublicAnimationEventArg
41 _PublicAnimationEventArg(void);
42 virtual ~_PublicAnimationEventArg(void);
43 }; // _PublicAnimationEventArg
45 _PublicAnimationEventArg::_PublicAnimationEventArg(void)
49 _PublicAnimationEventArg::~_PublicAnimationEventArg(void)
54 _PublicAnimationEvent::_PublicAnimationEvent(const Control& source)
57 result r = _Event::Initialize();
65 _PublicAnimationEvent::~_PublicAnimationEvent(void)
69 _PublicAnimationEvent*
70 _PublicAnimationEvent::CreateInstanceN(const Control& source)
72 _PublicAnimationEvent* pPublicAnimationEvent = new (std::nothrow) _PublicAnimationEvent(source);
73 SysTryReturn(NID_UI_CTRL, pPublicAnimationEvent, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
75 if (IsFailed(GetLastResult()))
80 return pPublicAnimationEvent;
83 delete pPublicAnimationEvent;
84 pPublicAnimationEvent = null;
90 _PublicAnimationEvent::GetSource(void) const
96 _PublicAnimationEvent::FireImpl(IEventListener& listener, const IEventArg& arg)
98 IAnimationEventListener* pAnimationListener = dynamic_cast <IAnimationEventListener*>(&listener);
99 SysTryReturnVoidResult(NID_UI_CTRL, pAnimationListener != null, E_INVALID_ARG,
100 "[E_INVALID_ARG] Invalid listener was given.");
102 pAnimationListener->OnAnimationStopped(*__pSource);
104 SetLastResult(E_SUCCESS);
109 _PublicAnimationEvent::CreateAnimationEventArgN(void)
111 _PublicAnimationEventArg* pEventArg = new (std::nothrow) _PublicAnimationEventArg();
112 SysTryReturn(NID_UI_CTRL, pEventArg, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
117 }}} // Tizen::Ui::Controls