initialize appwidget when appwidget popup is created
[platform/framework/native/appwidget-service.git] / src / FShell_AppWidgetContext.cpp
index 5185b63..ba5b132 100644 (file)
@@ -51,12 +51,6 @@ const char APPWIDGET_ON_UPDATE[] = "http://tizen.org/appcontrol/appwidget/update
 const char APPWIDGET_ON_RESIZE[] = "http://tizen.org/appcontrol/appwidget/resize";
 const char APPWIDGET_ON_TOUCH[] = "http://tizen.org/appcontrol/appwidget/touch";
 
-const String ARG_KEY_ARGUMENT = L"_Argument";
-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";
-
 const int DEFAULT_LIFE_DURATION_MSEC = 30000;//30sec
 const int UPDATE_PERIOD_MSEC_MIN = 1800000;//30min
 
@@ -165,7 +159,7 @@ _AppWidgetContext::OnBackground()
 void
 _AppWidgetContext::OnPopupCreated(double x, double y, int width, int height)
 {
-       __pAppWidgetPopup = new (std::nothrow) _AppWidgetPopupContext(__userInfo, __providerId, __instanceId, width, height, __priority);
+       __pAppWidgetPopup = new (std::nothrow) _AppWidgetPopupContext(__userInfo, __providerId, __instanceId, width, height, __priority, this);
        __pAppWidgetPopup->SetIpcClientId(__ipcClientId);
        __pAppWidgetPopup->OnPopupCreated(x, y, width, height);
 
@@ -288,6 +282,21 @@ _AppWidgetContext::RequestUpdateRemote(int width, int height)
        return E_SUCCESS;
 }
 
+Tizen::Base::Collection::HashMap*
+_AppWidgetContext::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(__width)));
+       pArgs->Add(new String(ARG_KEY_HEIGHT), new String(Integer::ToString(__height)));
+
+       return pArgs;
+}
+
+
 //void
 //_AppWidgetContext::RestartLifeDurationTimer()
 //{