public const string Bundle = "libbundle.so.0";
public const string Glib = "libglib-2.0.so.0";
public const string Libc = "libc.so.6";
+ public const string Notification = "libnotification.so.0";
}
}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications;
+using Tizen.Applications.Notifications;
+
+internal static partial class Interop
+{
+ internal static class Notification
+ {
+ [DllImport(Libraries.Notification, EntryPoint = "notification_create")]
+ internal static extern SafeNotificationHandle Create(NotificationType type);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_free")]
+ internal static extern int Destroy(IntPtr handle);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_text")]
+ internal static extern int GetText(SafeNotificationHandle handle, NotiText type, out IntPtr text);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_text")]
+ internal static extern int SetText(SafeNotificationHandle handle, NotiText type, string text, string key, int args);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_image")]
+ internal static extern int GetImage(SafeNotificationHandle handle, NotiImage type, out IntPtr text);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_image")]
+ internal static extern int SetImage(SafeNotificationHandle handle, NotiImage type, string text);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_time")]
+ internal static extern int GetTime(SafeNotificationHandle handle, out int time);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_time")]
+ internal static extern int SetTime(SafeNotificationHandle handle, int time);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_insert_time")]
+ internal static extern int GetInsertTime(SafeNotificationHandle handle, out long time);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_sound")]
+ internal static extern int GetSound(SafeNotificationHandle handle, out SoundOption type, out IntPtr path);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_sound")]
+ internal static extern int SetSound(SafeNotificationHandle handle, SoundOption type, string path);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_vibration")]
+ internal static extern int GetVibration(SafeNotificationHandle handle, out VibrationOption type, out IntPtr path);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_vibration")]
+ internal static extern int SetVibration(SafeNotificationHandle handle, VibrationOption type, string path);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_led")]
+ internal static extern int GetLed(SafeNotificationHandle handle, out LedOption type, out int color);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_led")]
+ internal static extern int SetLed(SafeNotificationHandle handle, LedOption type, int color);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_led_time_period")]
+ internal static extern int GetLedTimePeriod(SafeNotificationHandle handle, out int on, out int off);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_led_time_period")]
+ internal static extern int SetLedTimePeriod(SafeNotificationHandle handle, int on, int off);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_launch_option")]
+ internal static extern int GetAppControl(SafeNotificationHandle handle, LaunchOption type, out SafeAppControlHandle apphandle);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_launch_option")]
+ internal static extern int SetAppControl(SafeNotificationHandle handle, LaunchOption type, SafeAppControlHandle appHandle);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_event_handler")]
+ internal static extern int GetEventHandler(SafeNotificationHandle handle, int type, out SafeAppControlHandle appHandle);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_event_handler")]
+ internal static extern int SetEventHandler(SafeNotificationHandle handle, int type, SafeAppControlHandle appHandle);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_property")]
+ internal static extern int GetProperties(SafeNotificationHandle handle, out int flags);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_property")]
+ internal static extern int SetProperties(SafeNotificationHandle handle, int flags);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_display_applist")]
+ internal static extern int GetApplist(SafeNotificationHandle handle, out int flags);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_display_applist")]
+ internal static extern int SetApplist(SafeNotificationHandle handle, int flags);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_size")]
+ internal static extern int GetProgressSize(SafeNotificationHandle handle, out double value);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_size")]
+ internal static extern int SetProgressSize(SafeNotificationHandle handle, double value);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_progress")]
+ internal static extern int GetProgress(SafeNotificationHandle handle, out double value);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_progress")]
+ internal static extern int SetProgress(SafeNotificationHandle handle, double value);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_layout")]
+ internal static extern int GetLayout(SafeNotificationHandle handle, out NotiLayout type);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_layout")]
+ internal static extern int SetLayout(SafeNotificationHandle handle, NotiLayout type);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_type")]
+ internal static extern int GetType(SafeNotificationHandle handle, out NotificationType type);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_update")]
+ internal static extern int Update(SafeNotificationHandle handle);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_delete")]
+ internal static extern int Delete(SafeNotificationHandle handle);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_delete_all")]
+ internal static extern int DeleteAll(int type);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_post")]
+ internal static extern int Post(SafeNotificationHandle handle);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_pkgname")]
+ internal static extern int GetPackageName(SafeNotificationHandle handle, out IntPtr name);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_add_button")]
+ internal static extern int AddButton(SafeNotificationHandle handle, int index);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_remove_button")]
+ internal static extern int RemoveButton(SafeNotificationHandle handle, int index);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_tag")]
+ internal static extern int SetTag(SafeNotificationHandle handle, string tag);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_tag")]
+ internal static extern int GetTag(SafeNotificationHandle handle, out IntPtr tag);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_status_message_post")]
+ internal static extern int PostMessage(string text);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_load_by_tag")]
+ internal static extern SafeNotificationHandle Load(string text);
+
+ internal sealed class SafeNotificationHandle : SafeHandle
+ {
+ public SafeNotificationHandle()
+ : base(IntPtr.Zero, true)
+ {
+ }
+
+ public override bool IsInvalid
+ {
+ get { return this.handle == IntPtr.Zero; }
+ }
+
+ protected override bool ReleaseHandle()
+ {
+ Notification.Destroy(this.handle);
+ this.SetHandle(IntPtr.Zero);
+ return true;
+ }
+ }
+ }
+}
<Compile Include="Interop\Interop.Libc.cs" />
<Compile Include="Interop\Interop.Libraries.cs" />
<Compile Include="Interop\Interop.MessagePort.cs" />
+ <Compile Include="Interop\Interop.Notification.cs" />
<Compile Include="Interop\Interop.Package.cs" />
<Compile Include="Interop\Interop.PackageManager.cs" />
<Compile Include="Interop\Interop.Service.cs" />
<Compile Include="Tizen.Applications\AppControlOperations.cs" />
<Compile Include="Tizen.Applications\Application.cs" />
<Compile Include="Tizen.Applications\Bundle.cs" />
+ <Compile Include="Tizen.Applications\EventNotification.cs" />
+ <Compile Include="Tizen.Applications\Notification.cs" />
+ <Compile Include="Tizen.Applications\NotificationEnumerations.cs" />
+ <Compile Include="Tizen.Applications\NotificationErrorFactory.cs" />
+ <Compile Include="Tizen.Applications\NotificationManager.cs" />
+ <Compile Include="Tizen.Applications\ProgressNotification.cs" />
<Compile Include="Tizen.Applications\TizenSynchronizationContext.cs" />
</ItemGroup>
<ItemGroup>
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Tizen.Applications.Notifications
+{
+ /// <summary>
+ /// Class for creating either SingleEvent notifications or MultiEvent notifications
+ /// </summary>
+ public class EventNotification : Notification
+ {
+ /// <summary>
+ /// Class contructor
+ /// </summary>
+ public EventNotification()
+ {
+ int ret;
+
+ _handle = Interop.Notification.Create(NotificationType.Event);
+ if (_handle.IsInvalid)
+ {
+ ret = Tizen.Internals.Errors.ErrorFacts.GetLastResult();
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to create Event Notification");
+ }
+
+ ret = Interop.Notification.SetLayout(_handle, NotiLayout.SingleEvent);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set event layout");
+ }
+
+ NotificationType = NotificationType.Event;
+ }
+
+ internal EventNotification(Interop.Notification.SafeNotificationHandle handle)
+ {
+ _handle = handle;
+
+ NotificationType = NotificationType.Event;
+ }
+
+ /// <summary>
+ /// Sets and gets the event count to be displayed on a Notification.
+ /// </summary>
+ public int EventCount
+ {
+ get
+ {
+ IntPtr countPtr;
+ string count;
+ int cnt;
+ int ret = Interop.Notification.GetText(_handle, NotiText.EventCount, out countPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get event count");
+ return 0;
+ }
+
+ if(countPtr == IntPtr.Zero)
+ return 0;
+
+ count = Marshal.PtrToStringAuto(countPtr);
+ if(Int32.TryParse(count, out cnt))
+ {
+ return cnt;
+ }
+ else
+ {
+ Log.Warn(_logTag, "unable to parse string");
+ return 0;
+ }
+ }
+ set
+ {
+ int ret;
+ if(value <= 0)
+ {
+ throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid value for event count");
+ }
+
+ ret = Interop.Notification.SetText(_handle, NotiText.EventCount, value.ToString(), null, -1);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set event count");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets TimeStamp. Defaults to 0 ms UTC i.e 1 Jan 1970.
+ /// </summary>
+ public DateTime Timestamp
+ {
+ get
+ {
+ int time;
+ int ret = Interop.Notification.GetTime(_handle, out time);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get timestamp");
+ return (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds(0).ToLocalTime();
+ }
+
+ return (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds(time).ToLocalTime();
+ }
+ set
+ {
+ int time = (int)value.ToUniversalTime().Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
+ int ret = Interop.Notification.SetTime(_handle, time);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set timestamp");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Method to add a button
+ /// </summary>
+ /// <param name="index">Index of the Button to be added to notification</param>
+ /// <param name="imagePath">Path of Button image</param>
+ /// <param name="text">Text of button</param>
+ /// <param name="appControl">App control to be invoke on button click</param>
+ public void AddButton(ButtonIndex index, string imagePath = "", string text = "", AppControl appControl = null)
+ {
+ int ret = Interop.Notification.SetImage(_handle, (NotiImage)((int)index + (int)NotiImage.PositiveButton), imagePath);
+ if (ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "set button image path failed");
+ }
+
+ ret = Interop.Notification.SetText(_handle, (NotiText)((int)NotiText.PositiveButton + (int)index), text, null, -1);
+ if (ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set button text");
+ }
+
+ if(appControl != null)
+ {
+ ret = Interop.Notification.SetEventHandler(_handle, (int)index, appControl.SafeAppControlHandle);
+ if (ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set button event handler");
+ }
+ }
+
+ ret = Interop.Notification.AddButton(_handle, (int)index + 1);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to add button");
+ }
+ }
+
+ /// <summary>
+ /// Method to remove a button
+ /// </summary>
+ /// <param name="index">Index of button to be removed</param>
+ public void RemoveButton(ButtonIndex index)
+ {
+ AppControl app = new AppControl();
+
+ int ret = Interop.Notification.RemoveButton(_handle, (int)index + 1);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to remove button");
+ }
+
+ ret = Interop.Notification.SetImage(_handle, (NotiImage)((int)index + (int)NotiImage.PositiveButton), string.Empty);
+ if (ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "set button image path failed");
+ }
+
+ ret = Interop.Notification.SetText(_handle, (NotiText)((int)NotiText.PositiveButton + (int)index), string.Empty, null, -1);
+ if (ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set button text");
+ }
+
+ ret = Interop.Notification.SetEventHandler(_handle, (int)index, app.SafeAppControlHandle);
+ if (ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set button event handler");
+ }
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using Tizen.UI;
+
+namespace Tizen.Applications.Notifications
+{
+ /// <summary>
+ /// Structure containing led on and off periods
+ /// </summary>
+ public struct LedBlinkPeriod
+ {
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="on">On time of led in ms</param>
+ /// <param name="off">Off time of led in ms</param>
+ public LedBlinkPeriod(int on, int off)
+ {
+ OnTime = on;
+ OffTime = off;
+ }
+
+ /// <summary>
+ /// On time of Led in milliseconds
+ /// </summary>
+ public int OnTime
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Off time of Led in milliseconds
+ /// </summary>
+ public int OffTime
+ {
+ get;
+ set;
+ }
+ }
+
+ /// <summary>
+ /// Class containing common properties and methods of Notifications
+ /// </summary>
+ public abstract class Notification
+ {
+ internal const string _logTag = "Tizen.Applications.Notification";
+
+ internal Interop.Notification.SafeNotificationHandle _handle;
+
+ private const int DisableAppLaunchMask = 1 << 1;
+
+ private const int DisableAutoDeleteMask = 1 << 2;
+
+ private const int VolatileDisplayMask = 1 << 8;
+
+ private string _soundPath = string.Empty;
+
+ private string _vibrationPath = null;
+
+ private Color _ledColor = new Color(0, 0, 0, 0);
+
+ /// <summary>
+ /// Insert time of Notification. Default is 1 Jan 1970 9:00:00 until notification is posted.
+ /// </summary>
+ public DateTime InsertTime
+ {
+ get
+ {
+ long time;
+ int ret = Interop.Notification.GetInsertTime(_handle, out time);
+ if (ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get insert time");
+ return (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds(0).ToLocalTime();
+ }
+
+ return (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds(time).ToLocalTime();
+ }
+ }
+
+ /// <summary>
+ /// Title of Notification. Defaults to empty string.
+ /// </summary>
+ public string Title
+ {
+ get
+ {
+ IntPtr titlePtr;
+ int ret = Interop.Notification.GetText(_handle, NotiText.Title, out titlePtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get title");
+ return string.Empty;
+ }
+
+ if (titlePtr == IntPtr.Zero)
+ return string.Empty;
+
+ return Marshal.PtrToStringAuto(titlePtr);
+ }
+ set
+ {
+ int ret = Interop.Notification.SetText(_handle, NotiText.Title, value, null, -1);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set title");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Content of Notification. Defaults to empty string.
+ /// </summary>
+ public string Content
+ {
+ get
+ {
+ IntPtr contentPtr;
+ int ret = Interop.Notification.GetText(_handle, NotiText.Content, out contentPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get content");
+ return string.Empty;
+ }
+
+ if (contentPtr == IntPtr.Zero)
+ return string.Empty;
+
+ return Marshal.PtrToStringAuto(contentPtr);
+ }
+ set
+ {
+ int ret = Interop.Notification.SetText(_handle, NotiText.Content, value, null, -1);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set content");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets Icon image Path. Defaults to empty string.
+ /// </summary>
+ public string IconPath
+ {
+ get
+ {
+ IntPtr pathPtr;
+ int ret = Interop.Notification.GetImage(_handle, NotiImage.Icon, out pathPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get icon image path");
+ return string.Empty;
+ }
+
+ if (pathPtr == IntPtr.Zero)
+ return string.Empty;
+
+ return Marshal.PtrToStringAuto(pathPtr);
+ }
+ set
+ {
+ int ret = Interop.Notification.SetImage(_handle, NotiImage.Icon, value);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set icon image path");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets Indicator icon image Path. Defaults to empty string.
+ /// </summary>
+ public string IndicatorIconPath
+ {
+ get
+ {
+ IntPtr pathPtr;
+ int ret = Interop.Notification.GetImage(_handle, NotiImage.Indicator, out pathPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get indicator icon image path");
+ return string.Empty;
+ }
+
+ if (pathPtr == IntPtr.Zero)
+ return string.Empty;
+
+ return Marshal.PtrToStringAuto(pathPtr);
+ }
+ set
+ {
+ int ret = Interop.Notification.SetImage(_handle, NotiImage.Indicator, value);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set indicator icon image path");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets Background image Path. Defaults to string.Empty.
+ /// </summary>
+ public string BackgroundImagePath
+ {
+ get
+ {
+ IntPtr pathPtr;
+ int ret = Interop.Notification.GetImage(_handle, NotiImage.Background, out pathPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get background path");
+ return string.Empty;
+ }
+
+ if (pathPtr == IntPtr.Zero)
+ return string.Empty;
+
+ return Marshal.PtrToStringAuto(pathPtr);
+ }
+ set
+ {
+ int ret = Interop.Notification.SetImage(_handle, NotiImage.Background, value);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set background path");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets SubIcon image Path. Defaults to empty string.
+ /// </summary>
+ public string SubIconPath
+ {
+ get
+ {
+ IntPtr pathPtr;
+ int ret = Interop.Notification.GetImage(_handle, NotiImage.SubIcon, out pathPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get sub icon path");
+ return string.Empty;
+ }
+
+ if (pathPtr == IntPtr.Zero)
+ return string.Empty;
+
+ return Marshal.PtrToStringAuto(pathPtr);
+ }
+ set
+ {
+ int ret = Interop.Notification.SetImage(_handle, NotiImage.SubIcon, value);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set sub icon path");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets Tag. Defaults to empty string.
+ /// </summary>
+ public string Tag
+ {
+ get
+ {
+ IntPtr tagPtr;
+ int ret = Interop.Notification.GetTag(_handle, out tagPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get tag");
+ return string.Empty;
+ }
+
+ if (tagPtr == IntPtr.Zero)
+ return string.Empty;
+
+ return Marshal.PtrToStringAuto(tagPtr);
+ }
+ set
+ {
+ int ret = Interop.Notification.SetTag(_handle, value);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set tag");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets Areas to display the notification. Defaults to NotificaitonTray | Ticker | Indicator.
+ /// </summary>
+ public NotificationArea NotificationArea
+ {
+ get
+ {
+ int appList;
+ int ret = Interop.Notification.GetApplist(_handle, out appList);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable get applist");
+ return NotificationArea.None;
+ }
+
+ return (NotificationArea)appList;
+ }
+ set
+ {
+ int ret = Interop.Notification.SetApplist(_handle, (int)value);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set applist");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets the Notification Type.
+ /// </summary>
+ public NotificationType NotificationType
+ {
+ get;
+ protected set;
+ }
+
+ /// <summary>
+ /// Gets and sets the Led on and off time. Defaults to 0 for both.
+ /// </summary>
+ public LedBlinkPeriod LedBlinkPeriod
+ {
+ get
+ {
+ int on;
+ int off;
+ int ret = Interop.Notification.GetLedTimePeriod(_handle, out on, out off);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get led time period");
+ return new LedBlinkPeriod(0,0);
+ }
+
+ return new LedBlinkPeriod(on, off);
+ }
+ set
+ {
+ int ret = Interop.Notification.SetLedTimePeriod(_handle, value.OnTime, value.OffTime);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set led time period");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets value to enable/disable sound for a notification. False by default.
+ /// </summary>
+ public bool SoundEnabled
+ {
+ get
+ {
+ SoundOption enabled;
+ IntPtr pathPtr;
+
+ int ret = Interop.Notification.GetSound(_handle, out enabled, out pathPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get sound enabled");
+ return false;
+ }
+
+ if(enabled >= SoundOption.Default)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ set
+ {
+ int ret;
+ if(value)
+ {
+ ret = Interop.Notification.SetSound(_handle, _soundPath == string.Empty || _soundPath == null ? SoundOption.Default : SoundOption.Custom, _soundPath);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set sound enabled ");
+ }
+ }
+ else
+ {
+ ret = Interop.Notification.SetSound(_handle, SoundOption.Off, null);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable disable sound");
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Get and set path of custom sound file to be played for notification.Defaults to string.Empty.
+ /// </summary>
+ public string SoundPath
+ {
+ get
+ {
+ SoundOption enabled;
+ IntPtr pathPtr;
+ int ret = Interop.Notification.GetSound(_handle, out enabled, out pathPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get sound path");
+ return string.Empty;
+ }
+
+ if(pathPtr != IntPtr.Zero)
+ _soundPath = Marshal.PtrToStringAuto(pathPtr);
+
+ return _soundPath;
+ }
+ set
+ {
+ int ret;
+ IntPtr pathPtr;
+ SoundOption enabled;
+
+ ret = Interop.Notification.GetSound(_handle, out enabled, out pathPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to get sound enabled");
+ }
+
+ if(enabled >= SoundOption.Default)
+ {
+ ret = Interop.Notification.SetSound(_handle, value == string.Empty || _soundPath == null ? SoundOption.Default : SoundOption.Custom, value);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set sound path");
+ }
+ }
+
+ _soundPath = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets value to enable/disable vibration for a notification. Defaults to false;
+ /// </summary>
+ public bool VibrationEnabled
+ {
+ get
+ {
+ VibrationOption enabled;
+ IntPtr pathPtr;
+ int ret = Interop.Notification.GetVibration(_handle, out enabled, out pathPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get vibration enabled");
+ return false;
+ }
+
+ if(enabled >= VibrationOption.Default)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ set
+ {
+ int ret;
+ if(value)
+ {
+ ret = Interop.Notification.SetVibration(_handle, _vibrationPath == null ? VibrationOption.Default : VibrationOption.Custom, _vibrationPath);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set vibration enabled ");
+ }
+ }
+ else
+ {
+ ret = Interop.Notification.SetVibration(_handle, VibrationOption.Off, null);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable disable vibration");
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Get and sets value to enable/disable led. Defaults to false.
+ /// </summary>
+ public bool LedEnabled
+ {
+ get
+ {
+ LedOption enabled;
+ int c;
+ int ret = Interop.Notification.GetLed(_handle, out enabled, out c);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get led enabled");
+ return false;
+ }
+
+ if(enabled >= LedOption.On)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ set
+ {
+ int ret;
+ if(value)
+ {
+ ret = Interop.Notification.SetLed(_handle, LedOption.On, _ledColor.Argb);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set led enabled");
+ }
+ }
+ else
+ {
+ ret = Interop.Notification.SetLed(_handle, LedOption.Off, 0);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set led enabled");
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets custom led color for led. Default to Color(0, 0, 0, 0).
+ /// </summary>
+ public Color LedColor
+ {
+ get
+ {
+ LedOption enabled;
+ int c;
+ int ret = Interop.Notification.GetLed(_handle, out enabled, out c);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get led color");
+ return _ledColor;
+ }
+
+ if(c != 0)
+ _ledColor = new Color(c >> 16 & 255, c >> 8 & 255, c >> 0 & 255, c >> 24 & 255);
+
+ return _ledColor;
+ }
+ set
+ {
+ LedOption enabled;
+ int c;
+ int ret = Interop.Notification.GetLed(_handle, out enabled, out c);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to get led enabled");
+ }
+
+ if(enabled >= LedOption.On)
+ {
+ ret = Interop.Notification.SetLed(_handle, LedOption.On, value.Argb);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set led color");
+ }
+ }
+
+ _ledColor = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets value to enable/disable Volatile Display property. Defaults to false.
+ /// </summary>
+ public bool VolatileDisplayEnabled
+ {
+ get
+ {
+ int result;
+ int ret = Interop.Notification.GetProperties(_handle, out result);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get disable app launch");
+ return false;
+ }
+
+ if((result & VolatileDisplayMask) != 0)
+ return true;
+ else
+ return false;
+ }
+ set
+ {
+ int result = 0;
+
+ int ret = Interop.Notification.GetProperties(_handle, out result);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to get property values");
+ }
+
+ if(value)
+ result = result | VolatileDisplayMask;
+ else
+ result = result & ~VolatileDisplayMask;
+
+ ret = Interop.Notification.SetProperties(_handle, result);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set properties");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets and sets Thumbnail path for notification. Defaults to string.Empty.
+ /// </summary>
+ public string ThumbnailPath
+ {
+ get
+ {
+ IntPtr pathPtr;
+ string path;
+ int ret = Interop.Notification.GetImage(_handle, NotiImage.Thumbnail, out pathPtr);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "unable to get thumbnail Path");
+ return string.Empty;
+ }
+
+ if(pathPtr == IntPtr.Zero)
+ return string.Empty;
+
+ path = Marshal.PtrToStringAuto(pathPtr);
+ return path;
+ }
+ set
+ {
+ int ret = Interop.Notification.SetImage(_handle, NotiImage.Thumbnail, value);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set thumbnail path");
+ }
+ }
+ }
+
+ /// <summary>
+ /// Method for setting Notification Appcontrol which is invoked when notification is clicked
+ /// </summary>
+ /// <param name="app">AppControl object to set</param>
+ public void SetLaunchAppControl(AppControl app)
+ {
+ if(app == null)
+ {
+ throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
+ }
+
+ int ret = Interop.Notification.SetAppControl(_handle, LaunchOption.AppControl, app.SafeAppControlHandle);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set app control");
+ }
+ }
+
+ /// <summary>
+ /// Method for getting Notification AppControl which will be invoked when notification is clicked
+ /// </summary>
+ /// <returns>AppControl object which was set</returns>
+ public AppControl GetLaunchAppControl()
+ {
+ SafeAppControlHandle app;
+ int ret = Interop.Notification.GetAppControl(_handle, LaunchOption.AppControl, out app);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to get app control");
+ }
+
+ if(app.IsInvalid)
+ return null;
+
+ return new AppControl(app);
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+
+namespace Tizen.Applications.Notifications
+{
+ /// <summary>
+ /// Enumeration for Notification Type
+ /// </summary>
+ public enum NotificationType : short
+ {
+ /// <summary>
+ /// Value representing thumbnail and event notifications
+ /// </summary>
+ Event = 0,
+ /// <summary>
+ /// Value representing progress notifications
+ /// </summary>
+ Progress
+ }
+
+ /// <summary>
+ /// Enumeration for Notification applications
+ /// </summary>
+ [Flags]
+ public enum NotificationArea
+ {
+ /// <summary>
+ /// Value for applying no applist. Default
+ /// </summary>
+ None = 0,
+ /// <summary>
+ /// Value for notification tray app
+ /// </summary>
+ NotificationTray = 1,
+ /// <summary>
+ /// Value for ticker app
+ /// </summary>
+ Ticker = 1 << 1,
+ /// <summary>
+ /// Value for indicator app
+ /// </summary>
+ Indicator = 1 << 3,
+ /// <summary>
+ /// Value for active notification
+ /// </summary>
+ Active = 1 << 4
+ }
+
+ /// <summary>
+ /// Enumeration for Button indices for Base Notifications
+ /// </summary>
+ public enum ButtonIndex : short
+ {
+ /// <summary>
+ /// Value for first index
+ /// </summary>
+ Positive = 0,
+ /// <summary>
+ /// Value for second index
+ /// </summary>
+ Negative
+ }
+
+ internal enum SoundOption
+ {
+ Off = -1,
+ Default,
+ Custom
+ }
+
+ internal enum VibrationOption
+ {
+ Off = -1,
+ Default,
+ Custom
+ }
+
+ internal enum LedOption
+ {
+ Off = -1,
+ On = 1
+ }
+
+ internal enum NotiLayout
+ {
+ SingleEvent = 1,
+ Thumbnail = 3,
+ Progress = 5
+ }
+
+ internal enum NotiText
+ {
+ Title = 0,
+ Content,
+ EventCount = 3,
+ FirstMainText,
+ FirstSubText,
+ SecondMainText,
+ SecondSubText,
+ PositiveButton = 13,
+ NegativeButton
+ }
+
+ internal enum NotiImage
+ {
+ Icon = 0,
+ Indicator,
+ Thumbnail = 3,
+ SubIcon = 5,
+ Background,
+ PositiveButton = 12,
+ NegativeButton
+ }
+
+ internal enum LaunchOption
+ {
+ AppControl = 1
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+
+namespace Tizen.Applications.Notifications
+{
+ internal enum NotificationError
+ {
+ None = Tizen.Internals.Errors.ErrorCode.None,
+ InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+ OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+ IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+ DbError = -0x01140000 | 0x01,
+ AlreadyExists = -0x01140000 | 0x02,
+ DBusError = -0x01140000 | 0x03,
+ DoesnotExist = -0x01140000 | 0x04,
+ ServiceError = -0x01140000 | 0x05,
+ PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
+ InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation
+ }
+
+ internal static class NotificationErrorFactory
+ {
+ private const string _logTag = "Tizen.Applications.Notification";
+
+ internal static Exception GetException(NotificationError ret, string msg)
+ {
+ switch (ret)
+ {
+ case NotificationError.InvalidParameter:
+ Log.Error(_logTag, msg);
+ return new ArgumentException(ret + " error occurred.");
+ default:
+ Log.Error(_logTag, msg);
+ return new InvalidOperationException(ret + " error occurred.");
+ }
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+
+namespace Tizen.Applications.Notifications
+{
+ /// <summary>
+ /// NotificationManager class to post, update, delete and get Notifications.
+ /// </summary>
+ public static class NotificationManager
+ {
+ /// <summary>
+ /// Posts a new Notification.
+ /// </summary>
+ /// <param name="notification">Notification to post</param>
+ public static void Post(Notification notification)
+ {
+ if(notification == null)
+ {
+ throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to post method");
+ }
+
+ int ret = Interop.Notification.Post(notification._handle);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "post notification failed");
+ }
+ }
+
+ /// <summary>
+ /// Updates a posted Notification.
+ /// </summary>
+ /// <param name="notification">Notification to update</param>
+ public static void Update(Notification notification)
+ {
+ if(notification == null)
+ {
+ throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to post method");
+ }
+
+ int ret = Interop.Notification.Update(notification._handle);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "update notification failed");
+ }
+ }
+
+ /// <summary>
+ /// Deletes a posted Notification.
+ /// </summary>
+ /// <param name="notification">Notification to remove</param>
+ public static void Delete(Notification notification)
+ {
+ if(notification == null)
+ {
+ throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to post method");
+ }
+
+ int ret = Interop.Notification.Delete(notification._handle);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "delete notification failed");
+ }
+ }
+
+ /// <summary>
+ /// Removes all posted Notification of NotificationType type of calling application.
+ /// </summary>
+ /// <param name="type">Type of Notifications to remove</param>
+ public static void DeleteAll(NotificationType type)
+ {
+ int ret = Interop.Notification.DeleteAll((int)type);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "delete all notifications failed of type " + type);
+ }
+ }
+
+ /// <summary>
+ /// Removes all posted Notification of calling application.
+ /// </summary>
+ public static void DeleteAll()
+ {
+ DeleteAll(NotificationType.Progress);
+
+ DeleteAll(NotificationType.Event);
+ }
+
+ /// <summary>
+ /// Posts a message on a toast popup
+ /// </summary>
+ /// <param name="text">Text to display on popup</param>
+ public static void PostToastMessage(string text)
+ {
+ int ret = Interop.Notification.PostMessage(text);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "post toast message failed");
+ }
+ }
+
+ /// <summary>
+ /// Searches for a posted notification which has the inputted tag
+ /// </summary>
+ /// <typeparam name="T">Type of notification to be queried</typeparam>
+ /// <param name="tag">Tag used to query</param>
+ /// <returns>Notification Object with inputted tag</returns>
+ public static T Load<T>(string tag) where T : Notification
+ {
+ Notification result = null;
+ Interop.Notification.SafeNotificationHandle handle = Interop.Notification.Load(tag);
+ if(handle.IsInvalid)
+ {
+ int ret = Tizen.Internals.Errors.ErrorFacts.GetLastResult();
+
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to load Notification");
+ }
+
+ result = CreateNotificationFromTag(handle);
+
+ return (T)result;
+ }
+
+ internal static Notification CreateNotificationFromTag(Interop.Notification.SafeNotificationHandle handle)
+ {
+ Notification result = null;
+ NotificationType type;
+
+ int ret = Interop.Notification.GetType(handle, out type);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to get type");
+ }
+
+ if(type == NotificationType.Event)
+ {
+ result = (Notification)new EventNotification(handle);
+ }
+ else
+ {
+ result = (Notification)new ProgressNotification(handle);
+ }
+
+ return result;
+ }
+ }
+}
--- /dev/null
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+namespace Tizen.Applications.Notifications
+{
+ /// <summary>
+ /// Class for creating progress notifications
+ /// </summary>
+ public class ProgressNotification : Notification
+ {
+ /// <summary>
+ /// Class contructor
+ /// </summary>
+ public ProgressNotification()
+ {
+ int ret;
+
+ _handle = Interop.Notification.Create(NotificationType.Progress);
+ if (_handle.IsInvalid)
+ {
+ ret = Tizen.Internals.Errors.ErrorFacts.GetLastResult();
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to create Progress Notification");
+ }
+
+ ret = Interop.Notification.SetLayout(_handle, NotiLayout.Progress);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set progress layout");
+ }
+
+ ret = Interop.Notification.SetProgressSize(_handle, 100.0);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "unable to set default progress size");
+ }
+
+ NotificationType = NotificationType.Progress;
+ }
+
+ internal ProgressNotification(Interop.Notification.SafeNotificationHandle handle)
+ {
+ _handle = handle;
+
+ NotificationType = NotificationType.Progress;
+ }
+
+ /// <summary>
+ /// Gets and sets maximum value for progress ticker. Defaults to 100.
+ /// </summary>
+ public double Maximum
+ {
+ get
+ {
+ double size;
+ int ret = Interop.Notification.GetProgressSize(_handle, out size);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "get progress size failed");
+ return 100.0;
+ }
+
+ return size;
+ }
+ set
+ {
+ if(value < 0)
+ {
+ throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "wrong value for progress size");
+ }
+
+ int ret = Interop.Notification.SetProgressSize(_handle, value);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "set progress size failed");
+ }
+ }
+ }
+
+ /// <summary>
+ /// gets and sets current progress value for ticker. Defaults to 0.
+ /// </summary>
+ public double ProgressValue
+ {
+ get
+ {
+ double size;
+ int ret = Interop.Notification.GetProgress(_handle, out size);
+ if(ret != (int)NotificationError.None)
+ {
+ Log.Warn(_logTag, "get progress failed");
+ return 0;
+ }
+
+ return size;
+ }
+ set
+ {
+ if(value < 0 || value > Maximum)
+ {
+ throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "wrong value for progress value");
+ }
+
+ int ret = Interop.Notification.SetProgress(_handle, value);
+ if(ret != (int)NotificationError.None)
+ {
+ throw NotificationErrorFactory.GetException((NotificationError)ret, "set progress failed");
+ }
+ }
+ }
+ }
+}
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(appcore-agent)
BuildRequires: pkgconfig(message-port)
-BuildRequires: pkgconfig(capi-appfw-package-manager)
+BuildRequires: pkgconfig(notification)
Requires: capi-appfw-application
Requires: capi-message-port
Requires: appcore-agent
-Requires: capi-appfw-package-manager
+Requires: notification
%description
Tizen API for C#