#include <FBaseRtTimer.h>
#include <FBaseRtThread.h>
#include <FBaseColArrayListT.h>
+#include <FSysISettingEventListener.h>
#include "FShell_AppWidgetContext.h"
#include "FShell_AppWidgetManagerStub.h"
class AppWidgetManagerService
:public Tizen::Shell::App::_AppWidgetManagerStub
,public Tizen::Base::Runtime::ITimerEventListener
+ ,public Tizen::System::ISettingEventListener
{
public:
static AppWidgetManagerService* GetInstance(void);
static int OnAppWidgetResumeAll(struct event_arg *pArg, void* pData);
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 OnAppWidgetPeriodChanged(struct event_arg *arg, void* data);
static int OnAppWidgetRecreate(struct event_arg *arg, void* data);
// stub implementations
// ipc
virtual void OnIpcClientConnected(const Tizen::Io::_IpcServer& server, int clientId);
virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer&server, int clientId);
+ virtual void OnSettingChanged(Tizen::Base::String & key);
// helpers
result SetIpcClientIds(const Tizen::App::AppId& appId, int clientId);
#include <FBaseSysLog.h>
#include <FBaseColIList.h>
#include <FAppApp.h>
+#include <FSystem.h>
#include <FApp_AppManagerImpl.h>
#include <FIo_IpcServer.h>
#include <FBase_StringConverter.h>
r = __handlerThread.Start();
SysTryReturnResult(NID_SHELL, IsFailed(r) == false, r, "Event thread Start failure.");
+ SettingInfo::AddSettingEventListener(*this);
+
return InitializeCoreDaemonEventReceiver(pIdForCoreDaemon);
}
this->SetIpcClientIds(appId, -1);
}
+wchar_t KEY_SETTING_FONT_SIZE[] = L"http://tizen.org/setting/font.size";
+wchar_t KEY_SETTING_FONT_TYPE[] = L"http://tizen.org/setting/font.type";
+wchar_t KEY_SETTING_LANGUAGE[] = L"http://tizen.org/setting/locale.language";
+wchar_t KEY_SETTING_COUNTRY[] = L"http://tizen.org/setting/locale.country";
+
+void
+AppWidgetManagerService::OnSettingChanged(Tizen::Base::String& key)
+{
+ if( key == KEY_SETTING_FONT_TYPE
+// || key == KEY_SETTING_FONT_SIZE
+ || key == KEY_SETTING_LANGUAGE
+ || key == KEY_SETTING_COUNTRY )
+ {
+ SysLog(NID_SHELL, "'%ls' is changed.", key.GetPointer() );
+ RequestUpdate("", "", "");
+ }
+}
+
result
AppWidgetManagerService::AddAppWidget(_AppWidgetContext* pAppWidgetContext)
{
}
int
-AppWidgetManagerService::OnAppWidgetPeriodChaned(struct event_arg *arg, void* data)
+AppWidgetManagerService::OnAppWidgetPeriodChanged(struct event_arg *arg, void* data)
{
SysTryReturn(NID_SHELL, arg != null, 0, E_SUCCESS, "arg is null!");
SysSecureLog(NID_SHELL, "packageName(%s), id(%s), width(%d), height(%d), priority(%d)", arg->pkgname, arg->id);
cbs.pd_destroy = OnAppWidgetPopupDestroy,
cbs.clicked = OnAppWidgetClick,
cbs.resize = OnAppWidgetResize,
- cbs.set_period = OnAppWidgetPeriodChaned;
+ cbs.set_period = OnAppWidgetPeriodChanged;
cbs.lb_recreate = OnAppWidgetRecreate;/* Recover from the fault of slave */
//cbs.content_event = OnAppWidgetContentEvent,
///////////////////////////////////////////////////////
// stub implementation
///////////////////////////////////////////////////////
+
+
result
AppWidgetManagerService::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument)
{
- SysLog(NID_SHELL, "%ls, %ls", appId.GetPointer(), providerName.GetPointer() );
-
bool found = false;
+ bool updateAllSuspended = appId.IsEmpty();
+
for( int i = 0; i < __appWidgetContextList.GetCount(); i++ )
{
_AppWidgetContext* pAppWidgetContext = null;
__appWidgetContextList.GetAt(i, pAppWidgetContext);
+ SysAssertf(pAppWidgetContext, "pAppWidgetContext is null!");
- if ( pAppWidgetContext->GetAppId() == appId && pAppWidgetContext->GetProviderName() == providerName)
+ if ( (updateAllSuspended == true && AppManager::GetInstance()->IsRunning(appId) == false )
+ || ( pAppWidgetContext->GetAppId() == appId && pAppWidgetContext->GetProviderName() == providerName ) )
{
ArrayList* pArray = new (std::nothrow) ArrayList();
SysTryReturnResult(NID_SHELL, pArray, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
result r = __handlerThread.SendUserEvent(LOCAL_EVENT_REQUEST_UPDATE, pArray);
SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Propagated.", GetErrorMessage(r));
+ SysLog(NID_SHELL, "UserEvent(%d) is sent for '%ls.%ls'.", LOCAL_EVENT_REQUEST_UPDATE, pAppWidgetContext->GetAppId().GetPointer(), pAppWidgetContext->GetProviderName().GetPointer() );
found = true;
}
}