#include <unique_ptr.h>
#include <shortcut.h>
-//#include <livebox-service/livebox-service.h>
#include <FBaseSysLog.h>
#include <FBase.h>
const char LIVEBOX_TRAY_ON_CREATE[] = "LiveboxTray='event=create'";
const char LIVEBOX_TRAY_ON_DESTROY[] = "LiveboxTray='event=destroy'";
const char LIVEBOX_TRAY_ON_TOUCH[] = "LiveboxTray='event=touch'";
+
+const String ARG_KEY_INSTANCE_ID = L"_InstanceId";
+const String ARG_KEY_PROVIDER_NAME = L"_ProviderName";
+const String ARG_KEY_USER_INFO = L"_UserInfo";
+const String ARG_KEY_WIDTH = L"_Width";
+const String ARG_KEY_HEIGHT = L"_Height";
+const String ARG_KEY_EVENT_TYPE = L"_EventType";
+const String ARG_KEY_TIME_STAMP = L"_TimeStamp";
+const String ARG_KEY_X = L"_X";
+const String ARG_KEY_Y = L"_Y";
}
_LiveboxProviderManagerImpl::_LiveboxProviderManagerImpl()
_LiveboxProviderManagerImpl::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName)
{
- /*if( appId == App::App::GetInstance()->GetAppId()) //TODO: optimazing
+ /*if( appId == App::App::GetInstance()->GetAppId())
{
-
+ //TODO: optimazing for local request
}
else*/
{
void
_LiveboxProviderManagerImpl::OnAppControlRequestReceived(RequestId reqId, const String& operationId, const String* pUri, const String* pMimeType, const IMap* pArgs)
{
- if( pArgs == null && pArgs->GetCount() == 0)
- {
- SysAssertf(pArgs, "[E_SYSTEN] pArgs should not be null.");
- return;
- }
+ SysAssertf( pArgs, "[E_SYSTEN] pArgs should not be null.");
+ SysAssertf( pArgs->GetCount() > 0, "[E_SYSTEN] pArgs should have one more key-values.");
+
__messageReceived = true;
SysLog(NID_APP, "operationId(%ls), argc(%d)", operationId.GetPointer(), pArgs->GetCount());
- const String* pInstanceId = dynamic_cast<const String*>(pArgs->GetValue(String(L"Id")));
+ const String* pInstanceId = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_INSTANCE_ID));
SysTryReturnVoidResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pId is null.");
- const String* pName = dynamic_cast<const String*>(pArgs->GetValue(String(L"Name")));
+ const String* pName = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_PROVIDER_NAME));
SysTryReturnVoidResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pName is null");
- const String* pParam = dynamic_cast<const String*>(pArgs->GetValue(String(L"Param")));
+ const String* pParam = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_USER_INFO));
SysTryReturnVoidResult(NID_APP, pParam, E_FAILURE, "[E_FAILURE] pParam is null");
SysLog(NID_APP, "id(%ls), name(%ls), param(%ls)", pInstanceId->GetPointer(), pName->GetPointer(), pParam->GetPointer());
int width = 0;
int height = 0;
- const String* pValue = dynamic_cast<const String*>(pArgs->GetValue(String(L"Width")));
+ const String* pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_WIDTH));
SysTryReturnVoidResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Integer::Parse(*pValue, width);
- pValue = dynamic_cast<const String*>(pArgs->GetValue(String(L"Height")));
+ pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_HEIGHT));
SysTryReturnVoidResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Integer::Parse(*pValue, height);
if(operationId.StartsWith(L"LiveboxTray", 0) == true)
{
SysTryReturnVoidResult(NID_APP, __pLiveboxPopupProviderFactory, E_FAILURE, "[E_FAILURE] __pLiveboxPopupProviderFactory is null");
- //HandleLiveboxPopupRequest(operationId, pArgs);
- HandleLiveboxPopupRequest(operationId, null);
+ HandleLiveboxPopupRequest(operationId, pArgs);
}
else
{
SysTryReturnVoidResult(NID_APP, __pLiveboxFactory, E_FAILURE, "[E_FAILURE] __pLiveboxFactory is null");
- //HandleLiveboxRequest(operationId, pArgs);
- HandleLiveboxRequest(operationId, null);
+ HandleLiveboxRequest(operationId, pArgs);
}
SysLog(NID_APP, "Exit");
}
result
-_LiveboxProviderManagerImpl::HandleLiveboxRequest(const Tizen::Base::String& operationId, Tizen::Base::Collection::IList* pArgs)
+_LiveboxProviderManagerImpl::HandleLiveboxRequest(const Tizen::Base::String& operationId, const Tizen::Base::Collection::IMap* pArgs)
{
- if( pArgs == null && pArgs->GetCount() < 3)
+ if( pArgs == null || pArgs->GetCount() < 3)
{
SysAssertf(pArgs, "[E_SYSTEN] pArgs should not be null.");
return E_SYSTEM;
SysLog(NID_APP, "operationId(%ls), argc(%d)", operationId.GetPointer(), pArgs->GetCount());
- String *pInstanceId = dynamic_cast<String*>(pArgs->GetAt(0));
+ const String* pInstanceId = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_INSTANCE_ID));
SysTryReturnResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pId is null.");
/*String *pName = dynamic_cast<String*>(pArgs->GetAt(1));
{
int width = 0;
int height = 0;
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ const String* pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_WIDTH));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Integer::Parse(*pValue, width);
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_HEIGHT));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Integer::Parse(*pValue, height);
{
int width = 0;
int height = 0;
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ const String* pValue = dynamic_cast<const String*>( pArgs->GetValue(ARG_KEY_WIDTH));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE], ");
Integer::Parse(*pValue, width);
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_HEIGHT));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Integer::Parse(*pValue, height);
double x = 0.0f;
double y = 0.0f;
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ const String* pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_EVENT_TYPE));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Integer::Parse(*pValue, eventType);
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_TIME_STAMP));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Double::Parse(*pValue, timeStamp);
- pValue = dynamic_cast<String*>(pArgs->GetAt(5));
+ pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_X));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Double::Parse(*pValue, x);
- pValue = dynamic_cast<String*>(pArgs->GetAt(6));
+ pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_Y));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Double::Parse(*pValue, y);
}
result
-_LiveboxProviderManagerImpl::HandleLiveboxPopupRequest(const Tizen::Base::String& operationId, Tizen::Base::Collection::IList* pArgs)
+_LiveboxProviderManagerImpl::HandleLiveboxPopupRequest(const Tizen::Base::String& operationId, const Tizen::Base::Collection::IMap* pArgs)
{
SysTryReturnResult(NID_APP, __pLiveboxPopupProviderFactory, E_FAILURE, "[E_FAILURE] __pLiveboxPopupProviderFactory is null");
- if( pArgs == null && pArgs->GetCount() < 3)
+ if( pArgs == null || pArgs->GetCount() < 3)
{
SysAssertf(pArgs, "[E_SYSTEN] pArgs should not be null.");
return E_SYSTEM;
}
- String *pInstanceId = dynamic_cast<String*>(pArgs->GetAt(0));
+ const String* pInstanceId = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_INSTANCE_ID));
SysTryReturnResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pId is null.");
/*String *pName = dynamic_cast<String*>(pArgs->GetAt(1));
int width = 0;
int height = 0;
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ const String* pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_WIDTH));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Integer::Parse(*pValue, width);
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_HEIGHT));;
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Integer::Parse(*pValue, height);
double x = 0.0f;
double y = 0.0f;
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(2));
+ const String* pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_EVENT_TYPE));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Integer::Parse(*pValue, eventType);
- pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_TIME_STAMP));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Double::Parse(*pValue, timeStamp);
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_X));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Double::Parse(*pValue, x);
- pValue = dynamic_cast<String*>(pArgs->GetAt(5));
+ pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_Y));
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
Double::Parse(*pValue, y);