Release 8.0.0.15812
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Remoting / MediaController / MediaControlSearchCondition.cs
1 /*
2  * Copyright (c) 2018 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.Collections.Generic;
19 using Tizen.Applications;
20 using NativeClient = Interop.MediaControllerClient;
21 using NativeServer = Interop.MediaControllerServer;
22 using NativePlaylist = Interop.MediaControllerPlaylist;
23
24 namespace Tizen.Multimedia.Remoting
25 {
26     /// <summary>
27     /// Represents the search conditions.
28     /// </summary>
29     /// <since_tizen> 5 </since_tizen>
30     public class MediaControlSearchCondition
31     {
32         /// <summary>
33         /// Initializes a new instance of the <see cref="MediaControlSearchCondition"/> class.
34         /// </summary>
35         /// <remarks>
36         /// The <see cref="MediaControlSearchCategory"/> will be set internally by <see cref="MediaControlSearchCategory.All"/>.
37         /// </remarks>
38         /// <param name="type" > The search type.</param>
39         /// <param name="keyword">The search keyword.</param>
40         /// <exception cref="ArgumentException"><paramref name="type"/> is not valid.</exception>
41         /// <exception cref="ArgumentNullException"><paramref name="keyword"/> is null.</exception>
42         /// <since_tizen> 6 </since_tizen>
43         public MediaControlSearchCondition(MediaControlContentType type, string keyword)
44             : this(type, MediaControlSearchCategory.All, keyword, null)
45         {
46         }
47
48         /// <summary>
49         /// Initializes a new instance of the <see cref="MediaControlSearchCondition"/> class.
50         /// </summary>
51         /// <param name="type">The search type.</param>
52         /// <param name="category">The search category.</param>
53         /// <param name="keyword">The search keyword.</param>
54         /// <exception cref="ArgumentException">
55         /// <paramref name="type"/> or <paramref name="category"/> is not valid.
56         /// </exception>
57         /// <exception cref="ArgumentNullException"><paramref name="keyword"/> is null.</exception>
58         /// <since_tizen> 6 </since_tizen>
59         public MediaControlSearchCondition(MediaControlContentType type, MediaControlSearchCategory category, string keyword)
60             : this (type, category, keyword, null)
61         {
62         }
63
64         /// <summary>
65         /// Initializes a new instance of the <see cref="MediaControlSearchCondition"/> class.
66         /// </summary>
67         /// <remarks>
68         /// The <see cref="MediaControlSearchCategory"/> will be set internally by <see cref="MediaControlSearchCategory.All"/>.
69         /// </remarks>
70         /// <param name="type" > The search type.</param>
71         /// <param name="keyword">The search keyword.</param>
72         /// <param name="bundle">The extra data.</param>
73         /// <exception cref="ArgumentException"><paramref name="type"/> is not valid.</exception>
74         /// <exception cref="ArgumentNullException"><paramref name="keyword"/> is null.</exception>
75         /// <since_tizen> 5 </since_tizen>
76         public MediaControlSearchCondition(MediaControlContentType type, string keyword, Bundle bundle)
77             : this(type, MediaControlSearchCategory.All, keyword, bundle)
78         {
79         }
80
81         /// <summary>
82         /// Initializes a new instance of the <see cref="MediaControlSearchCondition"/> class.
83         /// </summary>
84         /// <param name="type">The search type.</param>
85         /// <param name="category">The search category.</param>
86         /// <param name="keyword">The search keyword.</param>
87         /// <param name="bundle">The extra data.</param>
88         /// <exception cref="ArgumentException">
89         /// <paramref name="type"/> or <paramref name="category"/> is not valid.
90         /// </exception>
91         /// <exception cref="ArgumentNullException"><paramref name="keyword"/> is null.</exception>
92         /// <since_tizen> 5 </since_tizen>
93         public MediaControlSearchCondition(MediaControlContentType type, MediaControlSearchCategory category,
94             string keyword, Bundle bundle)
95         {
96             ValidationUtil.ValidateEnum(typeof(MediaControlSearchCategory), category, nameof(category));
97             ValidationUtil.ValidateEnum(typeof(MediaControlContentType), type, nameof(type));
98
99             Category = category;
100             ContentType = type;
101             Keyword = keyword ?? throw new ArgumentNullException(nameof(keyword));
102             Bundle = bundle;
103         }
104
105         /// <summary>
106         /// Gets the search content type.
107         /// </summary>
108         /// <since_tizen> 5 </since_tizen>
109         public MediaControlContentType ContentType { get; }
110
111         /// <summary>
112         /// Gets the search category.
113         /// </summary>
114         /// <since_tizen> 5 </since_tizen>
115         public MediaControlSearchCategory Category { get; }
116
117         /// <summary>
118         /// Gets the search keyword.
119         /// </summary>
120         /// <since_tizen> 5 </since_tizen>
121         public string Keyword { get; }
122
123         /// <summary>
124         /// Gets the extra data.
125         /// </summary>
126         /// <since_tizen> 5 </since_tizen>
127         public Bundle Bundle { get; }
128     }
129 }