Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Maps / Tizen.Maps / MapGestureEventArgs.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 ElmSharp;
19
20 namespace Tizen.Maps
21 {
22     /// <summary>
23     /// Event arguments for gesture type map events
24     /// </summary>
25     /// <since_tizen>3</since_tizen>
26     public class MapGestureEventArgs : EventArgs
27     {
28         internal MapGestureEventArgs(IntPtr nativeHandle)
29         {
30             using (var handle = new Interop.GestureEventDataHandle(nativeHandle))
31             {
32                 GestureType = (GestureType)handle.GestureType;
33                 Position = handle.Position;
34                 TouchCount = handle.FingerCount;
35                 ZoomFactor = handle.ZoomFactor;
36                 RotationAngle = handle.RotationAngle;
37                 Geocoordinates = new Geocoordinates(handle.Coordinates);
38             }
39         }
40
41         /// <summary>
42         /// Gets type of gesture event.
43         /// </summary>
44         /// <since_tizen>3</since_tizen>
45         public GestureType GestureType { get; }
46
47         /// <summary>
48         /// Gets screen coordinates in the event.
49         /// </summary>
50         /// <since_tizen>3</since_tizen>
51         public Point Position { get; }
52
53         /// <summary>
54         /// Gets the number of fingers detected in the event.
55         /// </summary>
56         /// <since_tizen>3</since_tizen>
57         public int TouchCount { get; }
58
59         /// <summary>
60         /// Gets zoom factor for zoom gesture event.
61         /// </summary>
62         /// <since_tizen>3</since_tizen>
63         public double ZoomFactor { get; }
64
65         /// <summary>
66         /// Gets angle of rotation for rotate gesture event.
67         /// </summary>
68         /// <since_tizen>3</since_tizen>
69         public double RotationAngle { get; }
70
71         /// <summary>
72         /// Gets geographical coordinates for the event.
73         /// </summary>
74         /// <since_tizen>3</since_tizen>
75         public Geocoordinates Geocoordinates { get; }
76     }
77 }