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;
21 internal static partial class Interop
23 internal enum ViewObjectType
25 Polyline, // MAPS_VIEW_OBJECT_POLYLINE
26 Polygon, // MAPS_VIEW_OBJECT_POLYGON
27 Marker, // MAPS_VIEW_OBJECT_MARKER
28 Overlay, // MAPS_VIEW_OBJECT_OVERLAY
31 internal enum ViewMarkerType
33 Pin, // MAPS_VIEW_MARKER_PIN
34 Sticker, // MAPS_VIEW_MARKER_STICKER
37 internal enum ViewOverlayType
39 Normal, // MAPS_VIEW_OVERLAY_NORMAL
40 Bubble, // MAPS_VIEW_OVERLAY_BUBBLE
41 Box, // MAPS_VIEW_OVERLAY_BOX
44 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_get_type")]
45 internal static extern ErrorCode GetType(this ViewObjectHandle /* maps_view_object_h */ viewObject, out ViewObjectType /* maps_view_object_type_e */ type);
47 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_set_visible")]
48 internal static extern ErrorCode SetVisible(this ViewObjectHandle /* maps_view_object_h */ viewObject, bool visible);
50 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_get_visible")]
51 internal static extern ErrorCode GetVisible(this ViewObjectHandle /* maps_view_object_h */ viewObject, out bool visible);
53 internal class ViewObjectHandle : SafeMapsHandle
55 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_destroy")]
56 internal static extern ErrorCode Destroy(IntPtr /* maps_view_object_h */ viewObject);
58 internal bool IsVisible
60 get { return NativeGet<bool>(this.GetVisible); }
61 set { NativeSet(this.SetVisible, value); }
64 public ViewObjectHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy)
68 internal static ViewObjectHandle Create(IntPtr nativeHandle, bool needToRelease)
70 return new ViewObjectHandle(nativeHandle, needToRelease);