Add methods for Addon SDK dev.
authorSeungWon Lee <lsw2000.lee@samsung.com>
Thu, 2 May 2013 05:39:04 +0000 (14:39 +0900)
committerSeungWon Lee <lsw2000.lee@samsung.com>
Thu, 2 May 2013 05:39:04 +0000 (14:39 +0900)
Change-Id: I7cae0f91995017847aff073093fe2292b1c05081
Signed-off-by: SeungWon Lee <lsw2000.lee@samsung.com>
src/core/FShell_NotificationManagerImpl.cpp
src/inc/FShell_NotificationManagerImpl.h

index 8828ca2..d26eee5 100644 (file)
@@ -173,6 +173,7 @@ _BadgeManagerImpl::RemovePrimaryBadgeEventListener(IBadgeEventListener& primaryL
 _NotificationManagerImpl::_NotificationManagerImpl(void)
        : __notifyPrivateId(-1)
        , __notifyPrivateIdForOngoing(-1)
+       , __lastNotifyPrivateId(-1)
 {
 }
 
@@ -447,6 +448,7 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
        {
                SysTryReturnResult(NID_SHELL, false, E_INVALID_ARG, "Invalid argument is used.");
        }
+       __lastAppId = pAppIdChar.get();
 
        const int badgeNumber = notifyRequest.GetBadgeNumber();
        const int badgeOffset = notifyRequest.GetBadgeOffset();
@@ -495,6 +497,7 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
        const String& soundPath = notifyRequest.GetSoundFilePath();
        const notification_type_e notiType = isOngoing ? NOTIFICATION_TYPE_ONGOING : NOTIFICATION_TYPE_NOTI;
        int notiPrivateId = isOngoing ? __notifyPrivateIdForOngoing : __notifyPrivateId;
+       __lastNotifyPrivateId = notiPrivateId;
        notification_h notiHandle = null;
        bundle* pBundle = null;
        bool needUpdate = false;
@@ -910,6 +913,7 @@ _NotificationManagerImpl::NotifyMessage(_NotifyType notifyType, bool isOngoing,
                {
                        __notifyPrivateId = notiPrivateId;
                }
+               __lastNotifyPrivateId = notiPrivateId;
        }
        else
        {
@@ -1087,6 +1091,18 @@ _NotificationManagerImpl::RemoveBadgeEventListener(IBadgeEventListener& listener
        return _BadgeManagerImpl::GetInstance()->RemovePrimaryBadgeEventListener(*this);
 }
 
+int
+_NotificationManagerImpl::GetLastNotificationId(void) const
+{
+       return __lastNotifyPrivateId;
+}
+
+const Tizen::Base::String&
+_NotificationManagerImpl::GetLastAppId(void) const
+{
+       return __lastAppId;
+}
+
 void
 _NotificationManagerImpl::OnBadgeUpdated(const Tizen::App::AppId& appId, int badgeNumber)
 {
index e13105d..fc4bac6 100644 (file)
@@ -468,6 +468,16 @@ public:
         */
        result RemoveBadgeEventListener(IBadgeEventListener& listener);
 
+       /*
+        * Get last notification id
+        */
+       int GetLastNotificationId(void) const;
+
+       /*
+        * Get last AppId
+        */
+       const Tizen::Base::String& GetLastAppId(void) const;
+
        virtual void OnBadgeUpdated(const Tizen::App::AppId& appId, int badgeNumber);
 
        static const _NotificationManagerImpl* GetInstance(const NotificationManager& notiMgr);
@@ -494,6 +504,8 @@ private:
 private:
        int __notifyPrivateId;
        int __notifyPrivateIdForOngoing;
+       int __lastNotifyPrivateId;
+       Tizen::Base::String __lastAppId;
        Tizen::Base::Collection::LinkedListT<IBadgeEventListener*> __badgeEventListenerList;
 };     //_NotificationManagerImpl