[NUI][TCSACR-487] DragAndDrop: Add drag and drop APIs
authorTaehyub Kim <taehyub.kim@samsung.com>
Wed, 11 May 2022 01:36:06 +0000 (10:36 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 21 Sep 2022 05:52:33 +0000 (14:52 +0900)
src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs
src/Tizen.NUI/src/public/DragAndDrop/DragEvent.cs
test/NUIDnDSource/NUIDnDSource.cs

index 60e567c..b9d5724 100755 (executable)
@@ -24,14 +24,13 @@ using Tizen.NUI.BaseComponents;
 namespace Tizen.NUI
 {
     /// <summary>
-    /// DragAndDrop controls the drag objet and data.
+    /// DragAndDrop controls the drag object and data.
     /// </summary>
+    /// <since_tizen> 10 </since_tizen>
     [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000: Dispose objects before losing scope", Justification = "It does not have ownership.")]
-    [EditorBrowsable(EditorBrowsableState.Never)]
     public class DragAndDrop : BaseHandle
     {
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public delegate void SourceEventHandler(SourceEventType sourceEventType);
+        public delegate void SourceEventHandler(DragSourceEventType sourceEventType);
         private delegate void InternalSourceEventHandler(int sourceEventType);
         public delegate void DragAndDropEventHandler(View targetView, DragEvent dragEvent);
         private delegate void InternalDragAndDropEventHandler(global::System.IntPtr dragEvent);
@@ -42,7 +41,6 @@ namespace Tizen.NUI
         private int shadowWidth = 100;
         private int shadowHeight = 100;
 
-        [EditorBrowsable(EditorBrowsableState.Never)]
         private DragAndDrop() : this(Interop.DragAndDrop.New(), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
@@ -56,7 +54,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Gets the singleton instance of DragAndDrop.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 10 </since_tizen>
         public static DragAndDrop Instance { get; } = new DragAndDrop();
 
         /// <summary>
@@ -66,8 +64,7 @@ namespace Tizen.NUI
         /// <param name="shadowView">The shadow view for drag object</param>
         /// <param name="dragData">The data to send</param>
         /// <param name="callback">The source event callback</param>
-        /// <exception cref="NotSupportedException">The multi-window feature is not supported.</exception>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 10 </since_tizen>
         public void StartDragAndDrop(View sourceView, View shadowView, DragData dragData, SourceEventHandler callback)
         {
             if (Window.IsSupportedMultiWindow() == false)
@@ -128,7 +125,7 @@ namespace Tizen.NUI
 
             sourceEventCb = (sourceEventType) =>
             {
-                if ((SourceEventType)sourceEventType == SourceEventType.Finish)
+                if ((DragSourceEventType)sourceEventType == DragSourceEventType.Finish)
                 {
                     if (mShadowView)
                     {
@@ -142,7 +139,7 @@ namespace Tizen.NUI
                     mDragWindow.RenderOnce();
                 }
 
-                callback((SourceEventType)sourceEventType);
+                callback((DragSourceEventType)sourceEventType);
             };
 
             if (!Interop.DragAndDrop.StartDragAndDrop(SwigCPtr, View.getCPtr(sourceView), Window.getCPtr(mDragWindow), dragData.MimeType, dragData.Data,
@@ -158,8 +155,8 @@ namespace Tizen.NUI
         /// Adds listener for drop targets
         /// </summary>
         /// <param name="targetView">The target view</param>
-        /// <param name="callback">The callback function to get drag event</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <param name="callback">The callback function to get drag event when the drag source enters, moves, leaves and drops on the drop target</param>
+        /// <since_tizen> 10 </since_tizen>
         public void AddListener(View targetView, DragAndDropEventHandler callback)
         {
             InternalDragAndDropEventHandler cb = (dragEvent) =>
@@ -207,7 +204,7 @@ namespace Tizen.NUI
         /// </summary>
         /// <param name="targetView">The target view</param>
         /// <param name="callback">The callback function to remove</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 10 </since_tizen>
         public void RemoveListener(View targetView, DragAndDropEventHandler callback)
         {
             if (!targetEventDictionary.ContainsKey(targetView))
index ee7a8cd..6c705b9 100755 (executable)
@@ -21,10 +21,10 @@ using Tizen.NUI.Binding;
 namespace Tizen.NUI
 {
     /// <summary>
-    /// Source event type.
+    /// Drag source event type.
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public enum SourceEventType
+    /// <since_tizen> 10 </since_tizen>
+    public enum DragSourceEventType
     {
         /// <summary>
         /// Drag and drop is started.
@@ -47,9 +47,9 @@ namespace Tizen.NUI
     /// <summary>
     /// This specifies drag data.
     /// </summary>
-    /// Suppress warning : This struct will be used data of callback, so override equals and operator does not necessary.
+    /// <since_tizen> 10 </since_tizen>
+    // Suppress warning : This struct will be used data of callback, so override equals and operator does not necessary.
     [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815: Override equals and operator equals on value types")]
-    [EditorBrowsable(EditorBrowsableState.Never)]
     public struct DragData
     {
         /// <summary>
@@ -65,7 +65,7 @@ namespace Tizen.NUI
     /// <summary>
     /// Drag event type.
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 10 </since_tizen>
     public enum DragType
     {
         /// <summary>
@@ -89,9 +89,9 @@ namespace Tizen.NUI
     /// <summary>
     /// This specifies drag event.
     /// </summary>
-    /// Suppress warning : This struct will be used data of callback, so override equals and operator does not necessary.
+    /// <since_tizen> 10 </since_tizen>
+    // Suppress warning : This struct will be used data of callback, so override equals and operator does not necessary.
     [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815: Override equals and operator equals on value types")]
-    [EditorBrowsable(EditorBrowsableState.Never)]
     public struct DragEvent
     {
         /// <summary>
index 8725d34..4fd294c 100644 (file)
@@ -131,23 +131,23 @@ namespace NUIDnDSource
             }
         }
 
-        public void OnSourceEventFunc(SourceEventType type)
+        public void OnSourceEventFunc(DragSourceEventType type)
         {
-          if (type == SourceEventType.Start)
+          if (type == DragSourceEventType.Start)
           {
-            Tizen.Log.Debug("NUIDnDSource", "Source App SourceEvnetType: " + "Start");
+            Tizen.Log.Debug("NUIDnDSource", "Source App DragSourceEventType: " + "Start");
           }
-          else if (type == SourceEventType.Cancel)
+          else if (type == DragSourceEventType.Cancel)
           {
-            Tizen.Log.Debug("NUIDnDSource", "Source App SourceEvnetType: " + "Cancel");
+            Tizen.Log.Debug("NUIDnDSource", "Source App DragSourceEventType: " + "Cancel");
           }
-          else if (type == SourceEventType.Accept)
+          else if (type == DragSourceEventType.Accept)
           {
-            Tizen.Log.Debug("NUIDnDSource", "Source App SourceEvnetType: " + "Accept");
+            Tizen.Log.Debug("NUIDnDSource", "Source App DragSourceEventType: " + "Accept");
           }
-          else if (type == SourceEventType.Finish)
+          else if (type == DragSourceEventType.Finish)
           {
-            Tizen.Log.Debug("NUIDnDSource", "Source App SourceEvnetType: " + "Finish");
+            Tizen.Log.Debug("NUIDnDSource", "Source App DragSourceEventType: " + "Finish");
           }
         }