Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Maps / Tizen.Maps / PlaceFilter.cs
1 /*
2  * Copyright (c) 2016 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
19 namespace Tizen.Maps
20 {
21     /// <summary>
22     /// Place Filter information, used in Place Discovery and Search requests
23     /// </summary>
24     /// <since_tizen>3</since_tizen>
25     public class PlaceFilter : IDisposable
26     {
27         internal Interop.PlaceFilterHandle handle;
28
29         /// <summary>
30         /// Constructs new place filter.
31         /// </summary>
32         /// <since_tizen>3</since_tizen>
33         /// <exception cref="System.InvalidOperationException">Thrown when native operation failed to allocate memory.</exception>
34         public PlaceFilter()
35         {
36             handle = new Interop.PlaceFilterHandle();
37         }
38
39         /// <summary>
40         /// Gets or sets an free-formed address string for this place filter.
41         /// </summary>
42         /// <since_tizen>3</since_tizen>
43         /// <remarks>Depending on maps provider which the application has selected,
44         /// it may treat <see cref="PlaceFilter.Name"/>, <see cref="PlaceFilter.Keyword"/> and <see cref="PlaceFilter.Address"/>
45         /// as same kind of strings to search places.</remarks>
46         public string Address
47         {
48             get
49             {
50                 return handle.PlaceAddress;
51             }
52             set
53             {
54                 handle.PlaceAddress = value;
55             }
56         }
57
58         /// <summary>
59         /// Gets or sets an instance of <see cref="PlaceCategory"/> object for this place filter.
60         /// </summary>
61         /// <since_tizen>3</since_tizen>
62         public PlaceCategory Category
63         {
64             get
65             {
66                 return new PlaceCategory(handle.Category);
67             }
68             set
69             {
70                 handle.Category = value.handle;
71             }
72         }
73
74         /// <summary>
75         /// Gets or sets a keyword for this place filter.
76         /// </summary>
77         /// <since_tizen>3</since_tizen>
78         /// <remarks>Depending on maps provider which the application has selected,
79         /// it may treat <see cref="PlaceFilter.Name"/>, <see cref="PlaceFilter.Keyword"/> and <see cref="PlaceFilter.Address"/>
80         /// as same kind of strings to search places.</remarks>
81         public string Keyword
82         {
83             get
84             {
85                 return handle.Keyword;
86             }
87             set
88             {
89                 handle.Keyword = value;
90             }
91         }
92
93         /// <summary>
94         /// Gets or sets a name for this place filter.
95         /// </summary>
96         /// <since_tizen>3</since_tizen>
97         /// <remarks>Depending on maps provider which the application has selected,
98         /// it may treat <see cref="PlaceFilter.Name"/>, <see cref="PlaceFilter.Keyword"/> and <see cref="PlaceFilter.Address"/>
99         /// as same kind of strings to search places.</remarks>
100         public string Name
101         {
102             get
103             {
104                 return handle.PlaceName;
105             }
106             set
107             {
108                 handle.PlaceName = value;
109             }
110         }
111
112         #region IDisposable Support
113         private bool _disposedValue = false;
114
115         protected virtual void Dispose(bool disposing)
116         {
117             if (!_disposedValue)
118             {
119                 handle.Dispose();
120                 _disposedValue = true;
121             }
122         }
123
124         /// <summary>
125         /// Releases all resources used by this object.
126         /// </summary>
127         /// <since_tizen>3</since_tizen>
128         public void Dispose()
129         {
130             Dispose(true);
131             GC.SuppressFinalize(this);
132         }
133         #endregion
134     }
135 }