2 * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Diagnostics;
20 namespace Tizen.Content.MediaContent
23 /// Represents the book information for the media.
25 /// <since_tizen> 9 </since_tizen>
26 public class BookInfo : MediaInfo
28 internal BookInfo(Interop.MediaInfoHandle handle) : base(handle)
30 IntPtr bookHandle = IntPtr.Zero;
34 Interop.MediaInfo.GetBook(handle, out bookHandle).ThrowIfError("Failed to retrieve data");
36 Debug.Assert(bookHandle != IntPtr.Zero);
38 Subject = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetSubject);
39 Author = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetAuthor);
40 DatePublished = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetDate); // Deprecated since API12
41 Publisher = InteropHelper.GetString(bookHandle, Interop.BookInfo.GetPublisher); // Deprecated since API12
45 Interop.BookInfo.Destroy(bookHandle).ThrowIfError("Failed to destroy book handle");
50 /// Gets the subject of the book.
52 /// <value>The subject.</value>
53 /// <since_tizen> 9 </since_tizen>
54 public string Subject { get; }
57 /// Gets the author of the book.
59 /// <value>The author.</value>
60 /// <since_tizen> 9 </since_tizen>
61 public string Author { get; }
64 /// Gets the published date, formatted as a string.
66 /// <value>The published date.</value>
67 /// <since_tizen> 9 </since_tizen>
68 [Obsolete("Deprecated since API12. Will be removed in API14.")]
69 public string DatePublished { get; }
72 /// Gets the publisher of the book.
74 /// <value>The publisher.</value>
75 /// <since_tizen> 9 </since_tizen>
76 [Obsolete("Deprecated since API12. Will be removed in API14.")]
77 public string Publisher { get; }