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.
17 #include <FBaseErrors.h>
18 #include <FUiCtrlGalleryItem.h>
19 #include <FUiCtrlIGalleryItemProvider.h>
20 #include <FBaseSysLog.h>
21 #include "FUiCtrl_GalleryCoreEventListener.h"
22 #include "FUiCtrl_GalleryImplEvent.h"
23 #include "FUiCtrl_GalleryImplEventArg.h"
24 #include "FUiCtrl_GalleryItemImpl.h"
25 #include "FUiCtrl_GalleryItem.h"
27 namespace Tizen { namespace Ui { namespace Controls {
29 _GalleryCoreEventListener::_GalleryCoreEventListener(_GalleryImplEvent& implEvent)
30 : __pItemProvider(null)
31 , __implEvent(implEvent)
36 _GalleryCoreEventListener::~_GalleryCoreEventListener(void)
42 _GalleryCoreEventListener::OnCurrentItemChanged(int currentIndex)
44 _GalleryImplEventArg* pEventArg = new (std::nothrow) _GalleryImplEventArg(GALLERY_EVENT_CURRENT_ITEM_CHANGED, currentIndex);
45 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
47 __implEvent.Fire(*pEventArg);
51 _GalleryCoreEventListener::OnItemClicked(int itemIndex)
53 _GalleryImplEventArg* pEventArg = new (std::nothrow) _GalleryImplEventArg(GALLERY_EVENT_ITEM_CLICKED, itemIndex);
54 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
56 __implEvent.Fire(*pEventArg);
60 _GalleryCoreEventListener::OnSlideShowStarted(void)
62 _GalleryImplEventArg* pEventArg = new (std::nothrow) _GalleryImplEventArg(GALLERY_EVENT_SLIDE_SHOW_STARTED);
63 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
65 __implEvent.Fire(*pEventArg);
69 _GalleryCoreEventListener::OnSlideShowStopped(void)
71 _GalleryImplEventArg* pEventArg = new (std::nothrow) _GalleryImplEventArg(GALLERY_EVENT_SLIDE_SHOW_STOPPED);
72 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
74 __implEvent.Fire(*pEventArg);
77 }}} // Tizen::Ui::Controls