Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_GalleryCoreEventListener.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
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"
26
27 namespace Tizen { namespace Ui { namespace Controls {
28
29 _GalleryCoreEventListener::_GalleryCoreEventListener(_GalleryImplEvent& implEvent)
30         : __pItemProvider(null)
31         , __implEvent(implEvent)
32 {
33         // Do nothing
34 }
35
36 _GalleryCoreEventListener::~_GalleryCoreEventListener(void)
37 {
38         // Do nothing
39 }
40
41 void
42 _GalleryCoreEventListener::OnCurrentItemChanged(int currentIndex)
43 {
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.");
46
47         __implEvent.Fire(*pEventArg);
48 }
49
50 void
51 _GalleryCoreEventListener::OnItemClicked(int itemIndex)
52 {
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.");
55
56         __implEvent.Fire(*pEventArg);
57 }
58
59 void
60 _GalleryCoreEventListener::OnSlideShowStarted(void)
61 {
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.");
64
65         __implEvent.Fire(*pEventArg);
66 }
67
68 void
69 _GalleryCoreEventListener::OnSlideShowStopped(void)
70 {
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.");
73
74         __implEvent.Fire(*pEventArg);
75 }
76
77 }}} // Tizen::Ui::Controls