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_UiListViewItemEvent.cpp
20 * @brief This is the implementation file for _UiListViewItemEvent class.
22 * This file contains the implementation of _UiListViewItemEvent class.
25 #include <FBaseErrors.h>
26 #include <FBaseSysLog.h>
27 #include "FUiCtrl_IUiListViewItemEventListener.h"
28 #include "FUiCtrl_UiListViewItemEvent.h"
29 #include "FUiCtrl_UiListViewItemEventArg.h"
31 using namespace Tizen::Base::Runtime;
32 using namespace Tizen::Ui;
34 namespace Tizen { namespace Ui { namespace Controls
37 _UiListViewItemEvent::_UiListViewItemEvent(void)
42 _UiListViewItemEvent::~_UiListViewItemEvent(void)
48 _UiListViewItemEvent::SetSource(_Control* pSource) // temporary code
54 _UiListViewItemEvent::FireImpl(IEventListener& listener, const IEventArg& arg)
56 // cast to _ItemEventArg
57 _UiListViewItemEventArg* pEventArg = dynamic_cast<_UiListViewItemEventArg*>(const_cast<IEventArg*>(&arg));
58 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg != null, E_INVALID_ARG, ("[E_INVALID_ARG] event argument is invalid type."));
60 int index1 = pEventArg->GetArg1();
61 int index2 = pEventArg->GetArg2();
62 int index3 = pEventArg->GetArg3();
69 _IUiListViewItemEventListener* pListener = dynamic_cast<_IUiListViewItemEventListener*>(&listener);
70 SysTryReturnVoidResult(NID_UI_CTRL, pListener != null, E_INVALID_ARG, ("[E_INVALID_ARG] invalid listener type."));
72 switch (pEventArg->GetNotifyType())
74 case NOTIFY_TYPE_CONTEXTITEM_SELCTED:
75 pListener->OnListViewContextItemStateChanged(*__pSource, index1, index2, index3, LIST_CONTEXT_ITEM_STATUS_SELECTED);
78 case NOTIFY_TYPE_CONTEXTITEM_HIGHLIGHTED:
79 pListener->OnListViewContextItemStateChanged(*__pSource, index1, index2, index3, LIST_CONTEXT_ITEM_STATUS_HIGHLIGHTED);
87 }}} // Tizen::Ui::Controls