add x, y param for LiveboxPopup
authorjungmin76.park <jungmin76.park@samsung.com>
Tue, 12 Feb 2013 10:45:56 +0000 (19:45 +0900)
committerjungmin76.park <jungmin76.park@samsung.com>
Tue, 12 Feb 2013 14:06:40 +0000 (23:06 +0900)
Change-Id: I8b6ba4481d86bf8648214e4fc0753a23fb44800f
Signed-off-by: jungmin76.park <jungmin76.park@samsung.com>
src/FShell_LiveboxPopupProviderImpl.cpp
src/FShell_LiveboxProviderManagerImpl.cpp
src/inc/FShell_LiveboxPopupProviderImpl.h
src/inc/FShell_LiveboxProviderManagerImpl.h

index c789a41..4afa6f3 100644 (file)
@@ -35,6 +35,10 @@ using namespace Tizen::Base;
 _LiveboxPopupProviderImpl::_LiveboxPopupProviderImpl(const String& instanceId)
        :__instanceId(instanceId)
        ,__pLiveboxPopup(null)
+       ,__x(0)
+       ,__y(0)
+       ,__width(0)
+       ,__height(0)
 {
 
 }
index 412b93d..260431f 100644 (file)
@@ -334,29 +334,6 @@ _LiveboxProviderManagerImpl::OnAppControlRequestReceived(RequestId reqId, const
 
        SysLog(NID_APP, "id(%ls), name(%ls), param(%ls)", pInstanceId->GetPointer(), pName->GetPointer(), pParam->GetPointer());
 
-       if(this->ContainsLivebox(*pInstanceId) == false)
-       {
-               SysLog(NID_APP, "no livebox instance, creating..");
-
-               int width = 0;
-               const String* pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_WIDTH));
-               SysTryReturnVoidResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_WIDTH.GetPointer() );
-               Integer::Parse(*pValue, width);
-
-               int height = 0;
-               pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_HEIGHT));
-               SysTryReturnVoidResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_HEIGHT.GetPointer() );
-               Integer::Parse(*pValue, height);
-
-               this->CreateLivebox( *pName, *pInstanceId, width, height, *pParam);
-
-               if(operationId == LIVEBOX_ON_RESIZE)
-               {
-                       SysLog(NID_APP, "operation is resize, but livebox is already recreated with new size, so OnSize won't be called.");
-                       return;
-               }
-       }
-
        if(operationId.StartsWith(L"LiveboxTray", 0) == true)
        {
                SysTryReturnVoidResult(NID_APP, __pLiveboxPopupProviderFactory, E_FAILURE, "[E_FAILURE] __pLiveboxPopupProviderFactory is null");
@@ -364,6 +341,29 @@ _LiveboxProviderManagerImpl::OnAppControlRequestReceived(RequestId reqId, const
        }
        else
        {
+               if(this->ContainsLivebox(*pInstanceId) == false)
+               {
+                       SysLog(NID_APP, "no livebox instance, creating..");
+
+                       int width = 0;
+                       const String* pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_WIDTH));
+                       SysTryReturnVoidResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_WIDTH.GetPointer() );
+                       Integer::Parse(*pValue, width);
+
+                       int height = 0;
+                       pValue = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_HEIGHT));
+                       SysTryReturnVoidResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_HEIGHT.GetPointer() );
+                       Integer::Parse(*pValue, height);
+
+                       this->CreateLivebox( *pName, *pInstanceId, width, height, *pParam);
+
+                       if(operationId == LIVEBOX_ON_RESIZE)
+                       {
+                               SysLog(NID_APP, "operation is resize, but livebox is already recreated with new size, so OnSize won't be called.");
+                               return;
+                       }
+               }
+
                SysTryReturnVoidResult(NID_APP, __pLiveboxFactory, E_FAILURE, "[E_FAILURE] __pLiveboxFactory is null");
                HandleLiveboxRequest(operationId, pArgs);
        }
@@ -486,13 +486,26 @@ _LiveboxProviderManagerImpl::HandleLiveboxPopupRequest(const Tizen::Base::String
 
        if (operationId == LIVEBOX_TRAY_ON_CREATE)
        {
+               int x = 0;
+               int y = 0;
                int width = 0;
                int height = 0;
 
                const String* pName = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_PROVIDER_NAME));
                SysTryReturnResult(NID_APP, pName, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_PROVIDER_NAME.GetPointer() );
 
-               const String* pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_WIDTH));
+               const String* pUserInfo = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_USER_INFO));
+               SysTryReturnResult(NID_APP, pUserInfo, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_USER_INFO.GetPointer() );
+
+               const String* pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_X));
+               SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_X.GetPointer() );
+               Integer::Parse(*pValue, x);
+
+               pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_Y));;
+               SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_Y.GetPointer() );
+               Integer::Parse(*pValue, y);
+
+               pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_WIDTH));
                SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_WIDTH.GetPointer() );
                Integer::Parse(*pValue, width);
 
@@ -500,7 +513,7 @@ _LiveboxProviderManagerImpl::HandleLiveboxPopupRequest(const Tizen::Base::String
                SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_HEIGHT.GetPointer() );
                Integer::Parse(*pValue, height);
 
