Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Maps / Interop / Interop.Place.Review.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.Runtime.InteropServices;
19
20 internal static partial class Interop
21 {
22     [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_date")]
23     internal static extern ErrorCode GetDate(this PlaceReviewHandle /* maps_place_review_h */ review, out string date);
24
25     [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_title")]
26     internal static extern ErrorCode GetTitle(this PlaceReviewHandle /* maps_place_review_h */ review, out string title);
27
28     [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_rating")]
29     internal static extern ErrorCode GetRating(this PlaceReviewHandle /* maps_place_review_h */ review, out double rating);
30
31     [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_description")]
32     internal static extern ErrorCode GetDescription(this PlaceReviewHandle /* maps_place_review_h */ review, out string description);
33
34     [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_language")]
35     internal static extern ErrorCode GetLanguage(this PlaceReviewHandle /* maps_place_review_h */ review, out string language);
36
37     [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_media")]
38     internal static extern ErrorCode GetMedia(this PlaceReviewHandle /* maps_place_review_h */ review, out IntPtr /* maps_place_media_h */ media);
39
40     [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_user_link")]
41     internal static extern ErrorCode GetUserLink(this PlaceReviewHandle /* maps_place_review_h */ review, out IntPtr /* maps_place_link_object_h */ user);
42
43     internal class PlaceReviewHandle : SafeMapsHandle
44     {
45         [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_destroy")]
46         internal static extern ErrorCode Destroy(IntPtr /* maps_place_review_h */ review);
47
48         internal string Date
49         {
50             get { return NativeGet(this.GetDate); }
51         }
52
53         internal string Title
54         {
55             get { return NativeGet(this.GetTitle); }
56         }
57         internal string Language
58         {
59             get { return NativeGet(this.GetLanguage); }
60         }
61         internal string Description
62         {
63             get { return NativeGet(this.GetDescription); }
64         }
65         internal double Rating
66         {
67             get { return NativeGet<double>(this.GetRating); }
68         }
69
70         internal PlaceLinkObjectHandle User
71         {
72             get { return NativeGet(this.GetUserLink, PlaceLinkObjectHandle.Create); }
73         }
74
75         internal PlaceMediaHandle Media
76         {
77             get { return NativeGet(this.GetMedia, PlaceMediaHandle.Create); }
78         }
79
80         public PlaceReviewHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy)
81         {
82         }
83     }
84 }