summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyungki Lee <mk5004.lee@samsung.com>2017-07-07 16:33:16 +0900
committerSeungha Son <seungha.son@samsung.com>2017-08-10 15:27:46 +0900
commit81de2a7f5991fa1797edbd5800a0288410c206b8 (patch)
tree9ed99b23cb27b85e3b5a3111487aa877bf154920
parent90cfd6da065b0cf1d8a34338c759406dfc6a989f (diff)
downloadapplication-81de2a7f5991fa1797edbd5800a0288410c206b8.tar.gz
application-81de2a7f5991fa1797edbd5800a0288410c206b8.tar.bz2
application-81de2a7f5991fa1797edbd5800a0288410c206b8.zip
Updates something by API reviewer request
- Adds new feature for tizen tv - Updates summary Change-Id: Ifdb43ea01157add557806aaec9bff3b4e1045f4e Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
-rwxr-xr-xTizen.Applications.Notification/Interop/Interop.Notification.cs6
-rwxr-xr-xTizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs55
-rwxr-xr-xTizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs15
-rwxr-xr-xTizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs34
-rwxr-xr-xTizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs4
-rwxr-xr-xTizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs1
-rwxr-xr-xTizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs7
-rwxr-xr-xTizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs8
-rwxr-xr-xTizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs4
-rwxr-xr-xTizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs36
-rwxr-xr-xTizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs3
-rwxr-xr-xTizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs20
-rwxr-xr-xTizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs26
-rwxr-xr-xTizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs7
-rwxr-xr-xTizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs5
-rwxr-xr-xTizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs14
-rwxr-xr-xTizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs2
-rwxr-xr-xTizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs21
18 files changed, 206 insertions, 62 deletions
diff --git a/Tizen.Applications.Notification/Interop/Interop.Notification.cs b/Tizen.Applications.Notification/Interop/Interop.Notification.cs
index e865ab1..854e1aa 100755
--- a/Tizen.Applications.Notification/Interop/Interop.Notification.cs
+++ b/Tizen.Applications.Notification/Interop/Interop.Notification.cs
@@ -218,6 +218,12 @@ internal static partial class Interop
[DllImport(Libraries.Notification, EntryPoint = "notification_set_default_button")]
internal static extern NotificationError SetDefaultButton(NotificationSafeHandle handle, int index);
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_extension_event_handler")]
+ internal static extern NotificationError SetExtensionAction(NotificationSafeHandle handle, NotificationEventType type, SafeAppControlHandle appcontrol);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_extension_event_handler")]
+ internal static extern NotificationError GetExtensionAction(NotificationSafeHandle handle, NotificationEventType type, out SafeAppControlHandle appcontrol);
+
internal static NotificationError GetText(NotificationSafeHandle handle, NotificationText type, out string text)
{
NotificationError ret;
diff --git a/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs b/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs
index ec7202a..d0f9c7f 100755
--- a/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs
+++ b/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs
@@ -36,7 +36,7 @@ namespace Tizen.Applications.Notifications
private bool disposed = false;
private IDictionary<string, StyleBase> styleDictionary;
- private IDictionary<string, Bundle> extenderDictionary;
+ private IDictionary<string, Bundle> extraDataDictionary;
private int count = 0;
/// <summary>
@@ -45,7 +45,7 @@ namespace Tizen.Applications.Notifications
public Notification()
{
styleDictionary = new Dictionary<string, StyleBase>();
- extenderDictionary = new Dictionary<string, Bundle>();
+ extraDataDictionary = new Dictionary<string, Bundle>();
}
/// <summary>
@@ -60,12 +60,14 @@ namespace Tizen.Applications.Notifications
/// <summary>
/// Gets or sets icon of Notification.
+ /// An absolute path for an image file.
/// </summary>
public string Icon { get; set; } = string.Empty;
/// <summary>
/// Gets or sets sub icon of Notification.
- /// This SubIcon is displayed in Icon you set.
+ /// An absolute path for an image file.
+ /// The SubIcon is superimposed on the lower right of the icon.
/// </summary>
public string SubIcon { get; set; } = string.Empty;
@@ -177,9 +179,9 @@ namespace Tizen.Applications.Notifications
/// <summary>
/// Gets or sets a value indicating whether notification is displayed on default viewer.
- /// If you set false and add style, you can see only style notification.
+ /// If you set false and add style, It will be shown only on the style you added.
/// </summary>
- public bool IsDisplay { get; set; } = true;
+ public bool IsVisible { get; set; } = true;
/// <summary>
/// Gets or sets NotificationSafeHandle
@@ -304,7 +306,7 @@ namespace Tizen.Applications.Notifications
}
/// <summary>
- /// Method to set extender data to add extra data
+ /// Method to set extra data to add extra data
/// </summary>
/// <remarks>
/// The type of extra data is Bundle.
@@ -324,46 +326,46 @@ namespace Tizen.Applications.Notifications
/// Bundle bundle = new Bundle();
/// bundle.AddItem("key", "value");
///
- /// notification.SetExtender("firstKey", bundle);
+ /// notification.SetExtraData("firstKey", bundle);
/// </code>
/// </example>
- public void SetExtender(string key, Bundle value)
+ public void SetExtraData(string key, Bundle value)
{
if (value == null || value.SafeBundleHandle.IsInvalid || string.IsNullOrEmpty(key))
{
throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
}
- if (extenderDictionary.ContainsKey(key) == true)
+ if (extraDataDictionary.ContainsKey(key) == true)
{
Log.Info(LogTag, "The key is existed, so extender data is replaced");
- extenderDictionary.Remove(key);
- extenderDictionary.Add(key, value);
+ extraDataDictionary.Remove(key);
+ extraDataDictionary.Add(key, value);
}
else
{
- extenderDictionary.Add(key, value);
+ extraDataDictionary.Add(key, value);
}
}
/// <summary>
- /// Method to remove extender you already added.
+ /// Method to remove extra you already added.
/// </summary>
/// <remarks>
/// The type of extra data is Bundle.
/// </remarks>
/// <param name="key">The key of the extra data to add.</param>
/// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
- public void RemoveExtender(string key)
+ public void RemoveExtraData(string key)
{
if (string.IsNullOrEmpty(key))
{
throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered");
}
- if (extenderDictionary.ContainsKey(key))
+ if (extraDataDictionary.ContainsKey(key))
{
- extenderDictionary.Remove(key);
+ extraDataDictionary.Remove(key);
}
else
{
@@ -372,12 +374,12 @@ namespace Tizen.Applications.Notifications
}
/// <summary>
- /// Method to get extender data you already set
+ /// Method to get extra data you already set
/// </summary>
/// <param name="key">The key of the extra data to get.</param>
- /// <returns>Bundle Object that include extender data</returns>
+ /// <returns>Bundle Object that include extra data</returns>
/// <exception cref="ArgumentException">Thrown when argument is invalid</exception>
- public Bundle GetExtender(string key)
+ public Bundle GetExtraData(string key)
{
if (string.IsNullOrEmpty(key))
{
@@ -385,7 +387,7 @@ namespace Tizen.Applications.Notifications
}
Bundle bundle;
- if (extenderDictionary.TryGetValue(key, out bundle) == false)
+ if (extraDataDictionary.TryGetValue(key, out bundle) == false)
{
throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered : " + key);
}
@@ -422,9 +424,9 @@ namespace Tizen.Applications.Notifications
return styleDictionary;
}
- internal IDictionary<string, Bundle> GetExtenderDictionary()
+ internal IDictionary<string, Bundle> GetextraDataDictionary()
{
- return extenderDictionary;
+ return extraDataDictionary;
}
internal StyleBase GetStyle(string key)
@@ -448,10 +450,10 @@ namespace Tizen.Applications.Notifications
{
NotificationBinder.BindObject(this);
- foreach (string key in GetExtenderDictionary().Keys)
+ foreach (string key in GetextraDataDictionary().Keys)
{
Log.Info(LogTag, "Start to bind Notification.ExtenderData to SafeHandle");
- Interop.Notification.SetExtentionData(Handle, key, extenderDictionary[key].SafeBundleHandle);
+ Interop.Notification.SetExtentionData(Handle, key, extraDataDictionary[key].SafeBundleHandle);
}
foreach (Notification.StyleBase style in styleDictionary.Values)
@@ -487,9 +489,12 @@ namespace Tizen.Applications.Notifications
Bundle bundle = new Bundle(new SafeBundleHandle(extention, false));
foreach (string key in bundle.Keys)
{
+ if (key.StartsWith("_NOTIFICATION_EXTENSION_EVENT_"))
+ continue;
+
SafeBundleHandle sbh;
Interop.Notification.GetExtentionData(Handle, key, out sbh);
- extenderDictionary.Add(key, new Bundle(sbh));
+ extraDataDictionary.Add(key, new Bundle(sbh));
}
}
diff --git a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs
index ec7958d..948c8de 100755
--- a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs
+++ b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs
@@ -37,12 +37,13 @@ namespace Tizen.Applications.Notifications
/// Gets or sets the sound option. Default to AccessoryOption.Off.
/// </summary>
/// <remarks>
- /// If you set AccessoryOption.Custom and not set SoundPath, then turn on the default sound.
+ /// If you set AccessoryOption.Custom, you must the SoundPath. Otherwise, an exception is thrown.
/// </remarks>
public AccessoryOption SoundOption { get; set; } = AccessoryOption.Off;
/// <summary>
/// Gets or sets the sound path, It will play on the sound file you set.
+ /// An absolute path for a sound file.
/// </summary>
public string SoundPath { get; set; }
@@ -52,29 +53,29 @@ namespace Tizen.Applications.Notifications
public bool CanVibrate { get; set; } = false;
/// <summary>
- /// Gets or sets the led option. Default to AccessoryOption.Off.
+ /// Gets or sets the led option. The default value is AccessoryOption.Off.
/// </summary>
/// <remarks>
- /// If you set AccessoryOption.Custom and not set LedColor, then turn on the LED with default color.
+ /// If you set AccessoryOption.Custom and not set LedColor, the LED will show default color.
/// </remarks>
public AccessoryOption LedOption { get; set; } = AccessoryOption.Off;
/// <summary>
- /// Gets or sets the led on time period that you would like the LED on the device to blink. as well as the rate
+ /// Gets or sets the on time so that it looks like the device's LED is blinking.
/// </summary>
/// <remarks>
/// Default value of LedOnMillisecond is 0.
/// The rate is specified in terms of the number of Milliseconds to be on.
- /// You should always set LedOnMillisecond with LedOffMillisecond. Otherwise, it may not operate normally.
+ /// You must set the on and off times at the same time. Otherwise, it may not operate normally.
/// </remarks>
public int LedOnMillisecond { get; set; }
/// <summary>
- /// Gets or sets the led on time period that you would like the LED on the device to blink. as well as the rate.
+ /// Gets or sets the off time so that it looks like the device's LED is blinking.
/// </summary>
/// <remarks>
/// The rate is specified in terms of the number of Milliseconds to be off.
- /// You should always set LedOffMillisecond with LedOnMillisecond. Otherwise, it may not operate normally.
+ /// You must set the on and off times at the same time. Otherwise, it may not operate normally.
/// </remarks>
public int LedOffMillisecond { get; set; }
diff --git a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs
index d7b9d7f..005e508 100755
--- a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs
+++ b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs
@@ -112,6 +112,40 @@ namespace Tizen.Applications.Notifications
public ReplyAction ReplyAction { get; set; }
/// <summary>
+ /// Gets or sets Action which is invoked when notification is hidden by user.
+ /// </summary>
+ /// <remarks>
+ /// If you set it to null, the already set AppControl will be removed and nothing will happen when notification is hidden by user.
+ /// The property is only reflected on Tizen TV.
+ /// If you use this API on other profile, this action have no effect
+ /// </remarks>
+ /// <seealso cref="Tizen.Applications.AppControl"></seealso>
+ public AppControl HiddenByUserAction { get; set; }
+
+ /// <summary>
+ /// Gets or sets Action which is invoked when there is no any response by user until hide timeout.
+ /// </summary>
+ /// <remarks>
+ /// This action occurs when there is no response to the notification until the delete timeout set by SetRemoveTime().
+ /// If you set it to null, the already set AppControl will be removed and nothing will happen when notification is hidden by timeout.
+ /// The property is only reflected on Tizen TV.
+ /// If you use this API on other profile, this action settings have no effect
+ /// </remarks>
+ /// <seealso cref="Tizen.Applications.AppControl"></seealso>
+ public AppControl HiddenByTimeoutAction { get; set; }
+
+ /// <summary>
+ /// Gets or sets Action which is invoked when the notification is hidden by external factor.
+ /// </summary>
+ /// <remarks>
+ /// If you set it to null, the already set AppControl will be removed and nothing will happen when notification is hidden by external factor.
+ /// The property is only reflected on Tizen TV.
+ /// If you use this API on other profile, this action settings have no effect
+ /// </remarks>
+ /// <seealso cref="Tizen.Applications.AppControl"></seealso>
+ public AppControl HiddenByExternalAction { get; set; }
+
+ /// <summary>
/// Gets the key of ActiveStyle
/// </summary>
internal override string Key
diff --git a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs
index 2d7eb4b..e7c6c21 100755
--- a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs
+++ b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs
@@ -30,7 +30,7 @@ namespace Tizen.Applications.Notifications
Interop.Notification.SetID(notification.Handle, notification.PrivID);
- if (notification.IsDisplay)
+ if (notification.IsVisible)
{
Interop.Notification.SetApplist(notification.Handle, (int)NotificationDisplayApplist.Tray);
}
@@ -78,7 +78,7 @@ namespace Tizen.Applications.Notifications
Interop.Notification.GetApplist(notification.Handle, out appList);
if ((appList & (int)NotificationDisplayApplist.Tray) == 0)
{
- notification.IsDisplay = false;
+ notification.IsVisible = false;
}
BindSafeHandleText(notification);
diff --git a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs
index c4c2ed5..c291e82 100755
--- a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs
+++ b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs
@@ -46,6 +46,7 @@ namespace Tizen.Applications.Notifications
/// <summary>
/// Gets or sets the image path that represent the button
+ /// An absolute path for an image file.
/// </summary>
public string ImagePath { get; set; }
diff --git a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs
index 7cb41d9..459bfd4 100755
--- a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs
+++ b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs
@@ -100,7 +100,7 @@ namespace Tizen.Applications.Notifications
/// <summary>
/// Value for display only SIM card inserted
/// </summary>
- DisplayOnlySimmode = 0x01,
+ DisplayOnlySimMode = 0x01,
/// <summary>
/// Value for disable application launch when it selected
@@ -153,7 +153,10 @@ namespace Tizen.Applications.Notifications
ThirdButton,
ClickOnIcon = 6,
ClockOnThumbnail = 7,
- ClickOnTextInputButton = 8
+ ClickOnTextInputButton = 8,
+ HiddenByUser = 100,
+ HiddenByTimeout = 101,
+ HiddenByExternal = 102,
}
internal enum NotificationLayout
diff --git a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs
index 1a890f3..bf80eab 100755
--- a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs
+++ b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs
@@ -234,15 +234,15 @@ namespace Tizen.Applications.Notifications
}
/// <summary>
- /// Searches for a posted notification which has the inputted tag and isn't deleted not yet.
+ /// Searches for a posted notification which has the specified tag and has not been deleted yet.
/// </summary>
/// <remarks>
/// Load method should be called only for notifications which have been posted using NotificationManager.Post method.
/// If two or more notifications share the same tag, the notification posted most recently is returned.
/// </remarks>
/// <param name="tag">Tag used to query</param>
- /// <returns>Notification Object with inputted tag</returns>
- /// <exception cref="ArgumentException">Thrown when argument is invalid or when the tag does not exist</exception>
+ /// <returns>Notification Object with specified tag</returns>
+ /// <exception cref="ArgumentException">Throwing the same exception when argument is invalid and when the tag does not exist is misleading</exception>
/// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
/// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
/// <example>
@@ -356,7 +356,7 @@ namespace Tizen.Applications.Notifications
/// </summary>
/// <param name="name">Template name</param>
/// <returns>Notification Object with inputted template name</returns>
- /// <exception cref="ArgumentException">Thrown when argument is invalid or when no template with input name exists</exception>
+ /// <exception cref="ArgumentException">Throwing the same exception when argument is invalid and when the template does not exist is misleading</exception>
/// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception>
/// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
/// <example>
diff --git a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs
index f3bc10a..3b828d9 100755
--- a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs
+++ b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs
@@ -27,7 +27,7 @@ namespace Tizen.Applications.Notifications
public sealed partial class Notification
{
/// <summary>
- /// Class for displaying direct-reply at notification.
+ /// Class for displaying direct-reply on notification.
/// You must set a ReplyMax and Button. Otherwise user can't send written text to application which is set by AppControl.
/// </summary>
public sealed class ReplyAction : MakerBase
@@ -46,7 +46,7 @@ namespace Tizen.Applications.Notifications
public string PlaceHolderText { get; set; }
/// <summary>
- /// Gets or sets the ReplyMax of ReplyAction which is appeared at Notification.
+ /// Gets or sets the maximum number of characters that the user can input.
/// You must set a ReplyMax. Otherwise user don't write text to placeholder in notification.
/// </summary>
/// <value>
diff --git a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs
index 587c6ef..a442e51 100755
--- a/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs
+++ b/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs
@@ -117,6 +117,21 @@ namespace Tizen.Applications.Notifications
{
style.ReplyAction.Make(notification);
}
+
+ if (style.HiddenByUserAction != null)
+ {
+ Interop.Notification.SetExtensionAction(notification.Handle, NotificationEventType.HiddenByUser, style.HiddenByUserAction.SafeAppControlHandle);
+ }
+
+ if (style.HiddenByTimeoutAction != null)
+ {
+ Interop.Notification.SetExtensionAction(notification.Handle, NotificationEventType.HiddenByTimeout, style.HiddenByUserAction.SafeAppControlHandle);
+ }
+
+ if (style.HiddenByExternalAction != null)
+ {
+ Interop.Notification.SetExtensionAction(notification.Handle, NotificationEventType.HiddenByExternal, style.HiddenByUserAction.SafeAppControlHandle);
+ }
}
internal static void BindSafeHandle(Notification notification)
@@ -158,6 +173,27 @@ namespace Tizen.Applications.Notifications
}
}
+ appcontrol = null;
+ Interop.Notification.GetExtensionAction(notification.Handle, NotificationEventType.HiddenByUser, out appcontrol);
+ if (appcontrol != null)
+ {
+ active.HiddenByUserAction = new AppControl(appcontrol);
+ }
+
+ appcontrol = null;
+ Interop.Notification.GetExtensionAction(notification.Handle, NotificationEventType.HiddenByTimeout, out appcontrol);
+ if (appcontrol != null)
+ {
+ active.HiddenByTimeoutAction = new AppControl(appcontrol);
+ }
+
+ appcontrol = null;
+ Interop.Notification.GetExtensionAction(notification.Handle, NotificationEventType.HiddenByExternal, out appcontrol);
+ if (appcontrol != null)
+ {
+ active.HiddenByExternalAction = new AppControl(appcontrol);
+ }
+
Interop.Notification.GetAutoRemove(notification.Handle, out autoRemove);
active.IsAutoRemove = autoRemove;
if (autoRemove)
diff --git a/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs b/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs
index 1e8b413..708a5ad 100755
--- a/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs
+++ b/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs
@@ -162,6 +162,9 @@ internal static partial class Interop
[DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_default_button")]
internal static extern ErrorCode GetDefaultButton(NotificationSafeHandle handle, out int index);
+ [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_extension_event_handler")]
+ internal static extern ErrorCode GetExtensionAction(NotificationSafeHandle handle, UserEventType type, out SafeAppControlHandle appcontrol);
+
internal static ErrorCode GetAppId(NotificationSafeHandle handle, out string appid)
{
ErrorCode err;
diff --git a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs
index 9f348f6..ba2ed0d 100755
--- a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs
+++ b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs
@@ -28,7 +28,7 @@ namespace Tizen.Applications.NotificationEventListener
private const string LogTag = "Tizen.Applications.NotificationEventListener";
internal IDictionary<string, StyleArgs> Style;
- internal IDictionary<string, Bundle> Extender;
+ internal IDictionary<string, Bundle> ExtraData;
internal Interop.NotificationEventListener.NotificationSafeHandle Handle;
/// <summary>
@@ -37,7 +37,7 @@ namespace Tizen.Applications.NotificationEventListener
public NotificationEventArgs()
{
Style = new Dictionary<string, StyleArgs>();
- Extender = new Dictionary<string, Bundle>();
+ ExtraData = new Dictionary<string, Bundle>();
}
/// <summary>
@@ -100,7 +100,7 @@ namespace Tizen.Applications.NotificationEventListener
/// Gets a value that determines whether notification is displayed on the default viewer.
/// If IsDisplay property set false and add style, you can see only style notification.
/// </summary>
- public bool IsDisplay { get; internal set; } = true;
+ public bool IsVisible { get; internal set; } = true;
[EditorBrowsable(EditorBrowsableState.Never)]
public bool HasEventFlag { get; internal set; } = false;
@@ -121,13 +121,13 @@ namespace Tizen.Applications.NotificationEventListener
public AccessoryArgs Accessory { get; internal set; }
/// <summary>
- /// Gets the key for extender.
+ /// Gets the key for extra data.
/// </summary>
- public ICollection<string> ExtenderKey
+ public ICollection<string> ExtraDataKey
{
get
{
- return Extender.Keys;
+ return ExtraData.Keys;
}
}
@@ -161,11 +161,11 @@ namespace Tizen.Applications.NotificationEventListener
}
/// <summary>
- /// Gets the ExtenderArgs.
+ /// Gets the ExtraDataArgs.
/// </summary>
- /// <param name="key">The key that specifies which extender</param>
+ /// <param name="key">The key that specifies which extra data</param>
/// <returns>Returns the bundle for key</returns>
- public Bundle GetExtender(string key)
+ public Bundle GetExtraData(string key)
{
Bundle bundle;
@@ -174,7 +174,7 @@ namespace Tizen.Applications.NotificationEventListener
throw NotificationEventListenerErrorFactory.GetException(Interop.NotificationEventListener.ErrorCode.InvalidParameter, "invalid parameter entered");
}
- if (Extender.TryGetValue(key, out bundle) == false)
+ if (ExtraData.TryGetValue(key, out bundle) == false)
{
throw NotificationEventListenerErrorFactory.GetException(Interop.NotificationEventListener.ErrorCode.InvalidParameter, "invalid parameter entered : " + key);
}
diff --git a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs
index 7495ffc..d3aecc6 100755
--- a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs
+++ b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs
@@ -67,6 +67,32 @@ namespace Tizen.Applications.NotificationEventListener
public int DeleteTimeout { get; internal set; }
/// <summary>
+ /// Gets Action which is invoked when notification is hidden by user.
+ /// </summary>
+ /// <remarks>
+ /// The property is only reflected on Tizen TV.
+ /// If you use this API on other profile, this action have no effect
+ /// </remarks>
+ public AppControl HiddenByUserAction { get; internal set; }
+
+ /// <summary>
+ /// Gets or sets Action which is invoked when there is no any response by user until hide timeout.
+ /// </summary>
+ /// <remarks>
+ /// The property is only reflected on Tizen TV.
+ /// If you use this API on other profile, this action settings have no effect
+ /// </remarks>
+ public AppControl HiddenByTimeoutAction { get; internal set; }
+
+ /// <summary>
+ /// Gets or sets Action which is invoked when the notification is hidden by external factor.
+ /// </summary>
+ /// <remarks>
+ /// If you use this API on other profile, this action settings have no effect
+ /// </remarks>
+ public AppControl HiddenByExternalAction { get; internal set; }
+
+ /// <summary>
/// Gets a button to this active notification style.
/// Buttons are displayed in the notification content.
/// </summary>
diff --git a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs
index e38f331..d30292e 100755
--- a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs
+++ b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs
@@ -155,7 +155,7 @@ namespace Tizen.Applications.NotificationEventListener
Interop.NotificationEventListener.GetStyleList(eventargs.Handle, out displayList);
if ((displayList & (int)NotificationDisplayApplist.Tray) == 0)
{
- eventargs.IsDisplay = false;
+ eventargs.IsVisible = false;
}
err = Interop.NotificationEventListener.GetExtentionBundle(eventargs.Handle, out extention, out dummy);
@@ -169,9 +169,12 @@ namespace Tizen.Applications.NotificationEventListener
Bundle bundle = new Bundle(new SafeBundleHandle(extention, false));
foreach (string key in bundle.Keys)
{
+ if (key.StartsWith("_NOTIFICATION_EXTENSION_EVENT_"))
+ continue;
+
SafeBundleHandle sbh;
Interop.NotificationEventListener.GetExtender(eventargs.Handle, key, out sbh);
- eventargs.Extender.Add(key, new Bundle(sbh));
+ eventargs.ExtraData.Add(key, new Bundle(sbh));
}
}
diff --git a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs
index 348a016..8adcf93 100755
--- a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs
+++ b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs
@@ -156,6 +156,11 @@ namespace Tizen.Applications.NotificationEventListener
HiddenByTimeout = 101,
/// <summary>
+ /// Event type : Deleted by timer
+ /// </summary>
+ HiddenByExternal = 102,
+
+ /// <summary>
/// Event type : Clicked by user
/// </summary>
ClickOnNotification = 200,
diff --git a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs
index 5f02395..b1baf13 100755
--- a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs
+++ b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs
@@ -61,13 +61,13 @@ namespace Tizen.Applications.NotificationEventListener
}
/// <summary>
- /// Registers a callback for notification insert event.
+ /// Event handler for notification insert event.
/// </summary>
/// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
/// <exception cref="UnauthorizedAccessException"> Thrown in case of Permission deny.</exception>
/// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
/// <privilege>http://tizen.org/privilege/notification</privilege>
- public static event EventHandler<NotificationEventArgs> NotificationAddEventHandler
+ public static event EventHandler<NotificationEventArgs> Added
{
add
{
@@ -107,13 +107,13 @@ namespace Tizen.Applications.NotificationEventListener
}
/// <summary>
- /// Registers a callback for notification update event.
+ /// Event handler for notification update event.
/// </summary>
/// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
/// <exception cref="UnauthorizedAccessException"> Thrown in case of Permission deny.</exception>
/// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
/// <privilege>http://tizen.org/privilege/notification</privilege>
- public static event EventHandler<NotificationEventArgs> NotificationUpdateEventHandler
+ public static event EventHandler<NotificationEventArgs> Updated
{
add
{
@@ -153,13 +153,13 @@ namespace Tizen.Applications.NotificationEventListener
}
/// <summary>
- /// Registers a callback for notification delete event.
+ /// Event handler for notification delete event.
/// </summary>
/// <exception cref="ArgumentException">Thrown in case of Invalid parameter.</exception>
/// <exception cref="UnauthorizedAccessException"> Thrown in case of Permission deny.</exception>
/// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
/// <privilege>http://tizen.org/privilege/notification</privilege>
- public static event EventHandler<NotificationDeleteEventArgs> NotificationDeleteEventHandler
+ public static event EventHandler<NotificationDeleteEventArgs> Deleted
{
add
{
@@ -334,7 +334,7 @@ namespace Tizen.Applications.NotificationEventListener
}
/// <summary>
- /// Returns the notification list handle.
+ /// Returns the notification list.
/// </summary>
/// <exception cref="UnauthorizedAccessException"> Thrown in case of Permission deny.</exception>
/// <exception cref="InvalidOperationException">Thrown in case of any internal error.</exception>
diff --git a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs
index a851009..98a9da9 100755
--- a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs
+++ b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs
@@ -72,7 +72,7 @@ namespace Tizen.Applications.NotificationEventListener
isExisted = true;
}
- if (eventargs.Extender.TryGetValue(replyKey, out bundle))
+ if (eventargs.ExtraData.TryGetValue(replyKey, out bundle))
{
if (bundle.Contains(replyKey))
{
diff --git a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs
index f45e4aa..e6d81ad 100755
--- a/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs
+++ b/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs
@@ -63,6 +63,27 @@ namespace Tizen.Applications.NotificationEventListener
}
activeStyle.DeleteTimeout = timeout;
+ SafeAppControlHandle appcontrol = null;
+ Interop.NotificationEventListener.GetExtensionAction(eventargs.Handle, UserEventType.HiddenByUser, out appcontrol);
+ if (appcontrol != null)
+ {
+ activeStyle.HiddenByUserAction = new AppControl(appcontrol);
+ }
+
+ appcontrol = null;
+ Interop.NotificationEventListener.GetExtensionAction(eventargs.Handle, UserEventType.HiddenByTimeout, out appcontrol);
+ if (appcontrol != null)
+ {
+ activeStyle.HiddenByTimeoutAction = new AppControl(appcontrol);
+ }
+
+ appcontrol = null;
+ Interop.NotificationEventListener.GetExtensionAction(eventargs.Handle, UserEventType.HiddenByExternal, out appcontrol);
+ if (appcontrol != null)
+ {
+ activeStyle.HiddenByExternalAction = new AppControl(appcontrol);
+ }
+
NotificationReplyActionArgBinder.BindObject(eventargs);
}