add SetVibrationType() and SetSoundState() 58/14858/1
authorkyeongwoo.lee <kyeongwoo.lee@samsung.com>
Wed, 4 Dec 2013 04:52:36 +0000 (13:52 +0900)
committerKeebong <keebong.bahn@samsung.com>
Mon, 13 Jan 2014 09:02:53 +0000 (18:02 +0900)
Change-Id: I6ee0091f4cda3cbe4ced133038a0948c3774894e
Signed-off-by: kyeongwoo.lee <kyeongwoo.lee@samsung.com>
src/core/FShell_NotificationManagerImpl.cpp [changed mode: 0644->0755]
src/core/FShell_NotificationRequestImpl.cpp [changed mode: 0644->0755]
src/inc/FShell_NotificationRequestImpl.h [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index ab641e8..4a889d6
@@ -656,30 +656,43 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
        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())
+       if (pRequestImpl->GetSoundState() == _SOUND_STATE_MUTE)
        {
-               if (isOngoing && needUpdate)
-               {
-                       r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_NONE, NULL));
-               }
-               else
-               {
-                       r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_USER_DATA, pSoundPath.get()));
-               }
+               r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_NONE, NULL));
        }
        else
        {
-               if (isOngoing)
+               if (pSoundPath.get())
                {
-                       r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_NONE, NULL));
+                       if (isOngoing && needUpdate)
+                       {
+                               r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_NONE, NULL));
+                       }
+                       else
+                       {
+                               r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_USER_DATA, pSoundPath.get()));
+                       }
                }
                else
                {
-                       r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL));
+                       if (isOngoing)
+                       {
+                               r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_NONE, NULL));
+                       }
+                       else
+                       {
+                               r = ConvertNotificationResult(notification_set_sound(notiHandle, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL));
+                       }
                }
        }
        SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Setting the sound failed.", GetErrorMessage(r));
 
+       if (pRequestImpl->GetVibrationType() == _VIBRATION_TYPE_DEFAULT)
+       {
+               r = ConvertNotificationResult(notification_set_vibration(notiHandle, NOTIFICATION_VIBRATION_TYPE_DEFAULT, NULL));
+               SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Setting the vibration failed.", GetErrorMessage(r));
+       }
+
        // Set extended - text, thumbnail and background image
        if (!isOngoing)
        {
old mode 100644 (file)
new mode 100755 (executable)
index 1ed7fd9..13eaccc
@@ -46,6 +46,8 @@ _NotificationRequestImpl::_NotificationRequestImpl(bool appBinding)
        , __lightOnTime(0)
        , __lightOffTime(0)
        , __iconStyle(_INDICATOR_ICON_STYLE_NORMAL)
+       , __vibrationType(_VIBRATION_TYPE_NONE)
+       , __soundState(_SOUND_STATE_NORMAL)
 {
 }
 
@@ -69,6 +71,8 @@ _NotificationRequestImpl::_NotificationRequestImpl(const _NotificationRequestImp
        , __lightOnTime(notificationMessage.__lightOnTime)
        , __lightOffTime(notificationMessage.__lightOffTime)
        , __iconStyle(notificationMessage.__iconStyle)
+       , __vibrationType(notificationMessage.__vibrationType)
+       , __soundState(notificationMessage.__soundState)
 {
 }
 
@@ -103,6 +107,8 @@ _NotificationRequestImpl::operator =(const _NotificationRequestImpl& notificatio
                __lightOffTime = notificationMessage.__lightOffTime;
 
                __iconStyle = notificationMessage.__iconStyle;
+               __vibrationType = notificationMessage.__vibrationType;
+               __soundState = notificationMessage.__soundState;
        }
        return *this;
 }
@@ -213,6 +219,15 @@ _NotificationRequestImpl::Equals(const Object& rhs) const
        {
                return false;
        }
+       if (__vibrationType != pMsgImpl->__vibrationType)
+       {
+               return false;
+       }
+       if (__soundState != pMsgImpl->__soundState)
+       {
+               return false;
+       }
+
        return true;
 }
 
@@ -238,6 +253,8 @@ _NotificationRequestImpl::GetHashCode(void) const
                ^ Integer(__lightOnTime).GetHashCode()
                ^ Integer(__lightOffTime).GetHashCode()
                ^ Integer(static_cast<int>(__iconStyle)).GetHashCode()
+               ^ Integer(static_cast<int>(__vibrationType)).GetHashCode()
+               ^ Integer(static_cast<int>(__soundState)).GetHashCode()
                ;
 }
 
@@ -629,6 +646,32 @@ _NotificationRequestImpl::GetIndicatorIcon(void) const
        return __iconStyle;
 }
 
+result
+_NotificationRequestImpl::SetVibrationType(_VibrationType vibrationType)
+{
+       __vibrationType = vibrationType;
+       return E_SUCCESS;
+}
+
+_VibrationType
+_NotificationRequestImpl::GetVibrationType(void) const
+{
+       return __vibrationType;
+}
+
+result
+_NotificationRequestImpl::SetSoundState(_SoundState soundState)
+{
+       __soundState = soundState;
+       return E_SUCCESS;
+}
+
+_SoundState
+_NotificationRequestImpl::GetSoundState(void) const
+{
+       return __soundState;
+}
+
 
 _NotificationRequestImpl*
 _NotificationRequestImpl::GetInstance(NotificationRequest& request)
old mode 100644 (file)
new mode 100755 (executable)
index 0fb03b9..9456a25
@@ -35,11 +35,25 @@ 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 */
+       _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 */
 };
 
+enum _VibrationType
+{
+       _VIBRATION_TYPE_NONE,                           /**< The no vibration */
+       _VIBRATION_TYPE_DEFAULT                         /**< The default type vibration */
+};
+
+enum _SoundState
+{
+       _SOUND_STATE_NORMAL,                            /**< The normal state sound */
+       _SOUND_STATE_MUTE                                       /**< The mute sate sound */
+};
+
+
+
 class _OSP_EXPORT_ _NotificationRequestImpl
        : public Tizen::Base::Object
 {
@@ -494,6 +508,16 @@ public:
     */
        _IndicatorIconStyle GetIndicatorIcon(void) const;
 
+
+       result SetVibrationType(_VibrationType vibrationType);
+
+       _VibrationType GetVibrationType(void) const;
+
+       result SetSoundState(_SoundState soundState);
+
+       _SoundState GetSoundState(void) const;
+
+
        //
        // Gets the implementation.
        //
@@ -535,6 +559,9 @@ private:
        int __lightOffTime;
        // 2.2.1
        _IndicatorIconStyle __iconStyle;
+       // After 2.2.1
+       _VibrationType __vibrationType;
+       _SoundState __soundState;
 
 };     //_NotificationRequestImpl