[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / EcoreKeyEventArgs.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 using Tizen.Internals;
21
22 namespace ElmSharp
23 {
24     /// <summary>
25     /// It inherits System.EventArgs.
26     /// The EcoreKeyEventArgs is an EventArgs to record the Ecore event's key name and key code.
27     /// </summary>
28     /// <since_tizen> preview </since_tizen>
29     [Obsolete("This has been deprecated in API12")]
30     public class EcoreKeyEventArgs : EventArgs
31     {
32         /// <summary>
33         /// Gets the KeyName property. The return type is string.
34         /// </summary>
35         /// <since_tizen> preview </since_tizen>
36         [Obsolete("This has been deprecated in API12")]
37         public string KeyName { get; private set; }
38         /// <summary>
39         /// Gets the KeyCode property. The return type is int.
40         /// </summary>
41         /// <since_tizen> preview </since_tizen>
42         [Obsolete("This has been deprecated in API12")]
43         public int KeyCode { get; private set; }
44
45         /// <summary>
46         /// Creates and initializes a new instance of the EcoreKeyEventArgs class.
47         /// </summary>
48         /// <param name="data">data</param>
49         /// <param name="type">type</param>
50         /// <param name="info">information</param>
51         /// <returns>New instance of the EcoreKeyEventArgs class.</returns>
52         /// <since_tizen> preview </since_tizen>
53         [Obsolete("This has been deprecated in API12")]
54         public static EcoreKeyEventArgs Create(IntPtr data, EcoreEventType type, IntPtr info)
55         {
56             var evt = Marshal.PtrToStructure<EcoreEventKey>(info);
57             return new EcoreKeyEventArgs { KeyName = evt.keyname, KeyCode = (int)evt.keycode };
58         }
59
60         [NativeStruct("Ecore_Event_Key", Include = "Elementary.h", PkgConfig = "elementary")]
61         [StructLayout(LayoutKind.Sequential)]
62         struct EcoreEventKey
63         {
64             public string keyname;
65             public string key;
66             public string str;
67             public string compose;
68             public IntPtr window;
69             public IntPtr root_window;
70             public IntPtr event_window;
71             public uint timestamp;
72             public uint modifiers;
73             public int same_screen;
74             public uint keycode;
75             public IntPtr data;
76             public IntPtr dev;
77             public int event_flags;
78         }
79     }
80 }