update codes for notification setting
authorkyeongwoo.lee <kyeongwoo.lee@samsung.com>
Wed, 4 Sep 2013 06:33:20 +0000 (15:33 +0900)
committerkyeongwoo.lee <kyeongwoo.lee@samsung.com>
Wed, 4 Sep 2013 06:37:15 +0000 (15:37 +0900)
Change-Id: I6891d6e8096a7fa0fa5f95087cd72752d7e7b4fb

src/core/FShell_NotificationManagerImpl.cpp
src/core/FShell_NotificationRequestImpl.cpp
src/inc/FShell_NotificationRequestImpl.h

index af19eaa..7ff51bf 100644 (file)
@@ -584,6 +584,22 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                }
                SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Setting the icon path failed.", GetErrorMessage(r));
        }
+       // Indicator icon path
+       std::unique_ptr<char[]> pIndicatorIconPath(null);
+       _IndicatorIconStyle iconStyle = pRequestImpl->GetIndicatorIcon();
+       if (iconStyle == _INDICATOR_ICON_STYLE_NORMAL)
+       {
+               String indicatorIconPath(pIconPath.get());
+               pIndicatorIconPath.reset(_StringConverter::CopyToCharArrayN(indicatorIconPath));
+       }
+       else if (iconStyle == _INDICATOR_ICON_STYLE_DOWNLOADING)
+       {
+               pIndicatorIconPath.reset(_StringConverter::CopyToCharArrayN(L"reserved://indicator/ani/downloading"));
+       }
+       else if (iconStyle == _INDICATOR_ICON_STYLE_UPLOADING)
+       {
+               pIndicatorIconPath.reset(_StringConverter::CopyToCharArrayN(L"reserved://indicator/ani/uploading"));
+       }
        // Sound file path
        std::unique_ptr<char[]> pSoundPath(null);
        if (!soundPath.IsEmpty())
@@ -612,7 +628,8 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
        // Set - icon file path
        r = ConvertNotificationResult(notification_set_image(notiHandle, NOTIFICATION_IMAGE_TYPE_ICON, pIconPath.get()));
        SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Setting the icon path failed.", GetErrorMessage(r));
-       r = ConvertNotificationResult(notification_set_image(notiHandle, NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR, pIconPath.get()));
+       // Set - indicator icon path
+       r = ConvertNotificationResult(notification_set_image(notiHandle, NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR, pIndicatorIconPath.get()));
        SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Setting the indicator icon path failed.", GetErrorMessage(r));
        // Set - sound file path
        if (pSoundPath.get())
index bff2f4e..1ed7fd9 100644 (file)
@@ -45,6 +45,7 @@ _NotificationRequestImpl::_NotificationRequestImpl(bool appBinding)
        , __pThumbnailPathList(null)
        , __lightOnTime(0)
        , __lightOffTime(0)
+       , __iconStyle(_INDICATOR_ICON_STYLE_NORMAL)
 {
 }
 
@@ -67,6 +68,7 @@ _NotificationRequestImpl::_NotificationRequestImpl(const _NotificationRequestImp
        , __lightColor(notificationMessage.__lightColor)
        , __lightOnTime(notificationMessage.__lightOnTime)
        , __lightOffTime(notificationMessage.__lightOffTime)
+       , __iconStyle(notificationMessage.__iconStyle)
 {
 }
 
@@ -99,6 +101,8 @@ _NotificationRequestImpl::operator =(const _NotificationRequestImpl& notificatio
                __lightColor = notificationMessage.__lightColor;
                __lightOnTime = notificationMessage.__lightOnTime;
                __lightOffTime = notificationMessage.__lightOffTime;
+
+               __iconStyle = notificationMessage.__iconStyle;
        }
        return *this;
 }
@@ -205,7 +209,10 @@ _NotificationRequestImpl::Equals(const Object& rhs) const
        {
                return false;
        }
-
+       if (__iconStyle != pMsgImpl->__iconStyle)
+       {
+               return false;
+       }
        return true;
 }
 
@@ -230,6 +237,7 @@ _NotificationRequestImpl::GetHashCode(void) const
                ^ __lightColor.GetHashCode()
                ^ Integer(__lightOnTime).GetHashCode()
                ^ Integer(__lightOffTime).GetHashCode()
+               ^ Integer(static_cast<int>(__iconStyle)).GetHashCode()
                ;
 }
 
@@ -608,6 +616,20 @@ _NotificationRequestImpl::GetMessageThumbnailFilePathList() const
        return __pThumbnailPathList;
 }
 
+result
+_NotificationRequestImpl::SetIndicatorIcon(_IndicatorIconStyle iconStyle)
+{
+       __iconStyle = iconStyle;
+       return E_SUCCESS;
+}
+
+_IndicatorIconStyle
+_NotificationRequestImpl::GetIndicatorIcon(void) const
+{
+       return __iconStyle;
+}
+
+
 _NotificationRequestImpl*
 _NotificationRequestImpl::GetInstance(NotificationRequest& request)
 {
index 3fa3cbd..0fb03b9 100644 (file)
@@ -33,6 +33,13 @@ namespace Tizen { namespace Shell
 class NotificationRequest;
 const int INVALID_OFFSET_BADGE_NUMBER = -1000;
 
+enum _IndicatorIconStyle
+{
+    _INDICATOR_ICON_STYLE_NORMAL,       /**< The icon is normal style */
+    _INDICATOR_ICON_STYLE_DOWNLOADING,  /**< The icon is downloading style */
+    _INDICATOR_ICON_STYLE_UPLOADING     /**< The icon is uploading style */
+};
+
 class _OSP_EXPORT_ _NotificationRequestImpl
        : public Tizen::Base::Object
 {
@@ -477,6 +484,16 @@ public:
         */
        int GetOffTime(void) const;
 
+    /**
+    * Sets an icon style for specified %NotificationRequest instance.
+    */
+       result SetIndicatorIcon(_IndicatorIconStyle iconStyle);
+
+    /**
+    * Gets an icon style for specified %NotificationRequest instance.
+    */
+       _IndicatorIconStyle GetIndicatorIcon(void) const;
+
        //
        // Gets the implementation.
        //
@@ -516,6 +533,8 @@ private:
        Tizen::Graphics::Color __lightColor;
        int __lightOnTime;
        int __lightOffTime;
+       // 2.2.1
+       _IndicatorIconStyle __iconStyle;
 
 };     //_NotificationRequestImpl