2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
\r
4 // Licensed under the Apache License, Version 2.0 (the License);
\r
5 // you may not use this file except in compliance with the License.
\r
6 // You may obtain a copy of the License at
\r
8 // http://www.apache.org/licenses/LICENSE-2.0
\r
10 // Unless required by applicable law or agreed to in writing, software
\r
11 // distributed under the License is distributed on an "AS IS" BASIS,
\r
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 // See the License for the specific language governing permissions and
\r
14 // limitations under the License.
\r
18 * @file FApp_AppLifecycleEvent.cpp
\r
19 * @brief This is the implementation for the _AppLifecycleEvent.cpp class.
\r
22 #include <FBaseSysLog.h>
\r
24 #include "FApp_Types.h"
\r
25 #include "FApp_AppLifecycleEvent.h"
\r
26 #include "FApp_AppLifecycleEventArg.h"
\r
27 #include "FApp_IAppLifecycleEventListener.h"
\r
29 using namespace Tizen::Base;
\r
30 using namespace Tizen::Base::Runtime;
\r
33 namespace Tizen { namespace App
\r
36 _AppLifecycleEventArg::_AppLifecycleEventArg(void)
\r
40 _AppLifecycleEventArg::_AppLifecycleEventArg(const AppId& appId, _AppLifecycleEventType appLifecycleEventType)
\r
42 , __appLifecycleEventType(appLifecycleEventType)
\r
46 _AppLifecycleEventArg::~_AppLifecycleEventArg(void)
\r
51 _AppLifecycleEventArg::GetAppId(void) const
\r
56 _AppLifecycleEventType
\r
58 _AppLifecycleEventArg::GetAppLifecycleEventType(void) const
\r
60 return __appLifecycleEventType;
\r
63 ///////////////////////////////////////////////////////
\r
64 //_AppLifecycleEvent
\r
65 ///////////////////////////////////////////////////////
\r
67 _AppLifecycleEvent::Construct(void)
\r
69 return _Event::Initialize();
\r
73 _AppLifecycleEvent::FireImpl(IEventListener& listener, const IEventArg& arg)
\r
75 _IAppLifecycleEventListener* pListener = dynamic_cast<_IAppLifecycleEventListener*>(&listener);
\r
76 SysTryReturnVoidResult(NID_APP, pListener != null, E_INVALID_STATE, "Invalid listener : listener(0x%x), arg(0x%x)", &listener, &arg);
\r
78 const _AppLifecycleEventArg* pEventArg = dynamic_cast<const _AppLifecycleEventArg*>(&arg);
\r
79 SysTryReturnVoidResult(NID_APP, pEventArg != null, E_INVALID_STATE, "Invalid arg : listener(0x%x), arg(0x%x)", &listener, &arg);
\r
81 pListener->OnAppLifecycleEventReceived(pEventArg->GetAppId(), pEventArg->GetAppLifecycleEventType());
\r