[MediaContent] Deprecate meaningless media group enum (#5939)
[platform/core/csapi/tizenfx.git] / src / Tizen.Content.MediaContent / Tizen.Content.MediaContent / BookInfo.cs
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18 using System.Diagnostics;
19
20 namespace Tizen.Content.MediaContent
21 {
22     /// <summary>
23     /// Represents the book information for the media.
24     /// </summary>
25     /// <since_tizen> 9 </since_tizen>
26     public class BookInfo : MediaInfo
27     {
28         internal BookInfo(Interop.MediaInfoHandle handle) : base(handle)
29         {
30             IntPtr bookHandle = IntPtr.Zero;
31
32             try
33             {
34                 Interop.MediaInfo.GetBook(handle, out bookHandle).ThrowIfError("Failed to retrieve data");
35
36                 Debug.Assert(bookHandle != IntPtr.Zero);
37
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
42             }
43             finally
44             {
45                 Interop.BookInfo.Destroy(bookHandle).ThrowIfError("Failed to destroy book handle");
46             }
47         }
48
49         /// <summary>
50         /// Gets the subject of the book.
51         /// </summary>
52         /// <value>The subject.</value>
53         /// <since_tizen> 9 </since_tizen>
54         public string Subject { get; }
55
56         /// <summary>
57         /// Gets the author of the book.
58         /// </summary>
59         /// <value>The author.</value>
60         /// <since_tizen> 9 </since_tizen>
61         public string Author { get; }
62
63         /// <summary>
64         /// Gets the published date, formatted as a string.
65         /// </summary>
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; }
70
71         /// <summary>
72         /// Gets the publisher of the book.
73         /// </summary>
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; }
78     }
79 }