Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_GalleryImplEvent.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 <FUiCtrlIGalleryEventListener.h>
18 #include <FBaseSysLog.h>
19 #include "FUiCtrl_GalleryImplEvent.h"
20 #include "FUiCtrl_GalleryImplEventArg.h"
21
22 using namespace Tizen::Base::Runtime;
23
24 namespace Tizen { namespace Ui { namespace Controls {
25
26 _GalleryImplEvent::_GalleryImplEvent(void)
27         : __pSource(null)
28 {
29         // Do nothing
30 }
31
32 _GalleryImplEvent::~_GalleryImplEvent(void)
33 {
34         // Do nothing
35 }
36
37 result
38 _GalleryImplEvent::Construct(Gallery* pSource)
39 {
40         __pSource = pSource;
41
42         return E_SUCCESS;
43 }
44
45 void
46 _GalleryImplEvent::FireImpl(IEventListener& listener, const IEventArg& arg)
47 {
48         IGalleryEventListener* pGalleryEventListener = dynamic_cast<IGalleryEventListener*>(&listener);
49         SysTryReturnVoidResult(NID_UI_CTRL, pGalleryEventListener != null, E_INVALID_ARG,
50                                         "[E_INVALID_ARG] pListener is invalid listener type.");
51
52         const _GalleryImplEventArg& galleryArg = static_cast<const _GalleryImplEventArg&>(arg);
53
54         switch (galleryArg.GetEventType())
55         {
56         case GALLERY_EVENT_CURRENT_ITEM_CHANGED:
57                 pGalleryEventListener->OnGalleryCurrentItemChanged(*__pSource, galleryArg.GetArg1());
58                 break;
59         case GALLERY_EVENT_ITEM_CLICKED:
60                 pGalleryEventListener->OnGalleryItemClicked(*__pSource, galleryArg.GetArg1());
61                 break;
62         case GALLERY_EVENT_SLIDE_SHOW_STARTED:
63                 pGalleryEventListener->OnGallerySlideShowStarted(*__pSource);
64                 break;
65         case GALLERY_EVENT_SLIDE_SHOW_STOPPED:
66                 pGalleryEventListener->OnGallerySlideShowStopped(*__pSource);
67                 break;
68         default:
69                 SysTryReturnVoidResult(NID_UI_CTRL, false, E_INVALID_ARG, "[E_INVALIDE_ARG] The event type is invalid type.");
70                 break;
71         }
72 }
73
74 }}} // Tizen::Ui::Controls