Merge remote-tracking branch 'origin/master' into tizen
authorTizenAPI-Bot <tizenapi@samsung.com>
Mon, 5 Feb 2024 15:08:27 +0000 (15:08 +0000)
committerTizenAPI-Bot <tizenapi@samsung.com>
Mon, 5 Feb 2024 15:08:27 +0000 (15:08 +0000)
src/Tizen.Content.MediaContent/Interop/Interop.BookInfo.cs
src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs
src/Tizen.Content.MediaContent/Interop/Interop.VideoInfo.cs
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookInfo.cs
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInfo.cs
src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.KVMService.cs
src/Tizen.NUI.WindowSystem/src/public/KVMService.cs
test/NUIWindowKVMSample/NUIWindowKVMSample.cs

index 4bc192c..2db62cb 100644 (file)
@@ -35,10 +35,10 @@ internal static partial class Interop
         internal static extern MediaContentError GetAuthor(IntPtr handle, out IntPtr author);
 
         [DllImport(Libraries.MediaContent, EntryPoint = "book_meta_get_date")]
-        internal static extern MediaContentError GetDate(IntPtr handle, out IntPtr date);
+        internal static extern MediaContentError GetDate(IntPtr handle, out IntPtr date); // Deprecated since API12
 
         [DllImport(Libraries.MediaContent, EntryPoint = "book_meta_get_publisher")]
-        internal static extern MediaContentError GetPublisher(IntPtr handle, out IntPtr publisher);
+        internal static extern MediaContentError GetPublisher(IntPtr handle, out IntPtr publisher); // Deprecated since API12
 
         [DllImport(Libraries.MediaContent, EntryPoint = "book_meta_get_path_with_keyword")]
         internal static extern MediaContentError GetPathByKeyword(string keyword, out IntPtr path, out uint length);
index b5778b4..deed1a6 100644 (file)
@@ -71,7 +71,7 @@ internal static partial class Interop
         internal static extern MediaContentError GetImage(MediaInfoHandle handle, out IntPtr imageHandle);
 
         [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_video")]
-        internal static extern MediaContentError GetVideo(MediaInfoHandle handle, out IntPtr videoHandle);
+        internal static extern MediaContentError GetVideo(MediaInfoHandle handle, out IntPtr videoHandle); // Deprecated since API12
 
         [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_audio")]
         internal static extern MediaContentError GetAudio(MediaInfoHandle handle, out IntPtr audioHandle);
index e1a78f6..8a92a76 100644 (file)
@@ -23,7 +23,7 @@ internal static partial class Interop
     internal static partial class VideoInfo
     {
         [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_destroy", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern MediaContentError Destroy(IntPtr handle);
+        internal static extern MediaContentError Destroy(IntPtr handle); // Deprecated since API12
 
         [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_album", CallingConvention = CallingConvention.Cdecl)]
         internal static extern MediaContentError GetAlbum(IntPtr handle, out IntPtr albumName); // Deprecated since API12
@@ -59,9 +59,9 @@ internal static partial class Interop
         internal static extern MediaContentError GetDuration(IntPtr handle, out int duration); // Deprecated since API12
 
         [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_width", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern MediaContentError GetWidth(IntPtr handle, out int width);
+        internal static extern MediaContentError GetWidth(IntPtr handle, out int width); // Deprecated since API12
 
         [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_height", CallingConvention = CallingConvention.Cdecl)]
-        internal static extern MediaContentError GetHeight(IntPtr handle, out int width);
+        internal static extern MediaContentError GetHeight(IntPtr handle, out int width); // Deprecated since API12
     }
 }
index fbd8bf3..20d8a92 100644 (file)
@@ -37,8 +37,8 @@ namespace Tizen.Content.MediaContent
 
                 Subject = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetSubject);
                 Author = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetAuthor);
-                DatePublished = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetDate);
-                Publisher = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetPublisher);
+                DatePublished = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetDate); // Deprecated since API12
+                Publisher = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetPublisher); // Deprecated since API12
             }
             finally
             {
@@ -65,6 +65,7 @@ namespace Tizen.Content.MediaContent
         /// </summary>
         /// <value>The published date.</value>
         /// <since_tizen> 9 </since_tizen>
+        [Obsolete("Deprecated since API12; Will be removed in API14.")]
         public string DatePublished { get; }
 
         /// <summary>
@@ -72,6 +73,7 @@ namespace Tizen.Content.MediaContent
         /// </summary>
         /// <value>The publisher.</value>
         /// <since_tizen> 9 </since_tizen>
+        [Obsolete("Deprecated since API12; Will be removed in API14.")]
         public string Publisher { get; }
     }
 }