-               this->CreateLiveboxPopupProvider(*pInstanceId, *pName);
+               this->CreateLiveboxPopupProvider(*pInstanceId, *pName, *pUserInfo, x, y, width, height);
                return E_SUCCESS;
        }
        else if (operationId == LIVEBOX_TRAY_ON_DESTROY)
@@ -546,7 +559,7 @@ _LiveboxProviderManagerImpl::HandleLiveboxPopupRequest(const Tizen::Base::String
 result
 _LiveboxProviderManagerImpl::CreateLivebox(const String& name, const String& instanceId, int width, int height, const String& userInfo)
 {
-       SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d", instanceId.GetPointer(), width, height);
+       SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d, userInfo:%ls", instanceId.GetPointer(), width, height, userInfo.GetPointer());
        SysTryReturnResult(NID_APP, __pLiveboxFactory, E_FAILURE, "[E_INVALID_OPERATION] __pLiveboxFactory should not be null");
 
        if( ContainsLivebox(instanceId))
@@ -571,7 +584,7 @@ _LiveboxProviderManagerImpl::CreateLivebox(const String& name, const String& ins
 result
 _LiveboxProviderManagerImpl::UpdateLivebox(const String& instanceId, int width, int height, const String& argument)
 {
-       SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d", instanceId.GetPointer(), width, height);
+       SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d, argument:%ls", instanceId.GetPointer(), width, height, argument.GetPointer() );
 
        LiveboxProvider* pLivebox = null;
        __liveBoxes.GetValue(instanceId, pLivebox);
@@ -600,7 +613,7 @@ _LiveboxProviderManagerImpl::ResizeLivebox(const String& instanceId, int width,
 result
 _LiveboxProviderManagerImpl::RemoveLivebox(const String& instanceId, bool terminateIfFinished)
 {
-       SysLog(NID_APP, "instanceId(%ls)", instanceId.GetPointer() );
+       SysLog(NID_APP, "instanceId(%ls), terminateIfFinished(%s)", instanceId.GetPointer(), (terminateIfFinished)? "true":"false" );
 //     __pLiveboxEventListener->OnLiveboxRemoved(instanceId);
 
        LiveboxProvider* pLiveboxProvider = null;
@@ -622,20 +635,20 @@ _LiveboxProviderManagerImpl::RemoveLivebox(const String& instanceId, bool termin
 }
 
 result
-_LiveboxProviderManagerImpl::CreateLiveboxPopupProvider(const String& instanceId, const String& providerName)
+_LiveboxProviderManagerImpl::CreateLiveboxPopupProvider(const String& instanceId, const String& providerName, const String& userInfo, int x, int y, int width, int height)
 {
-       SysLog(NID_APP, "instanceId(%ls)", instanceId.GetPointer());
+       SysLog(NID_APP, "instanceId(%ls), providerName(%ls), userInfo(%ls), rect(%d, %d, %d, %d)", instanceId.GetPointer(), providerName.GetPointer(), userInfo.GetPointer(), x, y, width, height );
        SysTryReturnResult(NID_APP, __pLiveboxPopupProviderFactory, E_FAILURE, "[E_INVALID_OPERATION] __pLiveboxPopupProviderFactory should not be null");
 
        LiveboxProvider* pLivebox = null;
        __liveBoxes.GetValue(instanceId, pLivebox);
        SysTryReturnResult(NID_APP, pLivebox, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
 
-       LiveboxPopupProvider* pPd = __pLiveboxPopupProviderFactory->CreateInstance(providerName, L"");
+       LiveboxPopupProvider* pPd = __pLiveboxPopupProviderFactory->CreateInstance(providerName, userInfo);
        __pLiveboxPopupProvider = pPd;
 
        __pLiveboxPopupProvider->Construct(instanceId);
-       __pLiveboxPopupProvider->OnLiveboxPopupProviderInitializing(L"");
+       __pLiveboxPopupProvider->OnLiveboxPopupProviderInitializing(userInfo);
 
        LiveboxPopup* pLiveBoxFrame = pPd->GetLiveboxPopup();
        SysTryReturnResult(NID_APP, pLiveBoxFrame, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
index a957b10..628336d 100644 (file)
@@ -53,6 +53,10 @@ private:
 private:
        Tizen::Base::String __instanceId;
        LiveboxPopup*   __pLiveboxPopup;
+       int __x;
+       int __y;
+       int __width;
+       int __height;
 };
 
 } /* namespace Livebox */
index 2e3e37f..ec664ac 100644 (file)
@@ -91,7 +91,7 @@ private:
        result UpdateLivebox(const Tizen::Base::String& instanceId, int width, int height, const Tizen::Base::String& argument);
        result ResizeLivebox(const Tizen::Base::String& instanceId, int width, int height);
        result RemoveLivebox(const Tizen::Base::String& instanceId, bool terminateIfFinished);
-       result CreateLiveboxPopupProvider(const Tizen::Base::String& instanceId, const Tizen::Base::String& providerName);
+       result CreateLiveboxPopupProvider(const Tizen::Base::String& instanceId, const Tizen::Base::String& providerName,  const Tizen::Base::String& userInfo, int x, int y, int width, int height);
        result DestroyLiveboxPopupProvider(const Tizen::Base::String& instanceId);
 
        bool  ContainsLivebox(const Tizen::Base::String& instanceId) const;