Add check box for notification (#5342)
[platform/core/csapi/tizenfx.git] / src / Tizen.Applications.NotificationEventListener / Tizen.Applications.NotificationEventListener / NotificationEventArgsBinder.cs
index e38f331..7fb9d72 100755 (executable)
@@ -35,10 +35,13 @@ namespace Tizen.Applications.NotificationEventListener
             NotificationLayout layout;
             NotificationType type;
             string text;
-            IntPtr extention = IntPtr.Zero;
+            IntPtr extension = IntPtr.Zero;
             IntPtr dummy = IntPtr.Zero;
             SafeAppControlHandle appcontrol = null;
 
+            bool checkBoxFlag = false;
+            bool checkedValue = false;
+
             NotificationEventArgs eventargs = new NotificationEventArgs();
 
             eventargs.Handle = new Interop.NotificationEventListener.NotificationSafeHandle(notification, data);
@@ -155,23 +158,26 @@ 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);
+            err = Interop.NotificationEventListener.GetExtensionBundle(eventargs.Handle, out extension, out dummy);
             if (err != Interop.NotificationEventListener.ErrorCode.None)
             {
                 Log.Info(LogTag, "unable to get Extender");
             }
 
-            if (extention != IntPtr.Zero)
+            if (extension != IntPtr.Zero)
             {
-                Bundle bundle = new Bundle(new SafeBundleHandle(extention, false));
+                Bundle bundle = new Bundle(new SafeBundleHandle(extension, 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));
                 }
             }
 
@@ -200,6 +206,15 @@ namespace Tizen.Applications.NotificationEventListener
 
             eventargs.HasEventFlag = eventFlag;
 
+            err = Interop.NotificationEventListener.GetCheckBox(eventargs.Handle, out checkBoxFlag, out checkedValue);
+            if (err != Interop.NotificationEventListener.ErrorCode.None)
+            {
+                Log.Error(LogTag, "unable to get checkbox flag");
+            }
+
+            eventargs.CheckBox = checkBoxFlag;
+            eventargs.CheckedValue = checkedValue;
+
             NotificationAccessoryAgsBinder.BindObject(eventargs);
             NotificationStyleArgBinder.BindObject(eventargs);
             NotificationProgressArgBinder.BindObject(eventargs);