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 <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::Construct(void)
42 return _Event::Initialize();
46 _GalleryRendererNotifier::FireImpl(IEventListener& listener, const IEventArg& arg)
48 _IGalleryRendererNotiListener* pRendererNotiListener = dynamic_cast<_IGalleryRendererNotiListener*>(&listener);
49 SysTryReturnVoidResult(NID_UI_CTRL, pRendererNotiListener != null, E_INVALID_ARG, "[E_INVALID_ARG] IEventListener is invalid listener.");
51 const _GalleryRendererNotification& rendererNotification = static_cast<const _GalleryRendererNotification&>(arg);
53 switch (rendererNotification.GetNotificationType())
55 case GALLERY_RENDERER_NOTI_TRANSITION_CANCEL:
56 pRendererNotiListener->OnTransitionCancel();
58 case GALLERY_RENDERER_NOTI_TRANSITION_COMPLETED:
59 pRendererNotiListener->OnTransitionCompleted();
61 case GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_CANCEL:
62 pRendererNotiListener->OnCanvasAnimationCancel();
64 case GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_COMPLETED:
65 pRendererNotiListener->OnCanvasAnimationCompleted();
67 case GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_STARTED:
68 pRendererNotiListener->OnCanvasAnimationStarted();
71 SysTryReturnVoidResult(NID_UI_CTRL, false, E_INVALID_ARG, "[E_INVALID_ARG] The notification type is invalid.");
76 }}} // Tizen::Ui::Controls