index 69ac8cb..946b5ad 100644 (file)
@@ -31,7 +31,7 @@ namespace Tizen.Content.MediaContent
 
             try
             {
-                Interop.MediaInfo.GetVideo(handle, out videoHandle).ThrowIfError("Failed to retrieve data");
+                Interop.MediaInfo.GetVideo(handle, out videoHandle).ThrowIfError("Failed to retrieve data"); // Deprecated since API12
 
                 Debug.Assert(videoHandle != IntPtr.Zero);
 
@@ -47,12 +47,12 @@ namespace Tizen.Content.MediaContent
 
                 BitRate = InteropHelper.GetValue<int>(videoHandle, Interop.VideoInfo.GetBitRate); // Deprecated since API12
                 Duration = InteropHelper.GetValue<int>(videoHandle, Interop.VideoInfo.GetDuration); // Deprecated since API12
-                Width = InteropHelper.GetValue<int>(videoHandle, Interop.VideoInfo.GetWidth);
-                Height = InteropHelper.GetValue<int>(videoHandle, Interop.VideoInfo.GetHeight);
+                Width = InteropHelper.GetValue<int>(videoHandle, Interop.VideoInfo.GetWidth); // Deprecated since API12
+                Height = InteropHelper.GetValue<int>(videoHandle, Interop.VideoInfo.GetHeight); // Deprecated since API12
             }
             finally
             {
-                Interop.VideoInfo.Destroy(videoHandle);
+                Interop.VideoInfo.Destroy(videoHandle); // Deprecated since API12
             }
         }
 
@@ -149,6 +149,7 @@ namespace Tizen.Content.MediaContent
         /// </summary>
         /// <value>The width of the video in pixels.</value>
         /// <since_tizen> 4 </since_tizen>
+        [Obsolete("Deprecated since API12; Will be removed in API14.")]
         public int Width { get; }
 
         /// <summary>
@@ -156,6 +157,7 @@ namespace Tizen.Content.MediaContent
         /// </summary>
         /// <value>The height of the video in pixels.</value>
         /// <since_tizen> 4 </since_tizen>
+        [Obsolete("Deprecated since API12; Will be removed in API14.")]
         public int Height { get; }
 
     }
index 4fc52fd..1429838 100644 (file)
@@ -25,6 +25,12 @@ namespace Tizen.NUI.WindowSystem.Shell
             [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_kvm_service_receive_drag_data")]
             internal static extern int ReceiveDragData(IntPtr kvmService, string mimeType);
 
+            [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_kvm_service_get_source_mimetypes")]
+            internal static extern int GetSourceMimetypes(
+                IntPtr kvmService,
+                out string[] mimeTypes,
+                out int count);
+
             [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_kvm_service_secondary_selection_set")]
             internal static extern int SetSecondarySelection(IntPtr kvmService);
 
index ba94e05..d67b516 100644 (file)
@@ -17,6 +17,7 @@
 
 using System;
 using System.ComponentModel;
+using System.Collections.Generic;
 
 namespace Tizen.NUI.WindowSystem.Shell
 {
@@ -209,6 +210,23 @@ namespace Tizen.NUI.WindowSystem.Shell
         }
 
         /// <summary>
+        /// Requests to receive the mimetype list of drag source.
+        /// </summary>
+        /// <returns>
+        /// The list of mimetype.
+        /// If there are no mimetype, returns null.
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
+        public List<string> GetSourceMimetypes()
+        {
+            int res = Interop.KVMService.GetSourceMimetypes(_kvmService, out string[] mimetypes, out int mimeTypeCount);
+            _tzsh.ErrorCodeThrow(res);
+
+            if (mimetypes == null) return null;
+            return new List<string>(mimetypes);
+        }
+
+        /// <summary>
         /// Requests to set KVM window as secondary selection window.
         /// The request name has typo and will remove soon.
         /// Please use SetSecondarySelection.
index 176cd66..52cdb4c 100644 (file)
@@ -148,9 +148,17 @@ namespace NUIWindowKVMSample
         {
             Log.Debug("KVMSample", "Tizen KVM: Drag started");
 
+            List<string> mimeTypes;
+            mimeTypes = kvmService.GetSourceMimetypes();
+            if (mimeTypes == null)
+                Log.Debug("KVMSample", "Tizen KVM: There're no Source mimetypes");
+            else
+                Log.Debug("KVMSample", "Tizen KVM: Source mimetypes: " + string.Join(", ", mimeTypes));
+            string mimeType = mimeTypes[0];
+
             // Request the drag data to the Display server.
             // The drag data can get at DnD Listener (OnDnDEvent function)
-            kvmService.ReceiveDragData("text/plain");
+            kvmService.ReceiveDragData(mimeType);
         }
 
         private void OnDragEnded(object sender, EventArgs e)