2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.Runtime.InteropServices;
20 internal static partial class Interop
22 [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_get_id")]
23 internal static extern ErrorCode GetId(this PlaceCategoryHandle /* maps_place_category_h */ category, out string id);
25 [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_set_id")]
26 internal static extern ErrorCode SetId(this PlaceCategoryHandle /* maps_place_category_h */ category, string id);
28 [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_get_name")]
29 internal static extern ErrorCode GetName(this PlaceCategoryHandle /* maps_place_category_h */ category, out string name);
31 [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_set_name")]
32 internal static extern ErrorCode SetName(this PlaceCategoryHandle /* maps_place_category_h */ category, string name);
34 [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_get_url")]
35 internal static extern ErrorCode GetUrl(this PlaceCategoryHandle /* maps_place_category_h */ category, out string url);
37 [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_set_url")]
38 internal static extern ErrorCode SetUrl(this PlaceCategoryHandle /* maps_place_category_h */ category, string url);
40 internal class PlaceCategoryHandle : SafeMapsHandle
42 [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_create")]
43 internal static extern ErrorCode Create(out IntPtr /* maps_place_category_h */ category);
45 [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_destroy")]
46 internal static extern ErrorCode Destroy(IntPtr /* maps_place_category_h */ category);
50 get { return NativeGet(this.GetId); }
51 set { NativeSet(this.SetId, value); }
56 get { return NativeGet(this.GetName); }
57 set { NativeSet(this.SetName, value); }
62 get { return NativeGet(this.GetUrl); }
63 set { NativeSet(this.SetUrl, value); }
66 public PlaceCategoryHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy)
70 internal PlaceCategoryHandle() : this(IntPtr.Zero, true)
72 Create(out handle).ThrowIfFailed("Failed to create native handle");
75 internal static PlaceCategoryHandle Create(IntPtr nativeHandle)
77 return new PlaceCategoryHandle(nativeHandle, true);