[DllImport(Libraries.Notification, EntryPoint = "notification_clone")]
internal static extern NotificationError Clone(IntPtr handle, out IntPtr cloned);
+ [DllImport(Libraries.Notification, EntryPoint = "notification_set_check_box")]
+ internal static extern NotificationError SetCheckBox(NotificationSafeHandle handle, bool flag, bool checkedValue);
+
+ [DllImport(Libraries.Notification, EntryPoint = "notification_get_check_box")]
+ internal static extern NotificationError GetCheckBox(NotificationSafeHandle handle, out bool flag, out bool checkedValue);
+
internal static NotificationError GetText(NotificationSafeHandle handle, NotificationText type, out string text)
{
NotificationError ret;
public bool IsVisible { get; set; } = true;
/// <summary>
+ /// Gets a flag for do not show again checkbox.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool CheckBox { get; set; } = false;
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool CheckedValue { get; set; } = false;
+
+ /// <summary>
/// Gets or sets NotificationSafeHandle.
/// </summary>
internal NotificationSafeHandle Handle
}
Interop.Notification.SetProperties(notification.Handle, (int)notification.Property);
+
+ if (notification.CheckBox == true)
+ {
+ Interop.Notification.SetCheckBox(notification.Handle, notification.CheckBox, notification.CheckedValue);
+ }
}
internal static void BindSafeHandle(Notification notification)
BindSafeHandleTime(notification);
BindSafeHandleTag(notification);
BindSafeHandleAction(notification);
+ BindSafeHandleCheckBox(notification);
}
private static void BindNotificationSafeHandle(Notification notification)
notification.Action = new AppControl(appcontrol);
}
}
+
+ private static void BindSafeHandleCheckBox(Notification notification)
+ {
+ NotificationError ret;
+ bool checkbox = false;
+ bool checkedValue = false;
+
+ ret = Interop.Notification.GetCheckBox(notification.Handle, out checkbox, out checkedValue);
+ if (ret != NotificationError.None) {
+ Log.Error(Notification.LogTag, "Failed to get check box info");
+ }
+
+ notification.CheckBox = checkbox;
+ notification.CheckedValue = checkedValue;
+ }
}
}
/// Event type : Deleted by user.
/// </summary>
DeleteNotification = 201,
+
+ /// <summary>
+ /// Event type : Do not show again.
+ /// </summary>
+ CheckBox = 300,
}
}
[DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_all_count")]
internal static extern ErrorCode GetAllCount(NotificationType type, out int count);
+ [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_set_check_box_checked")]
+ internal static extern ErrorCode SetCheckedValue(NotificationSafeHandle handle, bool checkedValue);
+
+ [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_check_box")]
+ internal static extern ErrorCode GetCheckBox(NotificationSafeHandle handle, out bool flag, out bool checkedValue);
+
+ [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_send_event")]
+ internal static extern ErrorCode SendEventWithNotification(NotificationSafeHandle handle, int evnetType);
+
+
+
internal static ErrorCode GetAppId(NotificationSafeHandle handle, out string appid)
{
ErrorCode err;
public bool HasEventFlag { get; internal set; } = false;
/// <summary>
+ /// Gets the do not show again flag.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool CheckBox { get; internal set; } = false;
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool CheckedValue { get; internal set; } = false;
+
+ /// <summary>
/// Gets the AppControl, which is invoked when notification is clicked.
/// </summary>
/// <since_tizen> 4 </since_tizen>
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);
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);
/// Event type : Deleted by user.
/// </summary>
DeleteNotification = 201,
+
+ /// <summary>
+ /// Event type : Do not show again checked by user.
+ /// </summary>
+ CheckBox = 300,
}
/// <summary>
}
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void SetChecked(NotificationEventArgs eventargs, bool checkedValue)
+ {
+ Interop.NotificationEventListener.ErrorCode err;
+
+ err = Interop.NotificationEventListener.SetCheckedValue(eventargs.Handle, checkedValue);
+ if (err != Interop.NotificationEventListener.ErrorCode.None)
+ {
+ throw NotificationEventListenerErrorFactory.GetException(err, "failed to set checked");
+ }
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void SendEventWithNotification(NotificationEventArgs eventargs, UserEventType type)
+ {
+ Interop.NotificationEventListener.ErrorCode err;
+
+ err = Interop.NotificationEventListener.SendEventWithNotification(eventargs.Handle, (int)type);
+ if (err != Interop.NotificationEventListener.ErrorCode.None)
+ {
+ throw NotificationEventListenerErrorFactory.GetException(err, "failed to send event");
+ }
+ }
+
/// <summary>
/// Returns NotificationEventArgs by UniqueNumber.
/// </summary>