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_FastScrollEvent.cpp
19 * @brief This is the implementation for the _FastScrollEvent class.
23 #include <FUiCtrlIFastScrollListener.h>
24 #include <FBaseErrors.h>
25 #include <FBaseSysLog.h>
26 #include "FUiCtrl_FastScrollEvent.h"
27 #include "FUiCtrl_FastScrollEventArg.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Runtime;
33 namespace Tizen { namespace Ui { namespace Controls
36 const wchar_t* const FAST_SCROLL_SEARCH_ICON_INDEX_STRING = L"[SEARCH_ICON_INDEX]";
38 ////////////////////////////////////////////////////////////////////////////////
39 /// __ExpandableItemEvent class Lifecycle
41 _FastScrollEvent::_FastScrollEvent(void)
47 _FastScrollEvent::~_FastScrollEvent(void)
53 _FastScrollEvent::Construct(const Tizen::Ui::Control& source)
55 result r = _Event::Initialize();
60 __pSource = const_cast <Control*>(&source);
67 ////////////////////////////////////////////////////////////////////////////////
68 /// __WindowEvent class Accessor
70 const Tizen::Ui::Control*
71 _FastScrollEvent::GetSource(void) const
76 ////////////////////////////////////////////////////////////////////////////////
77 /// __ExpandableItemEvent class Operation
80 _FastScrollEvent::FireImpl(IEventListener& listener, const IEventArg& arg)
82 // cast to IFastScrollListener
83 IFastScrollListener* pFastScrollListener = dynamic_cast <IFastScrollListener*>(&listener);
84 SysTryReturnVoidResult(NID_UI, pFastScrollListener, E_INVALID_ARG, "[E_INVALID_ARG] Listener type is invalid.");
86 // cast to __FastScrollEventArg
87 _FastScrollEventArg* pArg = (_FastScrollEventArg*) const_cast <IEventArg*>(&arg);
88 SysTryReturnVoidResult(NID_UI, pArg, E_INVALID_ARG, "[E_INVALID_ARG] Event argument type is invalid.");
90 Tizen::Base::String index = pArg->GetIndex();
91 pFastScrollListener->OnFastScrollIndexSelected(*pArg->GetSource(), index);
93 }}} // Tizen::Ui::Controls