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_IconListViewItemEvent.cpp
20 * @brief This is the implementation file for the _IconListViewItemEvent class.
23 #include <FBaseSysLog.h>
24 #include <FUiCtrlIconListView.h>
25 #include <FUiCtrlIIconListViewItemEventListener.h>
27 #include "FUiCtrl_IconListViewItemEvent.h"
28 #include "FUiCtrl_IconListViewItemEventArg.h"
37 _IconListViewItemEvent::_IconListViewItemEvent(void)
43 _IconListViewItemEvent::~_IconListViewItemEvent(void)
49 _IconListViewItemEvent::Construct(const IconListView& source)
51 result r = _Event::Initialize();
56 __pSource = const_cast <IconListView*>(&source);
63 _IconListViewItemEvent::GetSource(void) const
69 _IconListViewItemEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg)
71 // cast to IIconListViewItemEventListener
72 IIconListViewItemEventListener* pItemListener = dynamic_cast <IIconListViewItemEventListener*>(&listener);
73 SysTryReturnVoidResult(NID_UI_CTRL, (pItemListener != null), E_INVALID_ARG, "[E_INVALID_ARG] Invalid listener is used.");
75 // cast to _IconListViewItemEventArg
76 const _IconListViewItemEventArg* pItemEventArg = dynamic_cast <const _IconListViewItemEventArg*>(&arg);
77 SysTryReturnVoidResult(NID_UI_CTRL, (pItemEventArg != null), E_INVALID_ARG, "[E_INVALID_ARG] Invalid event argument is used.");
79 switch (pItemEventArg->GetEventType())
81 case EVENT_TYPE_ITEM_SELECTED:
82 pItemListener->OnIconListViewItemStateChanged(
83 const_cast<IconListView&>(*GetSource()), pItemEventArg->GetIndex(), pItemEventArg->GetStatus());
85 case EVENT_TYPE_OVERLAY_BITMAP_SELECTED:
86 pItemListener->OnIconListViewOverlayBitmapSelected(
87 const_cast<IconListView&>(*GetSource()), pItemEventArg->GetIndex(), pItemEventArg->GetOverlayBitmapId());
89 case EVENT_TYPE_ITEM_REORDERED:
90 pItemListener->OnIconListViewItemReordered(
91 const_cast<IconListView&>(*GetSource()), pItemEventArg->GetFromIndex(), pItemEventArg->GetToIndex());
95 SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid event argument is used.");
99 SetLastResult(E_SUCCESS);
102 }}} // Tizen::Ui::Controls