Added the notification in indicator area for saved file
authorrahul sharma <rahul.dutt@samsung.com>
Sat, 29 Jun 2013 10:14:23 +0000 (19:14 +0900)
committerrahul sharma <rahul.dutt@samsung.com>
Sat, 29 Jun 2013 10:14:23 +0000 (19:14 +0900)
Change-Id: Ie03fd6ce74d9ec74ffda11eff9be9242cc1257f1

inc/IntMainForm.h
manifest.xml
res/screen-density-xhigh/Notification_download_complete.png [new file with mode: 0644]
res/screen-density-xhigh/Notification_download_failed.png [new file with mode: 0644]
src/IntMainForm.cpp

index 54fd0a2..334f08b 100644 (file)
@@ -258,6 +258,7 @@ public:
        virtual void  OnTextValueChanged (const Tizen::Ui::Control &source);
 
        void UpdateImageContent(Tizen::Base::ByteBuffer* aBuffer, Tizen::Base::String imageName);
+       void ShowIndicatorNotification(const Tizen::Base::String& messageText);
 
        void SetForwardButtonEnabled(bool isEnabled);
        void SetBackButtonEnabled(bool isEnabled);
index 2d4c722..c3876f0 100644 (file)
@@ -19,6 +19,7 @@
             <Privilege>http://tizen.org/privilege/power</Privilege>
             <Privilege>http://tizen.org/privilege/content.write</Privilege>
             <Privilege>http://tizen.org/privilege/appmanager.launch</Privilege>
+            <Privilege>http://tizen.org/privilege/notification</Privilege>
         </Privileges>
         <UiApp HwAcceleration="On" LaunchingHistoryVisible="True" Main="True" MenuIconVisible="True" Name="Internet">
             <UiScalability BaseScreenSize="Normal" CoordinateSystem="Logical" LogicalCoordinate="720"/>
diff --git a/res/screen-density-xhigh/Notification_download_complete.png b/res/screen-density-xhigh/Notification_download_complete.png
new file mode 100644 (file)
index 0000000..567f4fa
Binary files /dev/null and b/res/screen-density-xhigh/Notification_download_complete.png differ
diff --git a/res/screen-density-xhigh/Notification_download_failed.png b/res/screen-density-xhigh/Notification_download_failed.png
new file mode 100644 (file)
index 0000000..0f2e56f
Binary files /dev/null and b/res/screen-density-xhigh/Notification_download_failed.png differ
index 4372b64..7221f39 100644 (file)
@@ -25,6 +25,8 @@
 #include <FMedia.h>
 #include <FUi.h>
 #include <FContent.h>
+#include <FShell.h>
+//#include <FShellNotificationManager.h>
 
 #include "IntBookmarkData.h"
 #include "IntBookmarkPresentationModel.h"
@@ -44,6 +46,7 @@ using namespace Tizen::Graphics;
 using namespace Tizen::Io;
 using namespace Tizen::Locales;
 using namespace Tizen::Media;
+using namespace Tizen::Shell;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Content;
@@ -5016,10 +5019,35 @@ void MainForm::UpdateImageContent(ByteBuffer* aBuffer, String imageName)
        contentPath.Append(imageName);
        contentPath.Append(".jpg");
        contentId = contentManager.CreateContent(*aBuffer, contentPath);
+       ShowIndicatorNotification(L"Download Complete");
        AppLog("Content manager update content result %s" ,GetErrorMessage(GetLastResult()));
 }
 
 void
+MainForm::ShowIndicatorNotification(const String& messageText)
+{
+       AppLogDebug("ENTER");
+
+       NotificationRequest request;
+       request.SetAlertText(messageText);
+       request.SetTitleText(L"");
+       request.SetAppMessage(L"AppMessage");
+
+       Tizen::App::App* pApp = Tizen::App::App::GetInstance();
+       String homePath = pApp->GetAppRootPath();
+       String iconPath = homePath + L"res/screen-density-xhigh/Notification_download_complete.png";
+       AppLog("The iconPath is : %ls", homePath.GetPointer());
+       request.SetIconFilePath(iconPath);
+
+       Tizen::Shell::NotificationManager notiMgr;
+       notiMgr.Construct();
+       notiMgr.Notify(request);
+
+       AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult()));
+       return;
+}
+
+void
 MainForm::SetForwardButtonEnabled(bool isEnabled)
 {
        __pGoForwardBtn->SetEnabled(isEnabled);