{
SysAssertf(__pAppImpl != null, "Getting App instance failed.");
- return __pAppImpl->SendUserEvent(requestId, pArgs);
+ return __pAppImpl->SendUserEvent(requestId, pArgs, true);
}
void
SysAssertf(__pAppManagerImpl != null, "Not constructed properly by platform.");
Tizen::Base::Runtime::IEventListener* pListener = &listener;
- return __pAppManagerImpl->SetEventListener(AE_CHECKPOINT, pListener);
+ return __pAppManagerImpl->SetEventListener(_APP_EVENT_CHECKPOINT, pListener);
}
void
{
case _APP_HANDLER_LAUNCH_NORMAL:
SysLog(NID_APP, "Handling normal launch request");
- OnUserEventReceivedN(AppLaunchRequestId, pArg->GetArgListN(req));
+ OnUserEventReceivedN(AppLaunchRequestId, pArg->GetArgListN(req), true);
// [TODO] request handle memory cleanup confirm
_AppControlManager::GetInstance()->RemoveResultRequest(req);
case _APP_HANDLER_LAUNCH_COND:
SysLog(NID_APP, "Handling conditional launch request");
- OnUserEventReceivedN(AppLaunchRequestId, pArg->GetArgListN(req));
+ OnUserEventReceivedN(AppLaunchRequestId, pArg->GetArgListN(req), true);
// [TODO] request handle memory cleanup confirm
_AppControlManager::GetInstance()->RemoveResultRequest(req);
result
-_AppImpl::SendUserEvent(RequestId requestId, const IList* pArgs)
+_AppImpl::SendUserEvent(RequestId requestId, const IList* pArgs, bool isPublic)
{
- _AppUserEventArg* pArg = new (std::nothrow) _AppUserEventArg(requestId, pArgs);
+ _AppUserEventArg* pArg = new (std::nothrow) _AppUserEventArg(requestId, pArgs, isPublic);
SysTryReturnResult(NID_APP, pArg != null, E_OUT_OF_MEMORY, "User event creation failure for %d.", requestId);
result r = __appUserEvent.FireAsync(*pArg);
void
-_AppImpl::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
+_AppImpl::OnUserEventReceivedN(RequestId requestId, IList* pArgs, bool isPublic)
{
SysTryReturnVoidResult(NID_APP, __pApp != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting internal instance failed.");
- __pApp->OnUserEventReceivedN(requestId, pArgs);
+ if (isPublic)
+ {
+ __pApp->OnUserEventReceivedN(requestId, pArgs);
+ }
+ else
+ {
+ switch (requestId)
+ {
+ case _APP_EVENT_TERMINATE:
+ SysLog(NID_APP, "App terminate is requested.");
+ Terminate();
+ break;
+ case _APP_EVENT_RAISE:
+ SysLog(NID_APP, "App raise is requested.");
+ RaiseWindow();
+ break;
+ default:
+ SysLog(NID_APP, "Unknown event : 0x%x.", requestId);
+ break;
+ }
+ }
}
{
switch (appEvent)
{
- case AE_CHECKPOINT:
+ case _APP_EVENT_CHECKPOINT:
SysTryReturnResult(NID_APP, __pCheckpointEventListener == null, E_OBJ_ALREADY_EXIST, "Checkpoint listener is already set.");
// fall through
- case AE_CLEAR_LISTENER:
+ case _APP_EVENT_CLEAR_LISTENER:
__pCheckpointEventListener = dynamic_cast <IAppCheckpointEventListener*>(pListener);
break;
* @param[in] pArgs A pointer to an argument list of type String
* @exception E_SUCCESS The method is successful.
*/
- result SendUserEvent(RequestId requestId, const Tizen::Base::Collection::IList* pArgs);
+ result SendUserEvent(RequestId requestId, const Tizen::Base::Collection::IList* pArgs, bool isPublic);
/**
* Called asynchronously when the user event is sent by the SendUserEvent() method. @n
* @param[in] requestId The user defined event ID
* @param[in] pArgs A pointer to an argument list of type String
*/
- virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
+ virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs, bool isPublic);
/**
* Called asynchronously when AppControl provider event is received.
SysTryReturnVoidResult(NID_APP, pAppUserEventArg != null && pAppUserEventListener != null, E_INVALID_ARG,
"[E_INVALID_ARG] Listener or argument is null.");
- pAppUserEventListener->OnUserEventReceivedN(pAppUserEventArg->GetRequestId(), pAppUserEventArg->GetArgs());
+ pAppUserEventListener->OnUserEventReceivedN(pAppUserEventArg->GetRequestId(), pAppUserEventArg->GetArgs(), pAppUserEventArg->IsPublic());
}
};
, public Tizen::Base::Runtime::IEventArg
{
public:
- _AppUserEventArg(RequestId reqId, const Tizen::Base::Collection::IList* pArgs)
+ _AppUserEventArg(RequestId reqId, const Tizen::Base::Collection::IList* pArgs, bool isPublic)
: __reqId(reqId)
, __pArgs(pArgs)
+ , __isPublic(isPublic)
{
}
{
return __reqId;
}
+
Tizen::Base::Collection::IList* GetArgs(void) const
{
- return const_cast<Tizen::Base::Collection::IList*>( __pArgs );
+ return const_cast<Tizen::Base::Collection::IList*>(__pArgs);
+ }
+
+ bool IsPublic(void) const
+ {
+ return __isPublic;
}
private:
_AppUserEventArg& operator =(const _AppUserEventArg& source);
private:
- RequestId __reqId;
+ const RequestId __reqId;
const Tizen::Base::Collection::IList* __pArgs;
+ const bool __isPublic;
};
public:
virtual ~_IAppUserEventListener(void) {}
- virtual void OnUserEventReceivedN(RequestId reqId, Tizen::Base::Collection::IList* pArgs) = 0;
+ virtual void OnUserEventReceivedN(RequestId reqId, Tizen::Base::Collection::IList* pArgs, bool isPublic) = 0;
};
enum _AppEvent
{
- AE_BATTERY = 0x01,
- AE_LOW_MEMORY,
- AE_LEGACY_APPCONTROL,
- AE_LAUNCH_REQUEST,
- AE_CHECKPOINT,
- AE_DELETE_FRAME,
- AE_CLEAR_LISTENER,
+ _APP_EVENT_CHECKPOINT = 0,
+ _APP_EVENT_CLEAR_LISTENER,
+ _APP_EVENT_TERMINATE,
+ _APP_EVENT_RAISE,
};
/**
SET(PC_NAME ${this_target})
SET(PC_REQUIRED ${pc_requires})
SET(PC_LDFLAGS -l${this_target})
+SET(VERSION ${FULLVER})
# pkgconfig file
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY)
SET(PC_NAME ${this_target})
SET(PC_REQUIRED ${pc_requires})
SET(PC_LDFLAGS -l${this_target})
+SET(VERSION ${FULLVER})
# pkgconfig file
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY)
SET(PC_NAME ${this_target})
SET(PC_REQUIRED ${pc_requires})
SET(PC_LDFLAGS -l${this_target})
+SET(VERSION ${FULLVER})
# pkgconfig file
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY)