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.
18 * @file FUiCtrl_PublicAnimationEvent.cpp
19 * @brief This is the implementation for the AnimationEvent class.
23 #include <FBaseErrors.h>
24 #include <FUiIAnimationEventListener.h>
25 #include <FBaseSysLog.h>
26 #include "FUiCtrl_PublicAnimationEvent.h"
28 using namespace Tizen::Ui;
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Runtime;
32 namespace Tizen { namespace Ui { namespace Controls
35 class _PublicAnimationEventArg
40 _PublicAnimationEventArg(void);
41 virtual ~_PublicAnimationEventArg(void);
42 }; // _PublicAnimationEventArg
44 _PublicAnimationEventArg::_PublicAnimationEventArg(void)
48 _PublicAnimationEventArg::~_PublicAnimationEventArg(void)
53 _PublicAnimationEvent::_PublicAnimationEvent(const Control& source)
56 result r = _Event::Initialize();
64 _PublicAnimationEvent::~_PublicAnimationEvent(void)
68 _PublicAnimationEvent*
69 _PublicAnimationEvent::CreateInstanceN(const Control& source)
71 _PublicAnimationEvent* pPublicAnimationEvent = new (std::nothrow) _PublicAnimationEvent(source);
72 SysTryReturn(NID_UI_CTRL, pPublicAnimationEvent, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
74 if (IsFailed(GetLastResult()))
79 return pPublicAnimationEvent;
82 delete pPublicAnimationEvent;
83 pPublicAnimationEvent = null;
89 _PublicAnimationEvent::GetSource(void) const
95 _PublicAnimationEvent::FireImpl(IEventListener& listener, const IEventArg& arg)
97 IAnimationEventListener* pAnimationListener = dynamic_cast <IAnimationEventListener*>(&listener);
98 SysTryReturnVoidResult(NID_UI_CTRL, pAnimationListener != null, E_INVALID_ARG,
99 "[E_INVALID_ARG] Invalid listener was given.");
101 pAnimationListener->OnAnimationStopped(*__pSource);
103 SetLastResult(E_SUCCESS);
108 _PublicAnimationEvent::CreateAnimationEventArgN(void)
110 _PublicAnimationEventArg* pEventArg = new (std::nothrow) _PublicAnimationEventArg();
111 SysTryReturn(NID_UI_CTRL, pEventArg, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
116 }}} // Tizen::Ui::Controls