result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
void SendPendingTouchEvent(void);
+ virtual Tizen::Base::Collection::HashMap* CreateRequestArgs(void);
+
virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
struct PendingTouchEvent
bool IsRunning(void) const;
bool IsSharedMemCreated(void) const;
- Tizen::Base::Collection::HashMap* CreateRequestArgs(void);
+ virtual Tizen::Base::Collection::HashMap* CreateRequestArgs(void) = 0;
result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
public:
// static result ExtractPackageIdAndExecutableName(Tizen::App::AppId inAppId, Tizen::Base::String& outPackageId, Tizen::Base::String& outExecutableName);
};
+extern const wchar_t ARG_KEY_INSTANCE_ID[];
+extern const wchar_t ARG_KEY_PROVIDER_NAME[];
+extern const wchar_t ARG_KEY_USER_INFO[];
+extern const wchar_t ARG_KEY_X[];
+extern const wchar_t ARG_KEY_Y[];
+extern const wchar_t ARG_KEY_WIDTH[];
+extern const wchar_t ARG_KEY_HEIGHT[];
+extern const wchar_t ARG_KEY_POPUP_WIDTH[];
+extern const wchar_t ARG_KEY_POPUP_HEIGHT[];
+extern const wchar_t ARG_KEY_ARGUMENT[];
+extern const wchar_t ARG_KEY_EVENT_TYPE[];
+extern const wchar_t ARG_KEY_TIME_STAMP[];
+
} /* namespace App */
} /* namespace AppWidget */
} /* namespace Samsung */
static int OnAppWidgetPopupDestroy(struct event_arg *arg, void* data);
static int OnAppWidgetPause(struct event_arg *arg, void* data);
static int OnAppWidgetResume(struct event_arg *arg, void* data);
+ static int OnAppWidgetPauseAll(struct event_arg *arg, void* data);
+ static int OnAppWidgetResumeAll(struct event_arg *arg, void* data);
static int OnAppWidgetClick(struct event_arg *arg, void* data);
static int OnAppWidgetResize(struct event_arg *arg, void* data);
static int OnAppWidgetPeriodChaned(struct event_arg *arg, void* data);
+ static int OnAppWidgetRecreate(struct event_arg *arg, void* data);
// stub implementations
virtual result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument);
namespace Tizen { namespace Shell { namespace App
{
+class _AppWidgetContext;
+
class _AppWidgetPopupContext
:public Tizen::Shell::App::_AppWidgetContextBase
{
public:
- _AppWidgetPopupContext(const Tizen::Base::String& userInfo, const Tizen::Base::String& appId, const Tizen::Base::String& instanceId, int width, int height, int priority);
+ _AppWidgetPopupContext(const Tizen::Base::String& userInfo, const Tizen::Base::String& appId, const Tizen::Base::String& instanceId, int width, int height, int priority, _AppWidgetContext* pParent);
virtual ~_AppWidgetPopupContext();
// event handler
virtual result SendTouchEvent(buffer_event event, double timestamp, double x, double y);
result RequestUpdateRemote(void);
+
+private:
+ virtual Tizen::Base::Collection::HashMap* CreateRequestArgs(void);
+
+private:
+ _AppWidgetContext* __pParent;
};
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
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);
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()
//{
using namespace Tizen::Base::Collection;
-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 wchar_t ARG_KEY_INSTANCE_ID[] = L"_InstanceId";
+const wchar_t ARG_KEY_PROVIDER_NAME[] = L"_ProviderName";
+const wchar_t ARG_KEY_USER_INFO[] = L"_UserInfo";
+const wchar_t ARG_KEY_X[] = L"_X";
+const wchar_t ARG_KEY_Y[] = L"_Y";
+const wchar_t ARG_KEY_WIDTH[] = L"_Width";
+const wchar_t ARG_KEY_HEIGHT[] = L"_Height";
+const wchar_t ARG_KEY_POPUP_WIDTH[] = L"_PopupWidth";
+const wchar_t ARG_KEY_POPUP_HEIGHT[] = L"_PopupHeight";
+const wchar_t ARG_KEY_ARGUMENT[] = L"_Argument";
+const wchar_t ARG_KEY_EVENT_TYPE[] = L"_EventType";
+const wchar_t ARG_KEY_TIME_STAMP[] = L"_TimeStamp";
_AppWidgetContextBase::_AppWidgetContextBase(target_type type, const String& userInfo, const String& providerId, const String& instanceId, int width, int height, int priority)
return E_SUCCESS;
}
-Tizen::Base::Collection::HashMap*
-_AppWidgetContextBase::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;
-}
-
result
_AppWidgetContextBase::SendRequestToApp(const AppId& appId, const String& operation, HashMap* pArgs)
{
return 0;
}
- int
- AppWidgetManagerService::OnAppWidgetPause(struct event_arg *arg, void* data)
+int
+AppWidgetManagerService::OnAppWidgetPause(struct event_arg *arg, void* data)
{
SysTryReturn(NID_SHELL, arg, 0, E_SUCCESS, "arg is null!");
}
int
+AppWidgetManagerService::OnAppWidgetPauseAll(struct event_arg *arg, void* data)
+{
+ SysLog(NID_SHELL,"");
+ return 0;
+}
+
+int
+AppWidgetManagerService::OnAppWidgetResumeAll(struct event_arg *arg, void* data)
+{
+ SysLog(NID_SHELL,"");
+ return 0;
+}
+
+int
AppWidgetManagerService::OnAppWidgetClick(struct event_arg *arg, void* data)
{
SysTryReturn (NID_SHELL, arg->type == event_arg::EVENT_CLICKED, -EPERM, E_SUCCESS, "invalid argument from master");
return 0;
}
+int
+AppWidgetManagerService::OnAppWidgetRecreate(struct event_arg *arg, void* data)
+{
+ SysLog(NID_SHELL, "");
+ return 0;
+}
+
result
AppWidgetManagerService::InitializeMasterDaemonEventReceiver(const char *pServiceExecutableName)
{
cbs.connected = AppWidgetConnected,
cbs.disconnected = AppWidgetDisconnected,
- cbs.pause = OnAppWidgetPause,
- cbs.resume = OnAppWidgetResume,
-// cbs.lb_pause = OnAppWidgetPause,
-// cbs.lb_resume = OnAppWidgetResume,
+ cbs.pause = OnAppWidgetPauseAll,
+ cbs.resume = OnAppWidgetResumeAll,
+ cbs.lb_pause = OnAppWidgetPause,
+ cbs.lb_resume = OnAppWidgetResume,
cbs.lb_create = OnAppWidgetCreate,
cbs.lb_destroy = OnAppWidgetDestroy,
cbs.update_content = OnAppWidgetUpdate,
cbs.clicked = OnAppWidgetClick,
cbs.resize = OnAppWidgetResize,
cbs.set_period = OnAppWidgetPeriodChaned;
- //cbs.lb_recreate = OnAppWidgetRecreate,/* Recover from the fault of slave */
+ cbs.lb_recreate = OnAppWidgetRecreate;/* Recover from the fault of slave */
//cbs.content_event = OnAppWidgetContentEvent,
- //cbs.change_group = OnAppWidgetGroupChanged;
int ret = provider_init(null, pServiceExecutableName, &cbs, this);
SysTryReturnResult(NID_SHELL, ret == 0, E_SYSTEM, "provider_init failed.");
#include <FApp_AppControlManager.h>
#include "FShell_AppWidgetManagerService.h"
+#include "FShell_AppWidgetContext.h"
#include "FShell_AppWidgetPopupContext.h"
namespace Tizen { namespace Shell { namespace App
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);
}
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());
}
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 {