From f8ab7d8fc088450c68ea659464c330eef118f454 Mon Sep 17 00:00:00 2001 From: Myungki Lee Date: Fri, 7 Jul 2017 16:33:16 +0900 Subject: [PATCH] Updates something by API reviewer request - Adds new feature for tizen tv - Updates summary Change-Id: Ifdb43ea01157add557806aaec9bff3b4e1045f4e Signed-off-by: Myungki Lee --- .../Interop/Interop.Notification.cs | 6 +++ .../Notification.cs | 55 ++++++++++++---------- .../NotificationAccessorySet.cs | 15 +++--- .../NotificationActiveStyle.cs | 34 +++++++++++++ .../NotificationBinder.cs | 4 +- .../NotificationButtonAction.cs | 1 + .../NotificationEnumerations.cs | 7 ++- .../NotificationManager.cs | 8 ++-- .../NotificationReplyAction.cs | 4 +- .../NotificationStyleBinder.cs | 36 ++++++++++++++ .../Interop/Interop.NotificationEventListener.cs | 3 ++ .../NotificationEventArgs.cs | 20 ++++---- .../NotificationEventArgsActiveStyle.cs | 26 ++++++++++ .../NotificationEventArgsBinder.cs | 7 ++- .../NotificationEventArgsEnumerations.cs | 5 ++ .../NotificationListenerManager.cs | 14 +++--- .../NotificationReplyActionArgsBinder.cs | 2 +- .../NotificationStyleArgsBinder.cs | 21 +++++++++ 18 files changed, 206 insertions(+), 62 deletions(-) diff --git a/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs b/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs index e865ab1..854e1aa 100755 --- a/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs +++ b/src/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/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs index ec7202a..d0f9c7f 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs @@ -36,7 +36,7 @@ namespace Tizen.Applications.Notifications private bool disposed = false; private IDictionary styleDictionary; - private IDictionary extenderDictionary; + private IDictionary extraDataDictionary; private int count = 0; /// @@ -45,7 +45,7 @@ namespace Tizen.Applications.Notifications public Notification() { styleDictionary = new Dictionary(); - extenderDictionary = new Dictionary(); + extraDataDictionary = new Dictionary(); } /// @@ -60,12 +60,14 @@ namespace Tizen.Applications.Notifications /// /// Gets or sets icon of Notification. + /// An absolute path for an image file. /// public string Icon { get; set; } = string.Empty; /// /// 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. /// public string SubIcon { get; set; } = string.Empty; @@ -177,9 +179,9 @@ namespace Tizen.Applications.Notifications /// /// 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. /// - public bool IsDisplay { get; set; } = true; + public bool IsVisible { get; set; } = true; /// /// Gets or sets NotificationSafeHandle @@ -304,7 +306,7 @@ namespace Tizen.Applications.Notifications } /// - /// Method to set extender data to add extra data + /// Method to set extra data to add extra data /// /// /// 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); /// /// - 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); } } /// - /// Method to remove extender you already added. + /// Method to remove extra you already added. /// /// /// The type of extra data is Bundle. /// /// The key of the extra data to add. /// Thrown when argument is invalid - 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 } /// - /// Method to get extender data you already set + /// Method to get extra data you already set /// /// The key of the extra data to get. - /// Bundle Object that include extender data + /// Bundle Object that include extra data /// Thrown when argument is invalid - 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 GetExtenderDictionary() + internal IDictionary 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/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs index ec7958d..948c8de 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs +++ b/src/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. /// /// - /// 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. /// public AccessoryOption SoundOption { get; set; } = AccessoryOption.Off; /// /// Gets or sets the sound path, It will play on the sound file you set. + /// An absolute path for a sound file. /// public string SoundPath { get; set; } @@ -52,29 +53,29 @@ namespace Tizen.Applications.Notifications public bool CanVibrate { get; set; } = false; /// - /// Gets or sets the led option. Default to AccessoryOption.Off. + /// Gets or sets the led option. The default value is AccessoryOption.Off. /// /// - /// 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. /// public AccessoryOption LedOption { get; set; } = AccessoryOption.Off; /// - /// 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. /// /// /// 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. /// public int LedOnMillisecond { get; set; } /// - /// 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. /// /// /// 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. /// public int LedOffMillisecond { get; set; } diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs index d7b9d7f..005e508 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs @@ -112,6 +112,40 @@ namespace Tizen.Applications.Notifications public ReplyAction ReplyAction { get; set; } /// + /// Gets or sets Action which is invoked when notification is hidden by user. + /// + /// + /// 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 + /// + /// + public AppControl HiddenByUserAction { get; set; } + + /// + /// Gets or sets Action which is invoked when there is no any response by user until hide timeout. + /// + /// + /// 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 + /// + /// + public AppControl HiddenByTimeoutAction { get; set; } + + /// + /// Gets or sets Action which is invoked when the notification is hidden by external factor. + /// + /// + /// 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 + /// + /// + public AppControl HiddenByExternalAction { get; set; } + + /// /// Gets the key of ActiveStyle /// internal override string Key diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs index 2d7eb4b..e7c6c21 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs +++ b/src/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/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs index c4c2ed5..c291e82 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs @@ -46,6 +46,7 @@ namespace Tizen.Applications.Notifications /// /// Gets or sets the image path that represent the button + /// An absolute path for an image file. /// public string ImagePath { get; set; } diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs index 7cb41d9..459bfd4 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs @@ -100,7 +100,7 @@ namespace Tizen.Applications.Notifications /// /// Value for display only SIM card inserted /// - DisplayOnlySimmode = 0x01, + DisplayOnlySimMode = 0x01, /// /// 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/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs index 1a890f3..bf80eab 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs @@ -234,15 +234,15 @@ namespace Tizen.Applications.Notifications } /// - /// 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. /// /// /// 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. /// /// Tag used to query - /// Notification Object with inputted tag - /// Thrown when argument is invalid or when the tag does not exist + /// Notification Object with specified tag + /// Throwing the same exception when argument is invalid and when the tag does not exist is misleading /// Thrown in case of permission denied. /// Thrown in case of any internal error. /// @@ -356,7 +356,7 @@ namespace Tizen.Applications.Notifications /// /// Template name /// Notification Object with inputted template name - /// Thrown when argument is invalid or when no template with input name exists + /// Throwing the same exception when argument is invalid and when the template does not exist is misleading /// Thrown in case of permission denied. /// Thrown in case of any internal error. /// diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs index f3bc10a..3b828d9 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs @@ -27,7 +27,7 @@ namespace Tizen.Applications.Notifications public sealed partial class Notification { /// - /// 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. /// public sealed class ReplyAction : MakerBase @@ -46,7 +46,7 @@ namespace Tizen.Applications.Notifications public string PlaceHolderText { get; set; } /// - /// 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. /// /// diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs index 587c6ef..a442e51 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs +++ b/src/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/src/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs b/src/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs index 1e8b413..708a5ad 100755 --- a/src/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs +++ b/src/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/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs index 9f348f6..ba2ed0d 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs +++ b/src/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 Style; - internal IDictionary Extender; + internal IDictionary ExtraData; internal Interop.NotificationEventListener.NotificationSafeHandle Handle; /// @@ -37,7 +37,7 @@ namespace Tizen.Applications.NotificationEventListener public NotificationEventArgs() { Style = new Dictionary(); - Extender = new Dictionary(); + ExtraData = new Dictionary(); } /// @@ -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. /// - 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; } /// - /// Gets the key for extender. + /// Gets the key for extra data. /// - public ICollection ExtenderKey + public ICollection ExtraDataKey { get { - return Extender.Keys; + return ExtraData.Keys; } } @@ -161,11 +161,11 @@ namespace Tizen.Applications.NotificationEventListener } /// - /// Gets the ExtenderArgs. + /// Gets the ExtraDataArgs. /// - /// The key that specifies which extender + /// The key that specifies which extra data /// Returns the bundle for key - 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/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs index 7495ffc..d3aecc6 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs +++ b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs @@ -67,6 +67,32 @@ namespace Tizen.Applications.NotificationEventListener public int DeleteTimeout { get; internal set; } /// + /// Gets Action which is invoked 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 + /// + public AppControl HiddenByUserAction { get; internal set; } + + /// + /// Gets or sets Action which is invoked when there is no any response by user until hide timeout. + /// + /// + /// The property is only reflected on Tizen TV. + /// If you use this API on other profile, this action settings have no effect + /// + public AppControl HiddenByTimeoutAction { get; internal set; } + + /// + /// Gets or sets Action which is invoked when the notification is hidden by external factor. + /// + /// + /// If you use this API on other profile, this action settings have no effect + /// + public AppControl HiddenByExternalAction { get; internal set; } + + /// /// Gets a button to this active notification style. /// Buttons are displayed in the notification content. /// diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs index e38f331..d30292e 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs +++ b/src/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/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs index 348a016..8adcf93 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs +++ b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs @@ -156,6 +156,11 @@ namespace Tizen.Applications.NotificationEventListener HiddenByTimeout = 101, /// + /// Event type : Deleted by timer + /// + HiddenByExternal = 102, + + /// /// Event type : Clicked by user /// ClickOnNotification = 200, diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs index 5f02395..b1baf13 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs +++ b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs @@ -61,13 +61,13 @@ namespace Tizen.Applications.NotificationEventListener } /// - /// Registers a callback for notification insert event. + /// Event handler for notification insert event. /// /// Thrown in case of Invalid parameter. /// Thrown in case of Permission deny. /// Thrown in case of any internal error. /// http://tizen.org/privilege/notification - public static event EventHandler NotificationAddEventHandler + public static event EventHandler Added { add { @@ -107,13 +107,13 @@ namespace Tizen.Applications.NotificationEventListener } /// - /// Registers a callback for notification update event. + /// Event handler for notification update event. /// /// Thrown in case of Invalid parameter. /// Thrown in case of Permission deny. /// Thrown in case of any internal error. /// http://tizen.org/privilege/notification - public static event EventHandler NotificationUpdateEventHandler + public static event EventHandler Updated { add { @@ -153,13 +153,13 @@ namespace Tizen.Applications.NotificationEventListener } /// - /// Registers a callback for notification delete event. + /// Event handler for notification delete event. /// /// Thrown in case of Invalid parameter. /// Thrown in case of Permission deny. /// Thrown in case of any internal error. /// http://tizen.org/privilege/notification - public static event EventHandler NotificationDeleteEventHandler + public static event EventHandler Deleted { add { @@ -334,7 +334,7 @@ namespace Tizen.Applications.NotificationEventListener } /// - /// Returns the notification list handle. + /// Returns the notification list. /// /// Thrown in case of Permission deny. /// Thrown in case of any internal error. diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs index a851009..98a9da9 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs +++ b/src/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/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs index f45e4aa..e6d81ad 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs +++ b/src/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); } -- 2.7.4