Modify documentation of APIs
[platform/core/csapi/tizenfx.git] / src / Tizen.Maps / Tizen.Maps / Place.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 using System.Collections.Generic;
19
20 namespace Tizen.Maps
21 {
22     /// <summary>
23     /// Place information, used in Place Discovery and Search
24     /// </summary>
25     public class Place : IDisposable
26     {
27         internal Interop.PlaceHandle handle;
28
29         internal Place(Interop.PlaceHandle nativeHandle)
30         {
31             handle = nativeHandle;
32         }
33
34         /// <summary>
35         /// Gets ID string for the place.
36         /// </summary>
37         public string Id
38         {
39             get
40             {
41                 return handle.Id;
42             }
43         }
44
45         /// <summary>
46         /// Gets name string for the place.
47         /// </summary>
48         public string Name
49         {
50             get
51             {
52                 return handle.Name;
53             }
54         }
55
56         /// <summary>
57         /// Gets view URI for the place.
58         /// </summary>
59         public string Uri
60         {
61             get
62             {
63                 return handle.Uri;
64             }
65         }
66
67         /// <summary>
68         /// Gets distance for the place from the center.
69         /// </summary>
70         public int Distance
71         {
72             get
73             {
74                 return handle.Distance;
75             }
76         }
77
78         /// <summary>
79         /// Gets geographical location for the place.
80         /// </summary>
81         public Geocoordinates Coordinates
82         {
83             get
84             {
85                 return new Geocoordinates(handle.Coordinates);
86             }
87         }
88
89         /// <summary>
90         /// Gets address for the place.
91         /// </summary>
92         public PlaceAddress Address
93         {
94             get
95             {
96                 return new PlaceAddress(handle.Address);
97             }
98         }
99
100         /// <summary>
101         /// Gets rating for the place.
102         /// </summary>
103         public PlaceRating Rating
104         {
105             get
106             {
107                 return new PlaceRating(handle.Rating);
108             }
109         }
110
111         /// <summary>
112         /// Gets supplier link for the place.
113         /// </summary>
114         public PlaceLink Supplier
115         {
116             get
117             {
118                 return new PlaceLink(handle.Supplier);
119             }
120         }
121
122         /// <summary>
123         /// Gets related link for the place.
124         /// </summary>
125         public PlaceLink Related
126         {
127             get
128             {
129                 return new PlaceLink(handle.Related);
130             }
131         }
132
133         /// <summary>
134         /// Gets all properties attached to this place.
135         /// </summary>
136         public IDictionary<string, string> Properties
137         {
138             get
139             {
140                 var properties = new Dictionary<string, string>();
141                 handle.ForeachProperty((key, value) => properties[key] = value);
142                 return properties;
143             }
144         }
145
146         /// <summary>
147         /// Gets all categories attached to this place.
148         /// </summary>
149         public IEnumerable<PlaceCategory> Categories
150         {
151             get
152             {
153                 var categories = new List<PlaceCategory>();
154                 handle.ForeachCategory((categoryHandle) => categories.Add(new PlaceCategory(categoryHandle)));
155                 return categories;
156             }
157         }
158
159         /// <summary>
160         /// Gets all attributes attached to this place.
161         /// </summary>
162         public IEnumerable<PlaceAttribute> Attributes
163         {
164             get
165             {
166                 var attributes = new List<PlaceAttribute>();
167                 handle.ForeachAttribute((attributeHandle) => attributes.Add(new PlaceAttribute(attributeHandle)));
168                 return attributes;
169             }
170         }
171
172         /// <summary>
173         /// Gets all contacts attached to this place.
174         /// </summary>
175         public IEnumerable<PlaceContact> Contacts
176         {
177             get
178             {
179                 var contacts = new List<PlaceContact>();
180                 handle.ForeachContact((contactHandle) => contacts.Add(new PlaceContact(contactHandle)));
181                 return contacts;
182             }
183         }
184
185         /// <summary>
186         /// Gets all editorials attached to this place.
187         /// </summary>
188         public IEnumerable<PlaceEditorial> Editorials
189         {
190             get
191             {
192                 var editorials = new List<PlaceEditorial>();
193                 handle.ForeachEditorial((editorialHandle) => editorials.Add(new PlaceEditorial(editorialHandle)));
194                 return editorials;
195             }
196         }
197
198         /// <summary>
199         /// Gets all images attached to this place.
200         /// </summary>
201         public IEnumerable<PlaceImage> Images
202         {
203             get
204             {
205                 var images = new List<PlaceImage>();
206                 handle.ForeachImage((imageHandle) => images.Add(new PlaceImage(imageHandle)));
207                 return images;
208             }
209         }
210
211         /// <summary>
212         /// Gets all reviews attached to this place.
213         /// </summary>
214         public IEnumerable<PlaceReview> Reviews
215         {
216             get
217             {
218                 var reviews = new List<PlaceReview>();
219                 handle.ForeachReview((reviewHandle) => reviews.Add(new PlaceReview(reviewHandle)));
220                 return reviews;
221             }
222         }
223
224         #region IDisposable Support
225         private bool _disposedValue = false;
226
227         protected virtual void Dispose(bool disposing)
228         {
229             if (!_disposedValue)
230             {
231                 handle.Dispose();
232                 _disposedValue = true;
233             }
234         }
235
236         /// <summary>
237         /// Releases all resources used by this object.
238         /// </summary>
239         public void Dispose()
240         {
241             Dispose(true);
242             GC.SuppressFinalize(this);
243         }
244         #endregion
245     }
246 }