2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 <FBaseRtIEventListener.h>
19 #include <FBaseSysLog.h>
20 #include "FUiCtrl_GalleryRendererNotifier.h"
21 #include "FUiCtrl_GalleryRendererNotification.h"
22 #include "FUiCtrl_IGalleryRendererNotiListener.h"
25 using namespace Tizen::Base::Runtime;
27 namespace Tizen { namespace Ui { namespace Controls {
29 _GalleryRendererNotifier::_GalleryRendererNotifier(void)
34 _GalleryRendererNotifier::~_GalleryRendererNotifier(void)
40 _GalleryRendererNotifier::FireImpl(IEventListener& listener, const IEventArg& arg)
42 _IGalleryRendererNotiListener* pRendererNotiListener = dynamic_cast<_IGalleryRendererNotiListener*>(&listener);
43 SysTryReturnVoidResult(NID_UI_CTRL, pRendererNotiListener != null, E_INVALID_ARG, "[E_INVALID_ARG] IEventListener is invalid listener.");
45 const _GalleryRendererNotification& rendererNotification = static_cast<const _GalleryRendererNotification&>(arg);
47 switch (rendererNotification.GetNotificationType())
49 case GALLERY_RENDERER_NOTI_TRANSITION_CANCEL:
50 pRendererNotiListener->OnTransitionCancel();
52 case GALLERY_RENDERER_NOTI_TRANSITION_COMPLETED:
53 pRendererNotiListener->OnTransitionCompleted();
55 case GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_CANCEL:
56 pRendererNotiListener->OnCanvasAnimationCancel();
58 case GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_COMPLETED:
59 pRendererNotiListener->OnCanvasAnimationCompleted();
61 case GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_STARTED:
62 pRendererNotiListener->OnCanvasAnimationStarted();
65 SysTryReturnVoidResult(NID_UI_CTRL, false, E_INVALID_ARG, "[E_INVALID_ARG] The notification type is invalid.");
70 }}} // Tizen::Ui::Controls