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_UiFastScrollEvent.cpp
20 * @brief This is the implementation for the _UiFastScrollEvent class.
24 #include <FBaseSysLog.h>
25 #include "FUiCtrl_UiFastScrollEvent.h"
26 #include "FUiCtrl_UiFastScrollEventArg.h"
27 #include "FUiCtrl_IFastScrollListener.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Runtime;
33 namespace Tizen { namespace Ui { namespace Controls
36 ////////////////////////////////////////////////////////////////////////////////
37 /// __ExpandableItemEvent class Lifecycle
39 _UiFastScrollEvent::_UiFastScrollEvent(void)
45 _UiFastScrollEvent::~_UiFastScrollEvent(void)
51 _UiFastScrollEvent::Construct(const Tizen::Ui::_Control& source)
53 result r = _Event::Initialize();
58 __pSource = const_cast <_Control*>(&source);
65 ////////////////////////////////////////////////////////////////////////////////
66 /// __WindowEvent class Accessor
68 const Tizen::Ui::_Control*
69 _UiFastScrollEvent::GetSource(void) const
74 ////////////////////////////////////////////////////////////////////////////////
75 /// __ExpandableItemEvent class Operation
78 _UiFastScrollEvent::FireImpl(IEventListener& listener, const IEventArg& arg)
80 // cast to IFastScrollListener
81 _IUiFastScrollListener* pFastScrollListener = dynamic_cast <_IUiFastScrollListener*>(&listener);
82 SysTryReturnVoidResult(NID_UI, pFastScrollListener, E_INVALID_ARG, "[E_INVALID_ARG] listener type is invalid.");
84 // cast to __UiFastScrollEventArg
85 _UiFastScrollEventArg* pArg = (_UiFastScrollEventArg*) const_cast <IEventArg*>(&arg);
86 SysTryReturnVoidResult(NID_UI, pArg, E_INVALID_ARG, "[E_INVALID_ARG] Event argument type is invalid.");
88 pFastScrollListener->OnUiFastScrollIndexSelected(*pArg->GetSource(), const_cast <Tizen::Ui::Controls::_FastScrollIndex&>(pArg->GetIndex()));