Add new APIs for NotificationRequest and more for NotificationManager.
authorSeungWon Lee <lsw2000.lee@samsung.com>
Wed, 13 Mar 2013 09:34:42 +0000 (18:34 +0900)
committerSeungWon Lee <lsw2000.lee@samsung.com>
Wed, 13 Mar 2013 09:34:42 +0000 (18:34 +0900)
Change-Id: I744c3389a8c1e5decac4b619cb1c57b4a5f87e21
Signed-off-by: SeungWon Lee <lsw2000.lee@samsung.com>
inc/FShellNotificationManager.h [changed mode: 0755->0644]
inc/FShellNotificationRequest.h
src/core/FShellNotificationManager.cpp [changed mode: 0755->0644]
src/core/FShellNotificationRequest.cpp
src/core/FShell_NotificationManagerImpl.cpp [changed mode: 0755->0644]
src/core/FShell_NotificationManagerProxy.cpp [changed mode: 0755->0644]
src/core/FShell_NotificationRequestImpl.cpp
src/inc/FShell_NotificationManagerImpl.h [changed mode: 0755->0644]
src/inc/FShell_NotificationRequestImpl.h

old mode 100755 (executable)
new mode 100644 (file)
index df3014b..76ae380
@@ -92,8 +92,8 @@ enum OngoingActivityType
  */
 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 */
 };
 
 
@@ -274,8 +274,8 @@ public:
         *
         * @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
@@ -311,8 +311,8 @@ public:
         *
         * @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
@@ -389,8 +389,8 @@ public:
         *
         * @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
@@ -425,8 +425,8 @@ public:
         *
         * @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
index 4ef401e..838ffa0 100644 (file)
@@ -329,8 +329,118 @@ public:
         */
        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
old mode 100755 (executable)
new mode 100644 (file)
index 576c0da..048acd7
@@ -129,7 +129,7 @@ NotificationManager::NotifyByAppId(const AppId& appId,const NotificationRequest&
 {
        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);
@@ -185,7 +185,7 @@ NotificationManager::NotifyOngoingActivityByAppId(const AppId& appId,const Notif
 {
        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);
@@ -207,7 +207,7 @@ NotificationManager::RemoveOngoingActivityNotificationByAppId(const AppId& 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->RemoveOngoingActivityNotificationByAppId(appId);
@@ -229,7 +229,7 @@ NotificationManager::RemoveNotificationByAppId(const AppId& 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);
index aeaec3a..f1a95a7 100644 (file)
@@ -48,6 +48,7 @@ NotificationRequest::~NotificationRequest()
 }
 
 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");
@@ -226,5 +227,83 @@ NotificationRequest::SetOngoingActivityProgress(int progressValue)
        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
old mode 100755 (executable)
new mode 100644 (file)
index 37b4140..96c3840
 #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_NotificationManagerProxy.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;
@@ -370,11 +372,12 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
 {
        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.");
@@ -450,7 +453,7 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
        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)
@@ -465,6 +468,10 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                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)
@@ -557,6 +564,146 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
        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);
@@ -569,7 +716,7 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
 
        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)
@@ -621,26 +768,6 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                SysLog(NID_APP, "service_to_bundle failed");
        }
 
-       // insert for new notification / update for exist one.
-       if (notiPrivateId == -1)
-       {       // new
-               r = ConvertNotificationResult(notification_insert(notiHandle, &notiPrivateId));
-               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)
        {
@@ -654,10 +781,6 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                        layout = NOTIFICATION_LY_ONGOING_PROGRESS;
                }
        }
-       else
-       {
-               // TODO: check and set from noti type.
-       }
        notification_set_layout(notiHandle, layout);
 
        // For ongoing
@@ -669,32 +792,61 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                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, &notiPrivateId));
+               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);
@@ -712,78 +864,12 @@ result
 _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
old mode 100755 (executable)
new mode 100644 (file)
index 6f73cb9..73a853e 100644 (file)
@@ -20,6 +20,8 @@
  * @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)
 {
 }
 
@@ -58,6 +64,11 @@ _NotificationRequestImpl::_NotificationRequestImpl(const _NotificationRequestImp
        , __titleText(notificationMessage.__titleText)
        , __iconFilePath(notificationMessage.__iconFilePath)
        , __soundFilePath(notificationMessage.__soundFilePath)
+       , __notificationStyle(notificationMessage.__notificationStyle)
+       , __pTextList(notificationMessage.__pTextList)
+       , __pThumbnailPathList(notificationMessage.__pThumbnailPathList)
+       , __notificationCountText(notificationMessage.__notificationCountText)
+       , __backgroundImagePath(notificationMessage.__backgroundImagePath)
 {
 }
 
@@ -80,6 +91,12 @@ _NotificationRequestImpl::operator =(const _NotificationRequestImpl& notificatio
                __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;
 }
@@ -149,7 +166,28 @@ _NotificationRequestImpl::Equals(const Object& rhs) const
                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;
        }
@@ -169,7 +207,13 @@ _NotificationRequestImpl::GetHashCode(void) const
                ^ __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
@@ -183,7 +227,7 @@ _NotificationRequestImpl::SetBadgeNumber(int badgeNumber)
 {
        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;
@@ -201,7 +245,7 @@ _NotificationRequestImpl::SetBadgeOffset(int badgeOffset)
 {
        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;
@@ -217,12 +261,11 @@ _NotificationRequestImpl::GetAlertText() const
 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
@@ -235,14 +278,13 @@ _NotificationRequestImpl::GetAppMessage() const
 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
@@ -254,11 +296,10 @@ _NotificationRequestImpl::GetTitleText() const
 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
@@ -270,14 +311,11 @@ _NotificationRequestImpl::GetIconFilePath() const
 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
@@ -289,14 +327,11 @@ _NotificationRequestImpl::GetSoundFilePath() const
 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
@@ -308,8 +343,6 @@ _NotificationRequestImpl::GetOngoingActivityType() const
 result
 _NotificationRequestImpl::SetOngoingActivityType(OngoingActivityType activityType)
 {
-       result r = E_SUCCESS;
-
        // to prevent weired gcc optimization for enum type
        int type = static_cast<int>(activityType);
 
@@ -317,19 +350,23 @@ _NotificationRequestImpl::SetOngoingActivityType(OngoingActivityType activityTyp
        {
        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
@@ -341,20 +378,19 @@ _NotificationRequestImpl::GetOngoingActivityProgress() const
 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
@@ -363,5 +399,167 @@ _NotificationRequestImpl::IsAppBinding()const
        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
old mode 100755 (executable)
new mode 100644 (file)
index 52af821..462b903 100644 (file)
@@ -314,6 +314,144 @@ public:
         */
        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;
@@ -325,6 +463,12 @@ private:
        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