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 FUiCtrl_UiIconListItemEvent.cpp
20 * @brief This is the implementation file for the _UiIconListItemEvent class.
23 #include <FBaseSysLog.h>
25 #include "FUiCtrl_IconListView.h"
26 #include "FUiCtrl_IconListViewItemEventArg.h"
27 #include "FUiCtrl_IIconListItemEventListener.h"
28 #include "FUiCtrl_UiIconListItemEvent.h"
30 namespace Tizen { namespace Ui { namespace Controls
33 _UiIconListItemEvent::_UiIconListItemEvent(void)
38 _UiIconListItemEvent::~_UiIconListItemEvent(void)
43 _UiIconListItemEvent::Construct(const _IconListView& source)
45 result r = _Event::Initialize();
50 __pSource = const_cast <_IconListView*>(&source);
57 _UiIconListItemEvent::GetSource(void) const
63 _UiIconListItemEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg)
65 // cast to IIconListItemEventListener
66 _IIconListItemEventListener* pItemListener = dynamic_cast<_IIconListItemEventListener*>(&listener);
67 SysTryReturnVoidResult(NID_UI_CTRL, (pItemListener != null), E_INVALID_ARG, "[E_INVALID_ARG] Invalid listener is used.");
69 // cast to _UiIconListItemEventArg
70 const _IconListViewItemEventArg* pItemEventArg = dynamic_cast<const _IconListViewItemEventArg*>(&arg);
71 SysTryReturnVoidResult(NID_UI_CTRL, (pItemEventArg != null), E_INVALID_ARG,
72 "[E_INVALID_ARG] Invalid event argument is used.");
74 switch (pItemEventArg->GetEventType())
76 case EVENT_TYPE_ITEM_SELECTED:
77 pItemListener->OnIconListItemStateChanged(const_cast<_IconListViewItemEventArg*>(pItemEventArg));
79 case EVENT_TYPE_OVERLAY_BITMAP_SELECTED:
80 pItemListener->OnIconListViewOverlayBitmapSelected(const_cast<_IconListViewItemEventArg*>(pItemEventArg));
82 case EVENT_TYPE_ITEM_REORDERED:
83 pItemListener->OnIconListViewItemReordered(const_cast<_IconListViewItemEventArg*>(pItemEventArg));
87 SetLastResult(E_SUCCESS);
90 }}} // Tizen::Ui::Controls