Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_GalleryRendererNotifier.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 <FBaseRtIEventListener.h>
19 #include <FBaseSysLog.h>
20 #include "FUiCtrl_GalleryRendererNotifier.h"
21 #include "FUiCtrl_GalleryRendererNotification.h"
22 #include "FUiCtrl_IGalleryRendererNotiListener.h"
23
24
25 using namespace Tizen::Base::Runtime;
26
27 namespace Tizen { namespace Ui { namespace Controls {
28
29 _GalleryRendererNotifier::_GalleryRendererNotifier(void)
30 {
31         // Do nothing
32 }
33
34 _GalleryRendererNotifier::~_GalleryRendererNotifier(void)
35 {
36         // Do nothing
37 }
38
39 result
40 _GalleryRendererNotifier::Construct(void)
41 {
42         return _Event::Initialize();
43 }
44
45 void
46 _GalleryRendererNotifier::FireImpl(IEventListener& listener, const IEventArg& arg)
47 {
48         _IGalleryRendererNotiListener* pRendererNotiListener = dynamic_cast<_IGalleryRendererNotiListener*>(&listener);
49         SysTryReturnVoidResult(NID_UI_CTRL, pRendererNotiListener != null, E_INVALID_ARG, "[E_INVALID_ARG] IEventListener is invalid listener.");
50
51         const _GalleryRendererNotification& rendererNotification = static_cast<const _GalleryRendererNotification&>(arg);
52
53         switch (rendererNotification.GetNotificationType())
54         {
55         case GALLERY_RENDERER_NOTI_TRANSITION_CANCEL:
56                 pRendererNotiListener->OnTransitionCancel();
57                 break;
58         case GALLERY_RENDERER_NOTI_TRANSITION_COMPLETED:
59                 pRendererNotiListener->OnTransitionCompleted();
60                 break;
61         case GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_CANCEL:
62                 pRendererNotiListener->OnCanvasAnimationCancel();
63                 break;
64         case GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_COMPLETED:
65                 pRendererNotiListener->OnCanvasAnimationCompleted();
66                 break;
67         case GALLERY_RENDERER_NOTI_CANVAS_ANIMATION_STARTED:
68                 pRendererNotiListener->OnCanvasAnimationStarted();
69                 break;
70         default:
71                 SysTryReturnVoidResult(NID_UI_CTRL, false, E_INVALID_ARG, "[E_INVALID_ARG] The notification type is invalid.");
72                 break;
73         }
74 }
75
76 }}} // Tizen::Ui::Controls