The Shell library of OSP (DEV)
%package internal-devel
-Summary: osp shell internel (Internal)
+Summary: osp shell internal (Internal)
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Requires: %{name}-devel
result
AppWidgetProviderManager::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument)
{
- SysLog(NID_SHELL, "Enter.");
+ SysLog(NID_SHELL, "Invoked");
return __pAppWidgetProviderManagerImpl->RequestUpdate(appId, providerName, argument);
}
#include <FShellIAppWidgetPopupProviderFactory.h>
#include <FShell_IAppWidgetTouchEventListener.h>
-#include <FShell_TemplateUtil.h>
#include <FAppPkg_PackageManagerImpl.h>
#include "FShell_ShortcutManagerImpl.h"
// c - style callback for shortcut_set_request_cb
int AppWidgetRequestHandlerCallback(const char* providerId, const char* text, int type, const char* content_info, const char* icon, int pid, double period, int allowDuplication, void *data)
{
- SysLog(NID_SHELL, "Enter");
+ SysLog(NID_SHELL, "Called");
SysTryReturn(NID_SHELL, providerId, 0, E_SYSTEM, "[E_SYSTEM] providerId is null!");
_AppWidgetManagerImpl* pAppWidgetManager = static_cast<_AppWidgetManagerImpl*>(data);
result
_AppWidgetManagerProxy::ReleaseRemoteBuffer(const Tizen::Base::String& instanceId)
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
- SysLog(NID_SHELL, "");
-
- result ret = E_FAILURE;
- std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppWidgetManager_ReleaseRemoteBuffer(instanceId, &ret));
- result r = __pIpcClient->SendRequest(*pMsg.get());
- SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "SendRequest failed.");
+// SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
+// SysLog(NID_SHELL, "");
+//
+// result ret = E_FAILURE;
+// std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppWidgetManager_ReleaseRemoteBuffer(instanceId, &ret));
+// result r = __pIpcClient->SendRequest(*pMsg.get());
+// SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "SendRequest failed.");
return E_SUCCESS;
}
result
_AppWidgetManagerProxy::ReleaseRemoteBufferForPD(const Tizen::Base::String& instanceId)
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
- SysLog(NID_SHELL, "");
-
- result ret = E_FAILURE;
- std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppWidgetManager_ReleaseRemoteBufferForPD(instanceId, &ret));
- result r = __pIpcClient->SendRequest(*pMsg.get());
- SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "SendRequest failed.");
- return E_SUCCESS;
-}
-
-result
-_AppWidgetManagerProxy::RequestProviderCount(const Tizen::Base::String& instanceId, int &count)
-{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
- SysLog(NID_SHELL, "");
-
- std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppWidgetManager_RequestProviderCount(instanceId, &count));
- result r = __pIpcClient->SendRequest(*pMsg.get());
- SysTryReturnResult(NID_SHELL, !IsFailed(r), r, "SendRequest failed.");
-
+// SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
+// SysLog(NID_SHELL, "");
+//
+// result ret = E_FAILURE;
+// std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppWidgetManager_ReleaseRemoteBufferForPD(instanceId, &ret));
+// result r = __pIpcClient->SendRequest(*pMsg.get());
+// SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "SendRequest failed.");
return E_SUCCESS;
}
result
-_AppWidgetManagerProxy::SendResult(const Tizen::Base::String& instanceId, bool isSucceeded)
+_AppWidgetManagerProxy::SendResponse(const Tizen::Base::String& instanceId, bool isSucceeded)
{
SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
SysLog(NID_SHELL, "");
- std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppWidgetManager_SendResult(instanceId, isSucceeded));
+ std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppWidgetManager_SendResponse(instanceId, isSucceeded));
result r = __pIpcClient->SendRequest(*pMsg.get());
SysTryReturnResult(NID_SHELL, !IsFailed(r), r, "SendRequest failed.");
_AppWidgetManagerProxy::OnIpcResponseReceived(_IpcClient& client, const IPC::Message& message)
{
SysLog(NID_SHELL, "Enter.");
-// SysAssertf(__pAppWidgetServiceRequestListener, "__pAppWidgetServiceRequestListener should not be null!"
IPC_BEGIN_MESSAGE_MAP(_AppWidgetManagerProxy, message)
IPC_MESSAGE_HANDLER_EX(AppWidgetManager_SendAppWidgetEvent, &client, OnAppWidgetServiceRequestReceived)
#include <FShellIAppWidgetProviderFactory.h>
#include <FShellIAppWidgetPopupProviderFactory.h>
-#include <FShell_TemplateUtil.h>
+#include <FApp_TemplateUtil.h>
#include <FShell_PackageManagerUtil.h>
#include <FShell_IAppWidgetTouchEventListener.h>
#include "FShell_AppWidgetManagerProxy.h"
{
SysLogException(NID_SHELL, E_INVALID_OPERATION, "The application's attribute does not meet the condition to provide AppWidget. 'LifeDuration' and 'UseUi' attribute should be specified in application manifest and it's not allowed that declaring 'AUTO_RESTART' attribute for AppWidget.");
- r = SendResult(INVALID_INSTANCE, false);
+ r = SendResponse(INVALID_INSTANCE, false);
SysTryLog(NID_SHELL, !IsFailed(r), "Because the context for this dynamic box is removed, POLLRDHUP occurs.");
return E_INVALID_OPERATION;
{
SysLogException(NID_SHELL, E_INVALID_OPERATION, "The application's attribute does not meet the condition to provide AppWidget. 'LifeDuration' and 'UseUi' attribute should be specified in application manifest and it's not allowed that declaring 'AUTO_RESTART' attribute for AppWidget.");
- r = SendResult(INVALID_INSTANCE, false);
+ r = SendResponse(INVALID_INSTANCE, false);
SysTryLog(NID_SHELL, !IsFailed(r), "Because the context for this dynamic box is removed, POLLRDHUP occurs.");
return E_INVALID_OPERATION;
result
_AppWidgetProviderManagerImpl::RequestUpdate(const AppId& appId, const String& providerName, const String& argument)
{
- SysLog(NID_SHELL, "Enter.");
SysTryReturnResult(NID_SHELL, _Aul::IsInstalled(appId) == true, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer());
result r = _PackageManagerUtil::CompareCertification(Tizen::App::App::GetInstance()->GetAppId(), appId);
{
SysLog(NID_SHELL, "Failed to update.");
- result r = SendResult(instanceId, false);
+ result r = SendResponse(instanceId, false);
SysTryLog(NID_SHELL, !IsFailed(r), "Failed to send the result.");
return E_SYSTEM;
{
SysSecureLog(NID_SHELL, "instanceId(%ls), w:%f, h:%f, argument:%ls", instanceId.GetPointer(), width, height, argument.GetPointer());
- AppWidgetProvider* pAppWidget = null;
- __appwidgetProviders.GetValue(instanceId, pAppWidget);
- SysTryReturnResult(NID_SHELL, pAppWidget, E_SYSTEM, "Can't find the AppWidget provider");
+ AppWidgetProvider* pAppWidgetProvider = null;
+ __appwidgetProviders.GetValue(instanceId, pAppWidgetProvider);
+ SysTryReturnResult(NID_SHELL, pAppWidgetProvider, E_SYSTEM, "Can't find the AppWidget provider");
- bool ret = pAppWidget->OnAppWidgetProviderUpdating(argument);
+ bool ret = pAppWidgetProvider->OnAppWidgetProviderUpdating(argument);
SysTryReturnResult(NID_SHELL, ret == true, E_OPERATION_CANCELED, "OnAppWidgetProviderUpdating returns 'false'. The provider will be removed.");
return E_SUCCESS;
}
CATCH:
+ bool isSuccessed = true;
+
if (r == E_OPERATION_CANCELED)
{
- SysLog(NID_SHELL, "[E_OPERATION_CANCELED] user code returned 'false' in virtual method for this operation.");
- SendResult(instanceId, false);
+ SysLog(NID_SHELL, "[E_OPERATION_CANCELED] user code returned 'false' in virtual method for the operation(%ls).", operationId.GetPointer());
+
+ isSuccessed = false;
if (operationId == APPWIDGET_ON_UPDATE)
{
- SysTryLog(NID_SHELL, !IsFailed(r), "Failed to get the count of a provider.");
RemoveAppWidget(instanceId);
}
-
- return r;
- }
- else
- {
- SendResult(instanceId, true);
}
+
+ SendResponse(instanceId, isSuccessed);
#endif// HANDLE_MESSAGE_BY_EVENT
SysLog(NID_SHELL, "Exit");
}
result
-_AppWidgetServiceRequestDispatcher::RequestProviderCount(const String& instanceId, int& providerCount)
-{
- _AppWidgetManagerProxy* pProxy = _AppWidgetManagerProxy::GetInstance();
- SysTryReturnResult(NID_SHELL, pProxy, E_SYSTEM, "Failed to get proxy instance!");
-
- return pProxy->RequestProviderCount(instanceId, providerCount);
-}
-
-result
-_AppWidgetServiceRequestDispatcher::SendResult(const String& instanceId, bool isSucceeded)
+_AppWidgetServiceRequestDispatcher::SendResponse(const String& instanceId, bool isSucceeded)
{
SysLog(NID_SHELL, "%s", isSucceeded ? "true":"false");
_AppWidgetManagerProxy* pProxy = _AppWidgetManagerProxy::GetInstance();
SysTryReturnResult(NID_SHELL, pProxy, E_SYSTEM, "Failed to get proxy instance!");
- return pProxy->SendResult(instanceId, isSucceeded);
+ return pProxy->SendResponse(instanceId, isSucceeded);
}
SysLog(NID_SHELL, "E_OPERATION_CANCELED");
if (operationId == APPWIDGET_ON_UPDATE)
{
- int count = 0;
- result r = RequestProviderCount(*pInstanceId, count);
- SysTryLog(NID_SHELL, !IsFailed(r), "Failed to get the count of a provider.");
RemoveAppWidget(*pInstanceId);
}
else
{
- SendResult(*pInstanceId, false);
+ SendResponse(*pInstanceId, false);
}
}
else
{
- SendResult(*pInstanceId, true);
+ SendResponse(*pInstanceId, true);
}
-// SendResult(*pInstanceId, (r == E_SUCCESS) ? true:false);
+// SendResponse(*pInstanceId, (r == E_SUCCESS) ? true:false);
}
}
{
SysTryReturnResult(NID_SHELL, badgeNumber <= MAX_NOTIFICATION_BADGE_NUMBER, E_INVALID_ARG,
"badgeNumber is greater than MAX_NOTIFICATION_BADGE_NUMBER.");
- SysTryReturnResult(NID_SHELL, launchArguments.GetLength() > 0 && launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
- "launchArguments is less than 1 or greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
NotificationRequest request;
request.SetAlertText(messageText);
result
_NotificationManagerImpl::NotifyOngoingActivityByAppId(const AppId& appId, const String& messageText, const String& launchArguments)
{
- SysTryReturnResult(NID_SHELL, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
- SysTryReturnResult(NID_SHELL, launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
- "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
-
NotificationRequest request;
request.SetAlertText(messageText);
request.SetAppMessage(launchArguments);
{
err = notification_delete(notiHandle);
SysLog(NID_SHELL, "Notification deleted.");
+ err = notification_free(notiHandle);
}
else
{
SysLog(NID_SHELL, "Notification already deleted.");
}
- err = notification_free(notiHandle);
}
else
{
{
err = notification_delete(notiHandle);
SysLog(NID_SHELL, "Notification deleted.");
+ err = notification_free(notiHandle);
}
else
{
SysLog(NID_SHELL, "Notification already deleted.");
}
- err = notification_free(notiHandle);
}
else
{
IPC_SYNC_MESSAGE_CONTROL1_1(AppWidgetManager_SyncRemoteBufferForPD, Tizen::Base::String, result)
IPC_SYNC_MESSAGE_CONTROL1_1(AppWidgetManager_ReleaseRemoteBuffer, Tizen::Base::String, result)
IPC_SYNC_MESSAGE_CONTROL1_1(AppWidgetManager_ReleaseRemoteBufferForPD, Tizen::Base::String, result)
-IPC_SYNC_MESSAGE_CONTROL1_1(AppWidgetManager_RequestProviderCount, Tizen::Base::String, int)
-IPC_MESSAGE_CONTROL2(AppWidgetManager_SendResult, Tizen::Base::String, bool)
+IPC_MESSAGE_CONTROL2(AppWidgetManager_SendResponse, Tizen::Base::String, bool)
IPC_MESSAGE_CONTROL2(AppWidgetManager_SendAccessStatus, Tizen::Base::String, int)
// Message from service
result SendAccessStatus(const Tizen::Base::String& instanceId, int accessStatus);
// response
- result SendResult(const Tizen::Base::String& instanceId, bool isSucceeded);
- result RequestProviderCount(const Tizen::Base::String& instanceId, int& providerCount);
+ result SendResponse(const Tizen::Base::String& instanceId, bool isSucceeded);
// Received messages from server
virtual result OnAppWidgetServiceRequestReceived(const Tizen::Base::String& instanceId, const Tizen::Base::String& operationId, const Tizen::Base::Collection::HashMap& args);
//#define HANDLE_MESSAGE_BY_EVENT
+
namespace Tizen { namespace Shell {
class IAppWidgetProviderFactory;
#endif
protected:
- result SendResult(const Tizen::Base::String& instanceId, bool isSucceeded);
- result RequestProviderCount(const Tizen::Base::String& instanceId, int& providerCount);
+ result SendResponse(const Tizen::Base::String& instanceId, bool isSucceeded);
private:
#ifdef HANDLE_MESSAGE_BY_EVENT
+++ /dev/null
-//
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file FShell_TemplateUtil.h
- * @brief This is the header file for the internal Tizen::Shell template utilities.
- */
-
-#ifndef FSHELL_INTERNAL_TEMPLATE_UTIL_H_
-#define FSHELL_INTERNAL_TEMPLATE_UTIL_H_
-
-
-#include <FBaseString.h>
-#include <FBaseColICollectionT.h>
-#include <FBaseColIEnumeratorT.h>
-
-namespace Tizen { namespace Shell
-{
-
-template<class Type> void
-_DeleteCollection(Tizen::Base::Collection::ICollectionT<Type*>& col)
-{
- Tizen::Base::Collection::IEnumeratorT<Type*>* pEnum = col.GetEnumeratorN();
-
- if (pEnum)
- {
- while (pEnum->MoveNext() == E_SUCCESS)
- {
- Type* pElem = null;
- pEnum->GetCurrent(pElem);
-
- delete pElem;
- }
-
- delete pEnum;
- }
-}
-
-template<class KeyType, class ValueType> void
-_DeleteCollectionMapValue(Tizen::Base::Collection::IMapT<KeyType, ValueType*>& col)
-{
- Tizen::Base::Collection::IMapEnumeratorT<KeyType, ValueType*>* pEnum = col.GetMapEnumeratorN();
-
- if (pEnum)
- {
- while (pEnum->MoveNext() == E_SUCCESS)
- {
- ValueType* pValue = null;
- pEnum->GetValue(pValue);
-
- delete pValue;
- }
-
- delete pEnum;
- }
-}
-
-template<class KeyType, class ValueType> void
-_DeleteCollectionMapValue(Tizen::Base::Collection::IMultiMapT<KeyType, ValueType*>& col)
-{
- Tizen::Base::Collection::IMapEnumeratorT<KeyType, ValueType*>* pEnum = col.GetMapEnumeratorN();
-
- if (pEnum)
- {
- while (pEnum->MoveNext() == E_SUCCESS)
- {
- ValueType* pValue = null;
- pEnum->GetValue(pValue);
-
- delete pValue;
- }
-
- delete pEnum;
- }
-}
-
-}} // Tizen::Shell
-
-
-namespace Tizen { namespace Base
-{
-
-namespace Collection
-{
-
-template <>
-class __HashMapDefaultProviderT<String>
-: public IHashCodeProviderT<String>
-, public Object
-{
- public:
- __HashMapDefaultProviderT(void) {}
-
- virtual ~__HashMapDefaultProviderT(void) {}
-
- virtual int GetHashCode(const String& obj) const
- {
- return obj.GetHashCode();
- }
-};
-
-template<>
-class __MultiHashMapDefaultProviderT<String>
-: public IHashCodeProviderT<String>
-, public Object
-{
- public:
- __MultiHashMapDefaultProviderT(void) {}
-
- virtual ~__MultiHashMapDefaultProviderT(void) {}
-
- virtual int GetHashCode(const String& obj) const
- {
- return obj.GetHashCode();
- }
-};
-
-
-} // Collection
-
-}} // Tizen::Base
-
-
-
-#endif // FSHELL_INTERNAL_TEMPLATE_UTIL_H_