*/
enum NotificationStyle
{
- NOTIFICATION_STYLE_MESSAGE_NORMAL = 1, /**< The notification is normal style */
- NOTIFICATION_STYLE_MESSAGE_IMAGE /**< The notification is image style */
+ NOTIFICATION_STYLE_NORMAL = 1, /**< The notification is normal style */
+ NOTIFICATION_STYLE_THUMBNAIL /**< The notification is thumbnail style */
};
*
* @since 2.0
*
- * @privlevel partner
- * @privilege http://tizen.org/privilege/notificationmanager
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/notification
*
* @return An error code
* @param[in] appId The application ID
*
* @since 2.0
*
- * @privlevel partner
- * @privilege http://tizen.org/privilege/notificationmanager
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/notification
*
* @return An error code
* @param[in] appId The application ID
*
* @since 2.0
*
- * @privlevel partner
- * @privilege http://tizen.org/privilege/notificationmanager
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/notification
*
* @return An error code
* @param[in] appId The application ID
*
* @since 2.0
*
- * @privlevel partner
- * @privilege http://tizen.org/privilege/notificationmanager
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/notification
*
* @return An error code
* @param[in] appId The application ID
*/
result SetOngoingActivityProgress(int value);
+ /**
+ * Gets the style of a notification message.
+ *
+ * @since 2.1
+ *
+ * @return The notification style
+ */
+ NotificationStyle GetNotificationStyle(void) const;
+
+ /**
+ * Sets the style of a notification message.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] style The notification style
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified @c style is not valid.
+ */
+ result SetNotificationStyle(NotificationStyle style);
+
+ /**
+ * Gets a list of message text for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return A string list of detail information text
+ */
+ Tizen::Base::Collection::IList* GetMessageTextListN(void) const;
+
+ /**
+ * Sets a string list of message text for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] pTextList A list of detail information text
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified @c textList is empty or the length of individual text is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH.
+ * @remarks This information is only meaningful when the notification style is Shell::NOTIFICATION_STYLE_NORMAL. @n
+ * Use the tab(\\t) character to separate the columns.
+ *
+ */
+ result SetMessageTextList(const Tizen::Base::Collection::IList* pTextList);
+
+ /**
+ * Gets a list of the message thumbnail image absolute file path for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return A string list of thumbnail image file path
+ */
+ Tizen::Base::Collection::IList* GetMessageThumbnailFilePathListN(void) const;
+
+ /**
+ * Sets a string list of the message thumbnail image absolute file path for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] pThumbnailPathList A list of the thumbnail image file path
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified path is invalid.
+ * @remarks This information is only meaningful when then notification style is Shell::NOTIFICATION_STYLE_THUMBNAIL.
+ */
+ result SetMessageThumbnailFilePathList(const Tizen::Base::Collection::IList* pThumbnailPathList);
+
+ /**
+ * Gets the notification count text of a notification message.
+ *
+ * @since 2.1
+ *
+ * @return The notification count text
+ */
+ Tizen::Base::String GetNotificationCountText(void) const;
+
+ /**
+ * Sets the notification count text of a notification message.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] notificationCountText The event count text
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified @c eventCountText is empty or the length of @c eventCountText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH.
+ */
+ result SetNotificationCountText(const Tizen::Base::String& notificationCountText);
+
+ /**
+ * Gets the absolute file path of the background image for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return The file path of a background image file
+ */
+ Tizen::Base::String GetBackgroundImageFilePath(void) const;
+
+ /**
+ * Sets the absolute file path of the background image for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] imagePath The file path of the background image
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified path is invalid.
+ */
+ result SetBackgroundImageFilePath(const Tizen::Base::String& imagePath);
+
+
private:
- class _NotificationRequestImpl * __pNotificationRequestImpl;
+ class _NotificationRequestImpl* __pNotificationRequestImpl;
friend class _NotificationRequestImpl;
}; // NotificationRequest
FShell_NotificationManagerImpl.cpp
FShellNotificationRequest.cpp
FShell_NotificationRequestImpl.cpp
- FShell_NotificationManagerProxy.cpp
- FShell_NotificationManagerIpcMessages.cpp
FShellShortcutManager.cpp
FShell_ShortcutManagerImpl.cpp
FShellLockManager.cpp
{
SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
- result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATIONMANAGER);
+ result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION, _PRV_NOTIFICATIONMANAGER);
SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
return __pNotificationManagerImpl->NotifyMessageImpl(appId, notiMessage);
{
SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
- result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATIONMANAGER);
+ result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION, _PRV_NOTIFICATIONMANAGER);
SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
return __pNotificationManagerImpl->NotifyMessageImpl(appId, notiMessage, true);
{
SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
- result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATIONMANAGER);
+ result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION, _PRV_NOTIFICATIONMANAGER);
SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
return __pNotificationManagerImpl->RemoveOngoingActivityNotificationByAppId(appId);
{
SysAssertf(__pNotificationManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
- result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATIONMANAGER);
+ result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION, _PRV_NOTIFICATIONMANAGER);
SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
return __pNotificationManagerImpl->RemoveNotificationByAppId(appId);
}
NotificationRequest::NotificationRequest(const NotificationRequest& rhs)
+ : __pNotificationRequestImpl(null)
{
__pNotificationRequestImpl = new (std::nothrow) _NotificationRequestImpl(*rhs.__pNotificationRequestImpl);
SysTryReturnVoidResult(NID_APP, __pNotificationRequestImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
return __pNotificationRequestImpl->SetOngoingActivityProgress(progressValue);
}
-};
-}; // Tizen::Shell
+
+NotificationStyle
+NotificationRequest::GetNotificationStyle(void) const
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+ return __pNotificationRequestImpl->GetNotificationStyle();
+}
+
+result
+NotificationRequest::SetNotificationStyle(NotificationStyle style)
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+ return __pNotificationRequestImpl->SetNotificationStyle(style);
+}
+
+
+Tizen::Base::Collection::IList*
+NotificationRequest::GetMessageTextListN(void) const
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+ return __pNotificationRequestImpl->GetMessageTextListN();
+}
+
+
+result
+NotificationRequest::SetMessageTextList(const Tizen::Base::Collection::IList* pTextList)
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+ return __pNotificationRequestImpl->SetMessageTextList(pTextList);
+}
+
+
+Tizen::Base::Collection::IList*
+NotificationRequest::GetMessageThumbnailFilePathListN(void) const
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+ return __pNotificationRequestImpl->GetMessageThumbnailFilePathListN();
+}
+
+
+result
+NotificationRequest::SetMessageThumbnailFilePathList(const Tizen::Base::Collection::IList* pThumbnailPathList)
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+ return __pNotificationRequestImpl->SetMessageThumbnailFilePathList(pThumbnailPathList);
+}
+
+
+Tizen::Base::String
+NotificationRequest::GetNotificationCountText(void) const
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+ return __pNotificationRequestImpl->GetNotificationCountText();
+}
+
+
+result
+NotificationRequest::SetNotificationCountText(const Tizen::Base::String& notificationCountText)
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+ return __pNotificationRequestImpl->SetNotificationCountText(notificationCountText);
+}
+
+
+Tizen::Base::String
+NotificationRequest::GetBackgroundImageFilePath(void) const
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+ return __pNotificationRequestImpl->GetBackgroundImageFilePath();
+}
+
+
+result
+NotificationRequest::SetBackgroundImageFilePath(const Tizen::Base::String& imagePath)
+{
+ SysAssertf(__pNotificationRequestImpl != null, "Instance is not constructed properly.");
+ return __pNotificationRequestImpl->SetBackgroundImageFilePath(imagePath);
+}
+
+} } // Tizen::Shell
#include "FIoFile.h"
#include "FAppPkg_PackageManagerImpl.h"
#include "FApp_AppArg.h"
-#include "FShell_NotificationManagerImpl.h"
-#include "FShell_NotificationManagerProxy.h"
#include "FAppPkgPackageAppInfo.h"
#include "FAppPkg_PackageAppInfoImpl.h"
+#include "FShell_NotificationManagerImpl.h"
+#include "FShell_NotificationRequestImpl.h"
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
using namespace Tizen::App;
using namespace Tizen::App::Package;
using namespace Tizen::Io;
{
_NotificationManagerImpl::_NotificationManagerImpl(void)
- : __pNotificationManagerProxy(null)
- , __notifyPrivitId(-1)
+ : __notifyPrivitId(-1)
, __notifyPrivitIdForOngoing(-1)
{
}
_NotificationManagerImpl::NotifyMessageImpl(const AppId& appId, const NotificationRequest& notiMessage, bool isOngoing)
{
return NotifyMessage(NOTIFY_TYPE_APP_ID, isOngoing, notiMessage, &appId);
- // No more partner, no need to use IPC.
- //return __pNotificationManagerProxy->NotifyMessage(appId, notiMessage, isOngoing);
}
_NotificationManagerImpl::RemoveOngoingActivityNotificationByAppId(const AppId& appId)
{
return RemoveNotificationByAppId(appId, true);
- // No more partner, no need to use IPC.
- //return __pNotificationManagerProxy->RemoveNotification(appId, true);
}
_NotificationManagerImpl::RemoveNotificationByAppId(const AppId& appId)
{
return RemoveNotificationByAppId(appId, false);
-
- // No more partner, no need to use IPC.
- //return __pNotificationManagerProxy->RemoveNotification(appId,false);
}
result
{
result r = E_SUCCESS;
std::unique_ptr<char[]> pAppIdChar(null);
+ const _NotificationRequestImpl* pRequestImpl = _NotificationRequestImpl::GetInstance(notifyRequest);
+ SysTryReturnResult(NID_APP, pRequestImpl != null, E_INVALID_ARG, "Invalid argument is used.");
// Set pAppIdChar
if ((notifyType == NOTIFY_TYPE_SIMPLE) || (notifyType == NOTIFY_TYPE_APP_CONTROL))
{
-// // Below code not working for service appication context. So app_get_id API should be use for resolve this issue.
// char* pkgname = null;
// app_get_id(&pkgname); // AppId. (Not package Id)
// SysTryReturnResult(NID_APP, pkgname != NULL, E_OBJ_NOT_FOUND,"Cannot acquire package name for current application.");
bundle* service_data = null;
_AppArg arg;
service_h hSvc = null;
- notification_ly_type_e layout= NOTIFICATION_LY_NOTI_EVENT_SINGLE;
+ notification_ly_type_e layout = NOTIFICATION_LY_NOTI_EVENT_SINGLE;
// Notification creation
if (notiPrivateId != -1)
notiPrivateId = -1; // reset
notiHandle = notification_create(notiType);
}
+ else
+ {
+ needUpdate = true; // No need to notification_insert.
+ }
SysTryReturnResult(NID_APP, notiHandle != null , E_SYSTEM, "A system error has been occurred. Notification creation/load failed ");
// Content text(Alert text)
r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_USER_DATA, pSoundPath.get()));
SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set sound failed.", GetErrorMessage(r));
+ // Set extended - text, thumbnail and background image
+ if (!isOngoing)
+ {
+ // Extended style set
+ String countText = notifyRequest.GetNotificationCountText();
+ NotificationStyle notiStyle= notifyRequest.GetNotificationStyle();
+ if (notiStyle == NOTIFICATION_STYLE_THUMBNAIL)
+ {
+ layout = NOTIFICATION_LY_NOTI_THUMBNAIL;
+ }
+ else
+ if (notiStyle == NOTIFICATION_STYLE_NORMAL && !countText.IsEmpty())
+ {
+ layout = NOTIFICATION_LY_NOTI_EVENT_MULTIPLE;
+ }
+
+ if (!countText.IsEmpty())
+ {
+ std::unique_ptr<char[]> text(_StringConverter::CopyToCharArrayN(countText));
+ r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, text.get(),
+ NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+ }
+
+ String bgImageFilePath = notifyRequest.GetBackgroundImageFilePath();
+ if (!bgImageFilePath.IsEmpty() && File::IsFileExist(bgImageFilePath))
+ {
+ std::unique_ptr<char[]> pBgImageFilePath(_StringConverter::CopyToCharArrayN(bgImageFilePath));
+ r = ConvertNotificationResult(notification_set_image(notiHandle, NOTIFICATION_IMAGE_TYPE_BACKGROUND, pBgImageFilePath.get()));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set Background image path failed.", GetErrorMessage(r));
+ }
+
+
+ if (notiStyle == NOTIFICATION_STYLE_THUMBNAIL)
+ {
+ const IList* pThumbnailList = pRequestImpl->GetMessageThumbnailFilePathList();
+ if (pThumbnailList)
+ {
+ const static notification_image_type_e thumbnailListEnum[] = {NOTIFICATION_IMAGE_TYPE_LIST_1, NOTIFICATION_IMAGE_TYPE_LIST_2,
+ NOTIFICATION_IMAGE_TYPE_LIST_3, NOTIFICATION_IMAGE_TYPE_LIST_4, NOTIFICATION_IMAGE_TYPE_LIST_5 };
+ int itemCount = pThumbnailList->GetCount();
+ const int maxCount = sizeof(thumbnailListEnum)/sizeof(thumbnailListEnum[0]);
+ if (itemCount > maxCount)
+ {
+ itemCount = maxCount;
+ }
+ for (int i = 0; i < itemCount; i++)
+ {
+ const String* pThumbnailPath = static_cast<const String*>(pThumbnailList->GetAt(i));
+ // TODO: check pThumbnailPath
+ std::unique_ptr<char[]> filePath(_StringConverter::CopyToCharArrayN(*pThumbnailPath));
+ r = ConvertNotificationResult(notification_set_image(notiHandle, thumbnailListEnum[i], filePath.get()));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set thumnail path failed.", GetErrorMessage(r));
+ }
+ }
+ }
+ else
+ {
+ // TODO: Check the valid
+ const IList* pMessageTextList = pRequestImpl->GetMessageTextList();
+ if (pMessageTextList && pMessageTextList->GetCount())
+ {
+ const String* pText1 = static_cast<const String*>(pMessageTextList->GetAt(0));
+ if (pText1)
+ {
+ int matchIndex;
+ if (E_SUCCESS == pText1->IndexOf(L'\t', 0, matchIndex))
+ {
+ // Make two token
+ String subText;
+ pText1->SubString(0, matchIndex+1, subText);
+ std::unique_ptr<char[]> leftText(_StringConverter::CopyToCharArrayN(subText));
+ r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_1, leftText.get(),
+ NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set Info1 Text failed.", GetErrorMessage(r));
+ subText.Clear();
+ if (E_SUCCESS == pText1->SubString(matchIndex+1, subText))
+ {
+ std::unique_ptr<char[]> rightText(_StringConverter::CopyToCharArrayN(subText));
+ r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_SUB_1, rightText.get(),
+ NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set Info1 Sub Text failed.", GetErrorMessage(r));
+ }
+ }
+ else
+ {
+ std::unique_ptr<char[]> leftText(_StringConverter::CopyToCharArrayN(*pText1));
+ r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_1, leftText.get(),
+ NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set Info1 Text failed.", GetErrorMessage(r));
+ }
+ }
+ const String* pText2 = static_cast<const String*>(pMessageTextList->GetAt(1));
+ if (pText2)
+ {
+ int matchIndex;
+ // 2.1: Multiple layout has single line text for 2nd information text.
+ if ((layout == NOTIFICATION_LY_NOTI_EVENT_MULTIPLE && E_SUCCESS) == (pText2->IndexOf(L'\t', 0, matchIndex)))
+ {
+ // Make two token
+ String subText;
+ pText2->SubString(0, matchIndex+1, subText);
+ std::unique_ptr<char[]> leftText(_StringConverter::CopyToCharArrayN(subText));
+ r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_2, leftText.get(),
+ NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set Info1 Text failed.", GetErrorMessage(r));
+ subText.Clear();
+ if (E_SUCCESS == pText2->SubString(matchIndex+1, subText))
+ {
+ std::unique_ptr<char[]> rightText(_StringConverter::CopyToCharArrayN(subText));
+ r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_SUB_2, rightText.get(),
+ NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set Info1 Sub Text failed.", GetErrorMessage(r));
+ }
+ }
+ else
+ {
+ std::unique_ptr<char[]> leftText(_StringConverter::CopyToCharArrayN(*pText2));
+ r = ConvertNotificationResult(notification_set_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_2, leftText.get(),
+ NULL, NOTIFICATION_VARIABLE_TYPE_NONE));
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set Info1 Text failed.", GetErrorMessage(r));
+ }
+ }
+ }
+ else
+ if (needUpdate)
+ { // Reset text for update case. also must be check the previous text with get_text
+ char* pRetStr = null;
+ notification_get_text(notiHandle, NOTIFICATION_TEXT_TYPE_INFO_1, &pRetStr);
+ if (pRetStr)
+ {
+ const static notification_text_type_e infoTextEnums[] = { NOTIFICATION_TEXT_TYPE_INFO_1, NOTIFICATION_TEXT_TYPE_INFO_SUB_1,
+ NOTIFICATION_TEXT_TYPE_INFO_2, NOTIFICATION_TEXT_TYPE_INFO_SUB_2 };
+ for (unsigned int i = 0; i < sizeof(infoTextEnums)/sizeof(infoTextEnums[0]); i++)
+ {
+ notification_set_text(notiHandle, infoTextEnums[i], null, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+ }
+ }
+ }
+ }
+ }
// Set - service
r = arg.Construct(launchArguments);
if (notifyType == NOTIFY_TYPE_SIMPLE || notifyType == NOTIFY_TYPE_APP_ID)
{
- service_set_app_id(hSvc, pAppIdChar.get());
+ service_set_app_id(hSvc, pRequestImpl->IsAppBinding() ? pAppIdChar.get() : null);
}
else
if (notifyType == NOTIFY_TYPE_APP_CONTROL)
SysLog(NID_APP, "service_to_bundle failed");
}
- // insert for new notification / update for exist one.
- if (notiPrivateId == -1)
- { // new
- r = ConvertNotificationResult(notification_insert(notiHandle, ¬iPrivateId));
- SysLog(NID_APP, "Insert notification and get new notiPrivateId(%d)", notiPrivateId);
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
- if (isOngoing)
- {
- __notifyPrivitIdForOngoing = notiPrivateId;
- }
- else
- {
- __notifyPrivitId = notiPrivateId;
- }
- }
- else
- {
- needUpdate = true;
- }
-
// Set layout
if (isOngoing)
{
layout = NOTIFICATION_LY_ONGOING_PROGRESS;
}
}
- else
- {
- // TODO: check and set from noti type.
- }
notification_set_layout(notiHandle, layout);
// For ongoing
switch (activityType)
{
case ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE:
- r = ConvertNotificationResult(notification_update_progress(notiHandle, notiPrivateId, progress/100.));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
- r = ConvertNotificationResult(notification_update_content(notiHandle, notiPrivateId, pMsg.get()));
+ if (needUpdate)
+ {
+ r = ConvertNotificationResult(notification_update_progress(notiHandle, notiPrivateId, progress/100.));
+ }
+ else
+ {
+ r = ConvertNotificationResult(notification_set_progress(notiHandle, progress/100.));
+ }
SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
break;
case ONGOING_ACTIVITY_TYPE_PROGRESS_BYTE:
- r = ConvertNotificationResult(notification_update_size(notiHandle, notiPrivateId, progress));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
- r = ConvertNotificationResult(notification_update_content(notiHandle, notiPrivateId, pMsg.get()));
+ if (needUpdate)
+ {
+ r = ConvertNotificationResult(notification_update_size(notiHandle, notiPrivateId, progress));
+ }
+ else
+ {
+ r = ConvertNotificationResult(notification_set_size(notiHandle, progress));
+ }
SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
break;
case ONGOING_ACTIVITY_TYPE_TEXT:
- r = ConvertNotificationResult(notification_update_content(notiHandle, notiPrivateId, pMsg.get()));
- SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
+ // Do nothing
break;
default:
r = E_OPERATION_FAILED;
break;
}
+ if (needUpdate)
+ {
+ r = ConvertNotificationResult(notification_update_content(notiHandle, notiPrivateId, pMsg.get()));
+ }
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification update failure.", GetErrorMessage(r));
}
- // notification_update call on Non ongoing or Text type ongoing only.
- //if (needUpdate && !(isOngoing && (ONGOING_ACTIVITY_TYPE_TEXT != notifyRequest.GetOngoingActivityType())))
+ // insert for new notification
+ if (!needUpdate)
+ { // new
+ r = ConvertNotificationResult(notification_insert(notiHandle, ¬iPrivateId));
+ SysLog(NID_APP, "Insert notification and get new notiPrivateId(%d)", notiPrivateId);
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
+ if (isOngoing)
+ {
+ __notifyPrivitIdForOngoing = notiPrivateId;
+ }
+ else
+ {
+ __notifyPrivitId = notiPrivateId;
+ }
+ }
+
+ // notification_update just for non ongoing and text type ongoing only.
if (needUpdate && !isOngoing)
{
notification_update(notiHandle);
_NotificationManagerImpl::RemoveNotification(void)
{
return RemoveNotification(false);
-// result r = E_SUCCESS;
-// notification_error_e err = NOTIFICATION_ERROR_NONE;
-//
-// if (__notifyPrivitId != -1)
-// {
-// notification_h notiHandle = notification_load(null, __notifyPrivitId);
-// if (notiHandle)
-// {
-// notification_delete(notiHandle);
-// }
-// notification_free(notiHandle);
-// }
-// else
-// {
-// err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
-// }
-//
-// switch (err)
-// {
-// case NOTIFICATION_ERROR_NONE:
-// r = E_SUCCESS;
-// break;
-//
-// case NOTIFICATION_ERROR_INVALID_DATA:
-// r = E_INVALID_ARG;
-// break;
-//
-// default:
-// r = E_OPERATION_FAILED;
-// break;
-// }
-//
-// return r;
}
result
_NotificationManagerImpl::RemoveOngoingActivityNotification(void)
{
return RemoveNotification(true);
-// result r = E_SUCCESS;
-// notification_error_e err = NOTIFICATION_ERROR_NONE;
-//
-// if (__notifyPrivitIdForOngoing != -1)
-// {
-// notification_h notiHandle = notification_load(null, __notifyPrivitIdForOngoing);
-// if (notiHandle)
-// {
-// notification_delete(notiHandle);
-// }
-// notification_free(notiHandle);
-// }
-// else
-// {
-// err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_ONGOING);
-// }
-//
-// switch (err)
-// {
-// case NOTIFICATION_ERROR_NONE:
-// r = E_SUCCESS;
-// break;
-//
-// case NOTIFICATION_ERROR_INVALID_DATA:
-// r = E_INVALID_ARG;
-// break;
-//
-// default:
-// r = E_OPERATION_FAILED;
-// break;
-// }
-//
-// return r;
}
result
+++ /dev/null
-//
-// Open Service Platform
-// 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_NotificationManagerIpcMessages.cpp
- * @brief This file contains IPC message class generated by macros.
- */
-
-#define IPC_MESSAGE_IMPL
-#include "FShell_NotificationManagerIpcMessages.h"
-
-// Generate constructors.
-#include "ipc/struct_constructor_macros.h"
-#include "FShell_NotificationManagerIpcMessages.h"
-// Generate destructors.
-
-#include "ipc/struct_destructor_macros.h"
-#include "FShell_NotificationManagerIpcMessages.h"
-
-// Generate param traits write methods.
-#include "ipc/param_traits_write_macros.h"
-namespace IPC
-{
-#include "FShell_NotificationManagerIpcMessages.h"
-} // namespace IPC
-
-// Generate param traits read methods.
-#include "ipc/param_traits_read_macros.h"
-namespace IPC
-{
-#include "FShell_NotificationManagerIpcMessages.h"
-} // namespace IPC
+++ /dev/null
-//
-// Open Service Platform
-// 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_NotificationManagerProxy.cpp
- * @brief This is the implementation for the _NotificationManagerProxy.cpp class.
- */
-
-#include <new>
-#include <memory>
-
-#include <FAppTypes.h>
-#include <FBaseErrors.h>
-#include <FBaseSysLog.h>
-#include <FShellNotificationRequest.h>
-
-#include <FIo_IpcClient.h>
-
-#include "FShell_NotificationManagerIpcMessages.h"
-#include "FShell_NotificationManagerProxy.h"
-
-using namespace Tizen::Base;
-using namespace Tizen::App;
-
-namespace Tizen { namespace Shell
-{
-
-_NotificationManagerProxy::_NotificationManagerProxy(void)
- : __pIpcClient(null)
-{
-}
-
-_NotificationManagerProxy::~_NotificationManagerProxy(void)
-{
-}
-
-result
-_NotificationManagerProxy::Construct()
-{
- __pIpcClient = new (std::nothrow) Tizen::Io::_IpcClient();
- SysTryReturnResult(NID_APP, __pIpcClient != null, E_OUT_OF_MEMORY, "_IpcClient creation failed.");
-
- result r = __pIpcClient->Construct("osp.app.ipcserver.notificationmanager");
- SysTryReturn(NID_APP, !IsFailed(r), r, r, "_IpcClient constructing failed [%s].", GetErrorMessage(r));
-
- return E_SUCCESS;
-}
-
-result
-_NotificationManagerProxy::NotifyMessage(const AppId& appId, const NotificationRequest& notiMessage, bool Ongoing)
-{
- SysTryReturnResult(NID_APP, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
-
- result response = E_SUCCESS;
- std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) NotificationManager_NotifyMessage(appId, notiMessage, Ongoing, &response));
- result r = __pIpcClient->SendRequest(*pMsg.get());
-
- SysTryReturn(NID_APP, !IsFailed(r), r, r, "__pIpcClient->SendRequest is failed. (%s)", GetErrorMessage(r));
-
- return response;
-}
-
-result
-_NotificationManagerProxy::RemoveNotification(const AppId& appId, bool Ongoing)
-{
- SysTryReturnResult(NID_APP, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
-
- result response = E_SUCCESS;
- std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) NotificationManager_RemoveNotification(appId, Ongoing, &response));
- result r = __pIpcClient->SendRequest(*pMsg.get());
-
- SysTryReturn(NID_APP, !IsFailed(r), r, r, "__pIpcClient->SendRequest is failed. (%s)", GetErrorMessage(r));
-
- return response;
-}
-
-} } // Tizen::Shell
* @brief This is the placeholder for _NotificationRequestImpl class.
*/
+#include <new>
+#include <unique_ptr.h>
#include <FBaseBoolean.h>
#include <FBaseInteger.h>
#include <FBaseSysLog.h>
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
using namespace Tizen::Io;
namespace Tizen { namespace Shell
{
_NotificationRequestImpl::_NotificationRequestImpl(bool appBinding)
- : __appBinding(true)
+ : __appBinding(appBinding)
, __badgeNumber(-1)
, __badgeOffset(0)
, __progressValue(-1)
, __activityType(ONGOING_ACTIVITY_TYPE_TEXT)
+ , __notificationStyle(NOTIFICATION_STYLE_NORMAL)
+ , __pTextList(null)
+ , __pThumbnailPathList(null)
{
}
, __titleText(notificationMessage.__titleText)
, __iconFilePath(notificationMessage.__iconFilePath)
, __soundFilePath(notificationMessage.__soundFilePath)
+ , __notificationStyle(notificationMessage.__notificationStyle)
+ , __pTextList(notificationMessage.__pTextList)
+ , __pThumbnailPathList(notificationMessage.__pThumbnailPathList)
+ , __notificationCountText(notificationMessage.__notificationCountText)
+ , __backgroundImagePath(notificationMessage.__backgroundImagePath)
{
}
__titleText = notificationMessage.__titleText;
__iconFilePath = notificationMessage.__iconFilePath;
__soundFilePath = notificationMessage.__soundFilePath;
+
+ __notificationStyle = notificationMessage.__notificationStyle;
+ __pTextList = notificationMessage.__pTextList;
+ __pThumbnailPathList = notificationMessage.__pThumbnailPathList;
+ __notificationCountText = notificationMessage.__notificationCountText;
+ __backgroundImagePath = notificationMessage.__backgroundImagePath;
}
return *this;
}
return false;
}
- if (__soundFilePath != __soundFilePath)
+ if (__soundFilePath != pMsgImpl->__soundFilePath)
+ {
+ return false;
+ }
+
+ if (__notificationStyle != pMsgImpl->__notificationStyle)
+ {
+ return false;
+ }
+ if (__pTextList != pMsgImpl->__pTextList)
+ {
+ return false;
+ }
+ if (__pThumbnailPathList != pMsgImpl->__pThumbnailPathList)
+ {
+ return false;
+ }
+ if (__notificationCountText != pMsgImpl->__notificationCountText)
+ {
+ return false;
+ }
+ if (__backgroundImagePath != pMsgImpl->__backgroundImagePath)
{
return false;
}
^ __appMessage.GetHashCode()
^ __titleText.GetHashCode()
^ __iconFilePath.GetHashCode()
- ^ __soundFilePath.GetHashCode();
+ ^ __soundFilePath.GetHashCode()
+ ^ Integer(__notificationStyle).GetHashCode()
+ ^ reinterpret_cast<int>(__pTextList)
+ ^ reinterpret_cast<int>(__pThumbnailPathList)
+ ^ __notificationCountText.GetHashCode()
+ ^ __backgroundImagePath.GetHashCode()
+ ;
}
int
{
result r = E_SUCCESS;
SysTryReturnResult(NID_APP, badgeNumber >= 0 && badgeNumber <= MAX_NOTIFICATION_BADGE_NUMBER, E_INVALID_ARG,
- "BadgeNumber is less than 0 or greater than MAX_NOTIFICATION_BADGE_NUMBER.");
+ "BadgeNumber is less than 0 or greater than MAX_NOTIFICATION_BADGE_NUMBER.");
__badgeOffset = 0;
__badgeNumber = badgeNumber;
{
result r = E_SUCCESS;
SysTryReturnResult(NID_APP, badgeOffset >= 0 && badgeOffset <= MAX_NOTIFICATION_BADGE_NUMBER, E_INVALID_ARG,
- "BadgeOffset is less than 0 or greater than MAX_NOTIFICATION_BADGE_NUMBER.");
+ "BadgeOffset is less than 0 or greater than MAX_NOTIFICATION_BADGE_NUMBER.");
__badgeNumber = -1;
__badgeOffset = badgeOffset;
result
_NotificationRequestImpl::SetAlertText(const String& alertText)
{
- result r = E_SUCCESS;
SysTryReturnResult(NID_APP, alertText.GetLength() > 0 && alertText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "AlertText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ "AlertText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
__alertText = alertText;
- return r;
+ return E_SUCCESS;
}
String
result
_NotificationRequestImpl::SetAppMessage(const String& appMessage)
{
- result r = E_SUCCESS;
SysTryReturnResult(NID_APP, appMessage.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "AppMessage is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ "AppMessage is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
SysTryReturnResult(NID_APP, __appBinding, E_INVALID_OPERATION,
- "The Notification instance is not bound to Application");
+ "The Notification instance is not bound to Application");
__appMessage = appMessage;
- return r;
+ return E_SUCCESS;
}
String
result
_NotificationRequestImpl::SetTitleText(const String& titleText)
{
- result r = E_SUCCESS;
SysTryReturnResult(NID_APP, titleText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
- "TitleText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ "TitleText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
__titleText = titleText;
- return r;
+ return E_SUCCESS;
}
String
result
_NotificationRequestImpl::SetIconFilePath(const String& iconFilePath)
{
- result r = E_SUCCESS;
- bool isExist = false;
-
- isExist = File::IsFileExist(iconFilePath);
- SysTryReturnResult(NID_APP, isExist, E_INVALID_ARG,"The Specified File is Invalid");
+ bool isExist = File::IsFileExist(iconFilePath);
+ SysTryReturnResult(NID_APP, isExist, E_INVALID_ARG, "The Specified File is Invalid");
__iconFilePath = iconFilePath;
- return r;
+ return E_SUCCESS;
}
String
result
_NotificationRequestImpl::SetSoundFilePath(const String& soundFilePath)
{
- result r = E_SUCCESS;
- bool isExist = false;
-
- isExist = File::IsFileExist(soundFilePath);
- SysTryReturnResult(NID_APP, isExist, E_INVALID_ARG,"The Specified File is Invalid");
+ bool isExist = File::IsFileExist(soundFilePath);
+ SysTryReturnResult(NID_APP, isExist, E_INVALID_ARG, "The Specified File is Invalid");
__soundFilePath = soundFilePath;
- return r;
+ return E_SUCCESS;
}
OngoingActivityType
result
_NotificationRequestImpl::SetOngoingActivityType(OngoingActivityType activityType)
{
- result r = E_SUCCESS;
-
// to prevent weired gcc optimization for enum type
int type = static_cast<int>(activityType);
{
case ONGOING_ACTIVITY_TYPE_TEXT:
break;
+
case ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE:
- SysTryReturnResult(NID_APP, __progressValue == -1 || (__progressValue >= 0 && __progressValue <= 100), E_INVALID_STATE, "Incompatible progress value %d.", __progressValue);
+ SysTryReturnResult(NID_APP, __progressValue == -1 || (__progressValue >= 0 && __progressValue <= 100),
+ E_INVALID_OPERATION, "Incompatible progress value %d.", __progressValue);
break;
+
case ONGOING_ACTIVITY_TYPE_PROGRESS_BYTE:
break;
+
default:
- SetLastResult(E_INVALID_STATE);
- SysLogException(NID_APP, E_INVALID_STATE, "Invalid activity type %d.", type);
- return E_INVALID_STATE;
+ SetLastResult(E_INVALID_OPERATION);
+ SysLogException(NID_APP, E_INVALID_OPERATION, "Invalid activity type %d.", type);
+ return E_INVALID_OPERATION;
}
__activityType = activityType;
- return r;
+ return E_SUCCESS;
}
int
result
_NotificationRequestImpl::SetOngoingActivityProgress(int progressValue)
{
- result r = E_SUCCESS;
- SysTryReturnResult(NID_APP, progressValue >= 0, E_INVALID_ARG,"The progress value is less than 0");
+ SysTryReturnResult(NID_APP, progressValue >= 0, E_INVALID_ARG, "The progress value is less than 0");
// use int type instead of OngoingActivityType to evade weired gcc optimization
int activitytype = static_cast<int>(GetOngoingActivityType());
SysTryReturnResult(NID_APP, activitytype >= ONGOING_ACTIVITY_TYPE_TEXT && activitytype <= ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE,
- E_INVALID_STATE,"Invalid activity Type %d.", activitytype);
+ E_INVALID_OPERATION,"Invalid activity Type %d.", activitytype);
if (activitytype == ONGOING_ACTIVITY_TYPE_PROGRESS_PERCENTAGE)
{
SysTryReturnResult(NID_APP, progressValue <= 100, E_INVALID_ARG,"Invalid Progress value");
}
__progressValue = progressValue;
- return r;
+ return E_SUCCESS;
}
bool
return __appBinding;
}
-};
-}; // Tizen::Shell
+
+NotificationStyle
+_NotificationRequestImpl::GetNotificationStyle(void) const
+{
+ return static_cast<NotificationStyle>(__notificationStyle);
+}
+
+result
+_NotificationRequestImpl::SetNotificationStyle(NotificationStyle style)
+{
+ SysTryReturnResult(NID_APP, NOTIFICATION_STYLE_NORMAL <= style && style <= NOTIFICATION_STYLE_THUMBNAIL,
+ E_INVALID_ARG,"Invalid NotificationStyle %d.", style);
+
+ __notificationStyle = style;
+ return E_SUCCESS;
+}
+
+Tizen::Base::Collection::IList*
+_NotificationRequestImpl::GetMessageTextListN(void) const
+{
+ std::unique_ptr<ArrayList> pStringList(new (std::nothrow) ArrayList);
+ SysTryReturn(NID_APP, pStringList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",
+ GetErrorMessage(E_OUT_OF_MEMORY));
+ pStringList->Construct();
+
+ if (__pTextList)
+ {
+ for (int i=0; i<__pTextList->GetCount(); i++)
+ {
+ std::unique_ptr<String> pString(new String(*static_cast<String*>(__pTextList->GetAt(i))));
+ SysTryReturn(NID_APP, pString != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",
+ GetErrorMessage(E_OUT_OF_MEMORY));
+ pStringList->Add(*pString.release());
+ }
+ }
+
+ return pStringList.release();
+}
+
+
+result
+_NotificationRequestImpl::SetMessageTextList(const Tizen::Base::Collection::IList* pTextList)
+{
+ __pTextList = const_cast<IList*>(pTextList);
+ if (__pTextList)
+ {
+ for (int i=0; i<__pTextList->GetCount(); i++)
+ {
+ String* pText = static_cast<String*>(__pTextList->GetAt(i));
+ if (pText)
+ {
+ SysTryReturnResult(NID_APP, pText->GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
+ "Invalid argument is used. MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ }
+ }
+ }
+
+ return E_SUCCESS;
+}
+
+
+Tizen::Base::Collection::IList*
+_NotificationRequestImpl::GetMessageThumbnailFilePathListN(void) const
+{
+ std::unique_ptr<ArrayList> pStringList(new (std::nothrow) ArrayList);
+ SysTryReturn(NID_APP, pStringList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",
+ GetErrorMessage(E_OUT_OF_MEMORY));
+ pStringList->Construct();
+
+ if (__pThumbnailPathList)
+ {
+ for (int i=0; i<__pThumbnailPathList->GetCount(); i++)
+ {
+ std::unique_ptr<String> pString(new String(*static_cast<String*>(__pThumbnailPathList->GetAt(i))));
+ SysTryReturn(NID_APP, pString != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",
+ GetErrorMessage(E_OUT_OF_MEMORY));
+ pStringList->Add(*pString.release());
+ }
+ }
+
+ return pStringList.release();
+}
+
+
+result
+_NotificationRequestImpl::SetMessageThumbnailFilePathList(const Tizen::Base::Collection::IList* pThumbnailPathList)
+{
+ __pThumbnailPathList = const_cast<IList*>(pThumbnailPathList);
+ if (__pThumbnailPathList)
+ {
+ for (int i=0; i<__pThumbnailPathList->GetCount(); i++)
+ {
+ String* pFilePath = static_cast<String*>(__pThumbnailPathList->GetAt(i));
+ if (pFilePath)
+ {
+ bool isExist = File::IsFileExist(*pFilePath);
+ SysTryReturnResult(NID_APP, isExist, E_INVALID_ARG,"Invalid argument is used. The Specified File path is Invalid.");
+ }
+ }
+ }
+
+ return E_SUCCESS;
+}
+
+
+Tizen::Base::String
+_NotificationRequestImpl::GetNotificationCountText(void) const
+{
+ return __notificationCountText;
+}
+
+
+result
+_NotificationRequestImpl::SetNotificationCountText(const Tizen::Base::String& notificationCountText)
+{
+ SysTryReturnResult(NID_APP, notificationCountText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
+ "Invalid argument is used. CountText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
+ __notificationCountText = notificationCountText;
+ return E_SUCCESS;
+}
+
+
+Tizen::Base::String
+_NotificationRequestImpl::GetBackgroundImageFilePath(void) const
+{
+ return __backgroundImagePath;
+}
+
+
+result
+_NotificationRequestImpl::SetBackgroundImageFilePath(const Tizen::Base::String& imagePath)
+{
+ bool fileExist = File::IsFileExist(imagePath);
+ SysTryReturnResult(NID_APP, fileExist, E_INVALID_ARG,
+ "Invalid argument is used. The Specified File is Invalid. %ls", imagePath.GetPointer());
+ __backgroundImagePath = imagePath;
+ return E_SUCCESS;
+}
+
+const Tizen::Base::Collection::IList*
+_NotificationRequestImpl::GetMessageTextList() const
+{
+ return __pTextList;
+}
+
+const Tizen::Base::Collection::IList*
+_NotificationRequestImpl::GetMessageThumbnailFilePathList() const
+{
+ return __pThumbnailPathList;
+}
+
+_NotificationRequestImpl*
+_NotificationRequestImpl::GetInstance(NotificationRequest& request)
+{
+ return request.__pNotificationRequestImpl;
+}
+
+const _NotificationRequestImpl*
+_NotificationRequestImpl::GetInstance(const NotificationRequest& request)
+{
+ return request.__pNotificationRequestImpl;
+}
+
+} } // Tizen::Shell
+++ /dev/null
-//
-// Open Service Platform
-// 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_NotificationManagerEventParamTraits.h
- * @brief This is the header file for NotificationManagerEvent param traits.
- */
-
-#ifndef _FSHELL_INTERNAL_NOTIFICATION_MANAGER_EVENT_ARG_PARAM_TRAITS_H_
-#define _FSHELL_INTERNAL_NOTIFICATION_MANAGER_EVENT_ARG_PARAM_TRAITS_H_
-
-#include "FBaseString.h"
-#include "FBaseColIList.h"
-#include "FBaseColArrayList.h"
-#include "FIo_IpcCommonDataTypes.h"
-
-#include "base/tuple.h"
-#include "ipc/ipc_param_traits.h"
-
-#include "FShellNotificationRequest.h"
-
-
-namespace IPC
-{
-template <>
-struct ParamTraits<Tizen::Shell::NotificationRequest>
-{
- typedef Tizen::Shell::NotificationRequest param_type;
-
- static void Write(Message* m, const param_type& p)
- {
- WriteParam(m, p.GetAlertText());
- WriteParam(m, p.GetAppMessage());
- WriteParam(m, p.GetTitleText());
- WriteParam(m, p.GetIconFilePath());
- WriteParam(m, p.GetSoundFilePath());
-
- m->WriteInt(p.GetBadgeNumber());
- m->WriteInt(p.GetBadgeOffset());
- m->WriteInt((Tizen::Shell::OngoingActivityType)p.GetOngoingActivityType());
- m->WriteInt(p.GetOngoingActivityProgress());
- }
-
- static bool Read(const Message* m, void** iter, param_type* r)
- {
- Tizen::Base::String alertText;
- Tizen::Base::String appMessage;
- Tizen::Base::String titleText;
- Tizen::Base::String iconFilePath;
- Tizen::Base::String soundFilePath;
-
- int badgeNo = -1;
- int badgeOffset = 0;
- int activityType = Tizen::Shell::ONGOING_ACTIVITY_TYPE_TEXT;
- int progressValue = -1;
-
-
- if (!ReadParam(m, iter, &alertText))
- {
- return false;
- }
- if (!ReadParam(m, iter, &appMessage))
- {
- return false;
- }
- if (!ReadParam(m, iter, &titleText))
- {
- return false;
- }
- if (!ReadParam(m, iter, &iconFilePath))
- {
- return false;
- }
- if (!ReadParam(m, iter, &soundFilePath))
- {
- return false;
- }
- m->ReadInt(iter, &badgeNo);
- m->ReadInt(iter, &badgeOffset);
- m->ReadInt(iter, &activityType);
- m->ReadInt(iter, &progressValue);
-
-
- Tizen::Shell::NotificationRequest notimessage;
- if (!alertText.IsEmpty())
- {
- notimessage.SetAlertText(alertText);
- }
- notimessage.SetAppMessage(appMessage);
- notimessage.SetTitleText(titleText);
- if (!iconFilePath.IsEmpty())
- {
- notimessage.SetIconFilePath(iconFilePath);
- }
- if (!soundFilePath.IsEmpty())
- {
- notimessage.SetSoundFilePath(soundFilePath);
- }
-
- if (badgeNo >= 0)
- {
- notimessage.SetBadgeNumber(badgeNo);
- }
- if (badgeOffset >= 0)
- {
- notimessage.SetBadgeOffset(badgeOffset);
- }
- notimessage.SetOngoingActivityType((Tizen::Shell::OngoingActivityType)activityType);
- if (progressValue >= 0)
- {
- notimessage.SetOngoingActivityProgress(progressValue);
- }
-
-
- *r = notimessage;
-
- return true;
- }
- static void Log(const param_type& p, std::string* l)
- {
- }
-
-};
-}
-
-#endif //_FSHELL_INTERNAL_NOTIFICATION_MANAGER_EVENT_ARG_PARAM_TRAITS_H_
{
class NotificationManager;
-class _NotificationManagerProxy;
enum _NotifyType
{
int GetBadgeCount(const char* pkgName) const;
private:
- _NotificationManagerProxy* __pNotificationManagerProxy;
int __notifyPrivitId;
int __notifyPrivitIdForOngoing;
}; //_NotificationManagerImpl
+++ /dev/null
-//
-// Open Service Platform
-// 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_NotificationManagerIpcMessages.h
- * @brief This is the header file for the NotificationManager Ipc message types.
- */
-
-#include <FAppTypes.h>
-#include <FShellNotificationRequest.h>
-
-#include "ipc/ipc_message_macros.h"
-#include "FIo_IpcCommonParamTraits.h"
-#include "FIo_IpcMessageStart.h"
-#include "FShell_NotificationManagerEventParamTraits.h"
-
-#define IPC_MESSAGE_START NotificationManagerServiceStart
-
-IPC_SYNC_MESSAGE_CONTROL3_1(NotificationManager_NotifyMessage, Tizen::App::AppId, Tizen::Shell::NotificationRequest, bool, result)
-IPC_SYNC_MESSAGE_CONTROL2_1(NotificationManager_RemoveNotification, Tizen::App::AppId, bool, result)
-
+++ /dev/null
-//
-// Open Service Platform
-// 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_NotificationManagerProxy.h
- * @brief This is the header file of the _NotificationManagerProxy class.
- */
-
-#ifndef _FSHELL_INTERNAL_NOTIFICATION_MANAGER_PROXY_H_
-#define _FSHELL_INTERNAL_NOTIFICATION_MANAGER_PROXY_H_
-
-#include <FBaseObject.h>
-#include <FBaseString.h>
-#include <FAppTypes.h>
-
-namespace Tizen { namespace Io { class _IpcClient; } }
-
-namespace Tizen { namespace Shell
-{
-
-class NotificationRequest;
-
-/**
- * @class _NotificationManagerProxy
- * @brief
- * @since 2.1
- */
-class _NotificationManagerProxy
- : public Tizen::Base::Object
-{
-public:
- _NotificationManagerProxy(void);
- virtual ~_NotificationManagerProxy(void);
-
- result Construct(void);
-
- result NotifyMessage(const Tizen::App::AppId& appId, const NotificationRequest& message, bool Ongoing);
- result RemoveNotification(const Tizen::App::AppId& appId, bool Ongoing);
-
-
-private:
- _NotificationManagerProxy(const _NotificationManagerProxy& rhs);
-
- _NotificationManagerProxy& operator =(const _NotificationManagerProxy& rhs);
-
-private:
- Tizen::Io::_IpcClient* __pIpcClient;
-
-}; // _NotificationManagerProxy
-
-} } // Tizen::Shell
-
-#endif // _FSHELL_INTERNAL_NOTIFICATION_MANAGER_PROXY_H_
*/
bool IsAppBinding() const;
+ /**
+ * Gets the style of a notification message.
+ *
+ * @since 2.1
+ *
+ * @return The notification style
+ */
+ NotificationStyle GetNotificationStyle(void) const;
+
+ /**
+ * Sets the style of a notification message.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] style The notification style
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified @c style is not valid.
+ */
+ result SetNotificationStyle(NotificationStyle style);
+
+ /**
+ * Gets a list of message text for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return A string list of detail information text
+ */
+ Tizen::Base::Collection::IList* GetMessageTextListN(void) const;
+
+ /**
+ * Sets a string list of message text for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] pTextList A list of detail information text
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified @c textList is empty or the length of individual text is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH.
+ * @remarks This information is only meaningful when the notification style is Shell::NOTIFICATION_STYLE_NORMAL. @n
+ * Use the tab(\\t) character to separate the columns.
+ *
+ */
+ result SetMessageTextList(const Tizen::Base::Collection::IList* pTextList);
+
+ /**
+ * Gets a list of the message thumbnail image absolute file path for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return A string list of thumbnail image file path
+ */
+ Tizen::Base::Collection::IList* GetMessageThumbnailFilePathListN(void) const;
+
+ /**
+ * Sets a string list of the message image absolute file path for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] pImagePathList A list of the thumbnail image file path
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified path is invalid.
+ * @remarks This information is only meaningful when then notification style is Shell::NOTIFICATION_STYLE_THUMBNAIL.
+ */
+ result SetMessageThumbnailFilePathList(const Tizen::Base::Collection::IList* pThumbnailPathList);
+
+ /**
+ * Gets the notification count of a notification message.
+ *
+ * @since 2.1
+ *
+ * @return The notification count text
+ */
+ Tizen::Base::String GetNotificationCountText(void) const;
+
+ /**
+ * Sets the notification count of a notification message.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] notificationCount The event count text
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified @c eventCountText is empty or the length of @c eventCountText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH.
+ */
+ result SetNotificationCountText(const Tizen::Base::String& notificationCountText);
+
+ /**
+ * Gets the absolute file path of the background image for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return The file path of a background image file
+ */
+ Tizen::Base::String GetBackgroundImageFilePath(void) const;
+
+ /**
+ * Sets the absolute file path of the background image for a notification message.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] imagePath The file path of the background image
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified path is invalid.
+ */
+ result SetBackgroundImageFilePath(const Tizen::Base::String& imagePath);
+
+
+ /*
+ * Get internal pointer of TextList for internal reference
+ */
+ const Tizen::Base::Collection::IList* GetMessageTextList() const;
+
+ /*
+ * Get internal pointer of ThumbnailPathList for internal reference
+ */
+ const Tizen::Base::Collection::IList* GetMessageThumbnailFilePathList() const;
+
+ //
+ // Gets the implementation.
+ //
+ // @return The implementation
+ // @param[in] The interface instance pointer
+ // @since 2.1
+ //
+ static _NotificationRequestImpl* GetInstance(NotificationRequest& request);
+
+ //
+ // Gets the implementation.
+ //
+ // @return The implementation
+ // @param[in] The interface instance pointer
+ // @since 2.1
+ //
+ static const _NotificationRequestImpl* GetInstance(const NotificationRequest& request);
+
private:
bool __appBinding;
int __badgeNumber;
Tizen::Base::String __titleText;
Tizen::Base::String __iconFilePath;
Tizen::Base::String __soundFilePath;
+ // 2.1
+ int __notificationStyle;
+ Tizen::Base::Collection::IList* __pTextList;
+ Tizen::Base::Collection::IList* __pThumbnailPathList;
+ Tizen::Base::String __notificationCountText;
+ Tizen::Base::String __backgroundImagePath;
}; //_NotificationRequestImpl