[appwidget-service] Remove Open Service Platform words
[platform/framework/native/appwidget-service.git] / src / FShell_AppWidgetPopupContext.cpp
index 1b0bfd0..ab5f146 100644 (file)
@@ -1,8 +1,7 @@
 //
-// Open Service Platform
 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
 //
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
@@ -32,6 +31,7 @@
 #include <FApp_AppControlManager.h>
 
 #include "FShell_AppWidgetManagerService.h"
+#include "FShell_AppWidgetContext.h"
 #include "FShell_AppWidgetPopupContext.h"
 
 namespace Tizen { namespace Shell  { namespace App
@@ -45,15 +45,11 @@ const char APPWIDGET_POPUP_ON_CREATE[] = "http://tizen.org/appcontrol/appwidgetp
 const char APPWIDGET_POPUP_ON_DESTROY[] = "http://tizen.org/appcontrol/appwidgetpopup/destroy";
 const char APPWIDGET_POPUP_ON_TOUCH[] = "http://tizen.org/appcontrol/appwidgetpopup/touch";
 
-const String ARG_KEY_X = L"_X";
-const String ARG_KEY_Y = L"_Y";
-const String ARG_KEY_WIDTH = L"_Width";
-const String ARG_KEY_HEIGHT = L"_Height";
 
-
-_AppWidgetPopupContext::_AppWidgetPopupContext(const String& info, const String& appId, const String& instanceId, int width, int height, int priority)
+_AppWidgetPopupContext::_AppWidgetPopupContext(const String& info, const String& appId, const String& instanceId, int width, int height, int priority, _AppWidgetContext* pParent)
 :_AppWidgetContextBase(TYPE_PD, info, appId, instanceId, width, height, priority)
 {
+       __pParent = pParent;
        SysLog(NID_SHELL, "appId(%ls), instanceId(%ls), width(%d), height(%d)", __providerId.GetPointer(), __instanceId.GetPointer(), __width, __height);
 }
 
@@ -84,8 +80,8 @@ _AppWidgetPopupContext::SendPopupCreateRequest(double x, double y, int width, in
 
        pArgs->Add(new String(ARG_KEY_X), new String(Double::ToString(x)));
        pArgs->Add(new String(ARG_KEY_Y), new String(Double::ToString(y)));
-       pArgs->Add(new String(ARG_KEY_WIDTH), new String(Integer::ToString(width)));
-       pArgs->Add(new String(ARG_KEY_HEIGHT), new String(Integer::ToString(height)));
+       pArgs->Add(new String(ARG_KEY_POPUP_WIDTH), new String(Integer::ToString(width)));
+       pArgs->Add(new String(ARG_KEY_POPUP_HEIGHT), new String(Integer::ToString(height)));
 
        return SendRequestToApp( __appId, APPWIDGET_POPUP_ON_CREATE, pArgs.get());
 }
@@ -136,5 +132,19 @@ _AppWidgetPopupContext::RequestUpdateRemote()
        return E_SUCCESS;
 }
 
+Tizen::Base::Collection::HashMap*
+_AppWidgetPopupContext::CreateRequestArgs(void)
+{
+       HashMap* pArgs = new (std::nothrow) HashMap(SingleObjectDeleter);
+       pArgs->Construct();
+       pArgs->Add(new String(ARG_KEY_INSTANCE_ID), new String(__instanceId));
+       pArgs->Add(new String(ARG_KEY_PROVIDER_NAME), new String(__providerName));
+       pArgs->Add(new String(ARG_KEY_USER_INFO), new String(__userInfo));
+       pArgs->Add(new String(ARG_KEY_WIDTH), new String(Integer::ToString(__pParent->__width)));
+       pArgs->Add(new String(ARG_KEY_HEIGHT), new String(Integer::ToString(__pParent->__height)));
+
+       return pArgs;
+}
+
 } } } // Tizen::Shell::App {