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.
22 /// Enumeration of device type generated events.
24 /// <since_tizen> preview </since_tizen>
25 [Obsolete("This has been deprecated in API12")]
26 public enum InputDeviceType
29 /// Touch Screen device.
31 TouchScreen = (1 << 0),
48 /// Enumeration of pointer event types.
50 /// <since_tizen> preview </since_tizen>
51 [Obsolete("This has been deprecated in API12")]
52 public enum InputPointerType
55 /// Mouse button press.
60 /// Mouse button release.
71 /// Enumeration of touch event types.
73 /// <since_tizen> preview </since_tizen>
74 [Obsolete("This has been deprecated in API12")]
75 public enum InputTouchType
78 /// Finger press. It is same a behavior put your finger on touch screen.
83 /// Finger move. It is same a behavior move your finger on touch screen.
88 /// Finger release. It is same a behavior release your finger on touch screen.
94 /// InputGenerator provides functions to initialize/deinitialize input devices and to generation touch / key events.
97 /// http://tizen.org/privilege/inputgenerator
100 /// This is not for use by third-party applications.
102 /// <since_tizen> preview </since_tizen>
103 [Obsolete("This has been deprecated in API12")]
104 public class InputGenerator : IDisposable
106 IntPtr _handle = IntPtr.Zero;
107 bool _isDisposed = false;
110 /// Creates and initializes a new instance of the InputGenerator class.
112 /// <param name="deviceType">The device type want to generate events</param>
113 /// <since_tizen> preview </since_tizen>
114 [Obsolete("This has been deprecated in API12")]
115 public InputGenerator(InputDeviceType deviceType)
117 _handle = Interop.Eutil.efl_util_input_initialize_generator((int)deviceType);
121 /// Creates and initializes a new instance of the InputGenerator class with given name.
123 /// <param name="deviceType">The device type want to generate events</param>
124 /// <param name="name">The device name (maximum 31 characters)</param>
125 /// <since_tizen> preview </since_tizen>
126 [Obsolete("This has been deprecated in API12")]
127 public InputGenerator(InputDeviceType deviceType, string name)
129 _handle = Interop.Eutil.efl_util_input_initialize_generator_with_name((int)deviceType, name);
133 /// Destroys the InputGenerator object.
141 /// Destroys the current object.
143 /// <since_tizen> preview </since_tizen>
144 [Obsolete("This has been deprecated in API12")]
145 public void Dispose()
148 GC.SuppressFinalize(this);
152 /// Releases all the resources currently used by this instance.
154 /// <param name="disposing">
155 /// true if the managed resources should be disposed,
158 /// <since_tizen> preview </since_tizen>
159 [Obsolete("This has been deprecated in API12")]
160 protected virtual void Dispose(bool disposing)
167 Interop.Eutil.efl_util_input_deinitialize_generator(_handle);
174 /// Generates all of key events using a opened device.
176 /// <param name="key">The key name want to generate.</param>
177 /// <param name="pressed">The value that select key press or release. (0: release, 1: press)</param>
178 /// <since_tizen> preview </since_tizen>
179 [Obsolete("This has been deprecated in API12")]
180 public void GenerateKeyEvent(string key, int pressed)
182 Interop.Eutil.efl_util_input_generate_key(_handle, key, pressed);
186 /// Generate a pointer event using a opened device
188 /// <param name="buttons">The number of button.</param>
189 /// <param name="type">The pointer type.</param>
190 /// <param name="x">x coordination to move.</param>
191 /// <param name="y">y coordination to move.</param>
192 /// <since_tizen> preview </since_tizen>
193 [Obsolete("This has been deprecated in API12")]
194 public void GenerateMouseEvent(int buttons, InputPointerType type, int x, int y)
196 Interop.Eutil.efl_util_input_generate_pointer(_handle, buttons, (int)type, x, y);
200 /// Generate a touch event using a opened device
202 /// <param name="index">The index of touched finger.</param>
203 /// <param name="type">The touch type.</param>
204 /// <param name="x">The x axis of touch point.</param>
205 /// <param name="y">The y axis of touch point.</param>
206 /// <since_tizen> preview </since_tizen>
207 [Obsolete("This has been deprecated in API12")]
208 public void GenerateTouchEvent(int index, InputTouchType type, int x, int y)
210 Interop.Eutil.efl_util_input_generate_touch(_handle, index, (int)type, x, y);