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 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_set_coordinates")]
24 internal static extern ErrorCode SetCoordinates(this OverlayHandle /* maps_view_object_h */ overlay, CoordinatesHandle /* maps_coordinates_h */ coordinates);
26 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_get_coordinates")]
27 internal static extern ErrorCode GetCoordinates(this OverlayHandle /* maps_view_object_h */ overlay, out IntPtr /* maps_coordinates_h */ coordinates);
29 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_set_min_zoom_level")]
30 internal static extern ErrorCode SetMinZoomLevel(this OverlayHandle /* maps_view_object_h */ overlay, int zoom);
32 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_get_min_zoom_level")]
33 internal static extern ErrorCode GetMinZoomLevel(this OverlayHandle /* maps_view_object_h */ overlay, out int zoom);
35 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_set_max_zoom_level")]
36 internal static extern ErrorCode SetMaxZoomLevel(this OverlayHandle /* maps_view_object_h */ overlay, int zoom);
38 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_get_max_zoom_level")]
39 internal static extern ErrorCode GetMaxZoomLevel(this OverlayHandle /* maps_view_object_h */ overlay, out int zoom);
41 internal class OverlayHandle : ViewObjectHandle
43 [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_create_overlay")]
44 internal static extern ErrorCode CreateOverlay(CoordinatesHandle /* maps_coordinates_h */ coordinates, IntPtr viewObject, ViewOverlayType /* maps_view_overlay_type_e */ type, out IntPtr /* maps_view_object_h */ overlay);
46 internal int MinZoomLevel
48 get { return NativeGet<int>(this.GetMinZoomLevel); }
49 set { NativeSet(this.SetMinZoomLevel, value); }
52 internal int MaxZoomLevel
54 get { return NativeGet<int>(this.GetMaxZoomLevel); }
55 set { NativeSet(this.SetMaxZoomLevel, value); }
59 internal CoordinatesHandle Coordinates
61 get { return NativeGet(this.GetCoordinates, CoordinatesHandle.Create); }
62 set { NativeSet(this.SetCoordinates, value); }
65 internal OverlayHandle(CoordinatesHandle coordinates, EvasObject viewObject, ViewOverlayType type) : base(IntPtr.Zero, true)
67 var clonedCoordinatesHandle = CoordinatesHandle.CloneFrom(coordinates);
68 CreateOverlay(clonedCoordinatesHandle, viewObject, type, out handle).ThrowIfFailed("Failed to create native overlay handle");
69 clonedCoordinatesHandle.HasOwnership = false;