Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / scenes / FUiScenes_SceneControlEvent.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
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
18 #include <FBaseSysLog.h>
19 #include "FUiScenes_ISceneControlEventListener.h"
20 #include "FUiScenes_SceneControlEvent.h"
21
22 namespace Tizen { namespace Ui { namespace Scenes
23 {
24
25 result
26 _SceneControlEvent::Construct(void)
27 {
28         return _Event::Initialize();
29 }
30
31 void
32 _SceneControlEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg)
33 {
34         _ISceneControlEventListener* pListener = dynamic_cast<_ISceneControlEventListener*>(&listener);
35         if (pListener)
36         {
37                 const _SceneControlEventArg* pEventArg = dynamic_cast<const _SceneControlEventArg*>(&arg);
38                 if (pEventArg)
39                 {
40                         pListener->OnSceneControlEventReceived(pEventArg->GetEventType(), pEventArg->GetSceneId());
41                         return;
42                 }
43         }
44         SysLog(NID_UI_SCENES, "Invalid _SceneControlEvent arguments : listener(0x%x), arg(0x%x)", pListener, &arg);
45 }
46
47 } } } // Tizen::Ui::Scenes