1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
14 /// <summary>Access widget action mixin</summary>
15 [Efl.Access.Widget.IActionConcrete.NativeMethods]
16 [Efl.Eo.BindingEntity]
17 public interface IAction :
19 Efl.Eo.IWrapper, IDisposable
21 /// <summary>Elementary actions</summary>
22 /// <returns>NULL-terminated array of Efl.Access.Action_Data.</returns>
23 Efl.Access.ActionData GetElmActions();
24 event EventHandler ReadingStateChangedEvt;
25 /// <summary>Elementary actions</summary>
26 /// <value>NULL-terminated array of Efl.Access.Action_Data.</value>
27 Efl.Access.ActionData ElmActions {
31 /// <summary>Access widget action mixin</summary>
32 sealed public class IActionConcrete :
37 ///<summary>Pointer to the native class description.</summary>
38 public override System.IntPtr NativeClass
42 if (((object)this).GetType() == typeof(IActionConcrete))
44 return GetEflClassStatic();
48 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
53 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
54 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
55 private IActionConcrete(ConstructingHandle ch) : base(ch)
59 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
60 efl_access_widget_action_mixin_get();
61 /// <summary>Initializes a new instance of the <see cref="IAction"/> class.
62 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
63 /// <param name="wh">The native pointer to be wrapped.</param>
64 private IActionConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
68 public event EventHandler ReadingStateChangedEvt
72 lock (eflBindingEventLock)
74 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
76 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
79 EventArgs args = EventArgs.Empty;
82 value?.Invoke(obj, args);
86 Eina.Log.Error(e.ToString());
87 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
92 string key = "_EFL_ACCESS_WIDGET_ACTION_EVENT_READING_STATE_CHANGED";
93 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
99 lock (eflBindingEventLock)
101 string key = "_EFL_ACCESS_WIDGET_ACTION_EVENT_READING_STATE_CHANGED";
102 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
106 ///<summary>Method to raise event ReadingStateChangedEvt.</summary>
107 public void OnReadingStateChangedEvt(EventArgs e)
109 var key = "_EFL_ACCESS_WIDGET_ACTION_EVENT_READING_STATE_CHANGED";
110 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
111 if (desc == IntPtr.Zero)
113 Eina.Log.Error($"Failed to get native event {key}");
117 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
119 /// <summary>Elementary actions</summary>
120 /// <returns>NULL-terminated array of Efl.Access.Action_Data.</returns>
121 public Efl.Access.ActionData GetElmActions() {
122 var _ret_var = Efl.Access.Widget.IActionConcrete.NativeMethods.efl_access_widget_action_elm_actions_get_ptr.Value.Delegate(this.NativeHandle);
123 Eina.Error.RaiseIfUnhandledException();
126 /// <summary>Gets action name for given id</summary>
127 /// <param name="id">ID to get action name for</param>
128 /// <returns>Action name</returns>
129 public System.String GetActionName(int id) {
130 var _ret_var = Efl.Access.IActionConcrete.NativeMethods.efl_access_action_name_get_ptr.Value.Delegate(this.NativeHandle,id);
131 Eina.Error.RaiseIfUnhandledException();
134 /// <summary>Gets localized action name for given id</summary>
135 /// <param name="id">ID to get localized name for</param>
136 /// <returns>Localized name</returns>
137 public System.String GetActionLocalizedName(int id) {
138 var _ret_var = Efl.Access.IActionConcrete.NativeMethods.efl_access_action_localized_name_get_ptr.Value.Delegate(this.NativeHandle,id);
139 Eina.Error.RaiseIfUnhandledException();
142 /// <summary>Get list of available widget actions</summary>
143 /// <returns>Contains statically allocated strings.</returns>
144 public Eina.List<Efl.Access.ActionData> GetActions() {
145 var _ret_var = Efl.Access.IActionConcrete.NativeMethods.efl_access_action_actions_get_ptr.Value.Delegate(this.NativeHandle);
146 Eina.Error.RaiseIfUnhandledException();
147 return new Eina.List<Efl.Access.ActionData>(_ret_var, false, false);
149 /// <summary>Performs action on given widget.</summary>
150 /// <param name="id">ID for widget</param>
151 /// <returns><c>true</c> if action was performed, <c>false</c> otherwise</returns>
152 public bool ActionDo(int id) {
153 var _ret_var = Efl.Access.IActionConcrete.NativeMethods.efl_access_action_do_ptr.Value.Delegate(this.NativeHandle,id);
154 Eina.Error.RaiseIfUnhandledException();
157 /// <summary>Gets configured keybinding for specific action and widget.</summary>
158 /// <param name="id">ID for widget</param>
159 /// <returns>Should be freed by the user.</returns>
160 public System.String GetActionKeybinding(int id) {
161 var _ret_var = Efl.Access.IActionConcrete.NativeMethods.efl_access_action_keybinding_get_ptr.Value.Delegate(this.NativeHandle,id);
162 Eina.Error.RaiseIfUnhandledException();
165 /// <summary>Elementary actions</summary>
166 /// <value>NULL-terminated array of Efl.Access.Action_Data.</value>
167 public Efl.Access.ActionData ElmActions {
168 get { return GetElmActions(); }
170 /// <summary>Get list of available widget actions</summary>
171 /// <value>Contains statically allocated strings.</value>
172 public Eina.List<Efl.Access.ActionData> Actions {
173 get { return GetActions(); }
175 private static IntPtr GetEflClassStatic()
177 return Efl.Access.Widget.IActionConcrete.efl_access_widget_action_mixin_get();
179 /// <summary>Wrapper for native methods and virtual method delegates.
180 /// For internal use by generated code only.</summary>
181 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
183 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
184 /// <summary>Gets the list of Eo operations to override.</summary>
185 /// <returns>The list of Eo operations to be overload.</returns>
186 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
188 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
189 var methods = Efl.Eo.Globals.GetUserMethods(type);
191 if (efl_access_widget_action_elm_actions_get_static_delegate == null)
193 efl_access_widget_action_elm_actions_get_static_delegate = new efl_access_widget_action_elm_actions_get_delegate(elm_actions_get);
196 if (methods.FirstOrDefault(m => m.Name == "GetElmActions") != null)
198 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_access_widget_action_elm_actions_get"), func = Marshal.GetFunctionPointerForDelegate(efl_access_widget_action_elm_actions_get_static_delegate) });
201 if (efl_access_action_name_get_static_delegate == null)
203 efl_access_action_name_get_static_delegate = new efl_access_action_name_get_delegate(action_name_get);
206 if (methods.FirstOrDefault(m => m.Name == "GetActionName") != null)
208 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_access_action_name_get"), func = Marshal.GetFunctionPointerForDelegate(efl_access_action_name_get_static_delegate) });
211 if (efl_access_action_localized_name_get_static_delegate == null)
213 efl_access_action_localized_name_get_static_delegate = new efl_access_action_localized_name_get_delegate(action_localized_name_get);
216 if (methods.FirstOrDefault(m => m.Name == "GetActionLocalizedName") != null)
218 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_access_action_localized_name_get"), func = Marshal.GetFunctionPointerForDelegate(efl_access_action_localized_name_get_static_delegate) });
221 if (efl_access_action_actions_get_static_delegate == null)
223 efl_access_action_actions_get_static_delegate = new efl_access_action_actions_get_delegate(actions_get);
226 if (methods.FirstOrDefault(m => m.Name == "GetActions") != null)
228 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_access_action_actions_get"), func = Marshal.GetFunctionPointerForDelegate(efl_access_action_actions_get_static_delegate) });
231 if (efl_access_action_do_static_delegate == null)
233 efl_access_action_do_static_delegate = new efl_access_action_do_delegate(action_do);
236 if (methods.FirstOrDefault(m => m.Name == "ActionDo") != null)
238 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_access_action_do"), func = Marshal.GetFunctionPointerForDelegate(efl_access_action_do_static_delegate) });
241 if (efl_access_action_keybinding_get_static_delegate == null)
243 efl_access_action_keybinding_get_static_delegate = new efl_access_action_keybinding_get_delegate(action_keybinding_get);
246 if (methods.FirstOrDefault(m => m.Name == "GetActionKeybinding") != null)
248 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_access_action_keybinding_get"), func = Marshal.GetFunctionPointerForDelegate(efl_access_action_keybinding_get_static_delegate) });
253 /// <summary>Returns the Eo class for the native methods of this class.</summary>
254 /// <returns>The native class pointer.</returns>
255 public override IntPtr GetEflClass()
257 return Efl.Access.Widget.IActionConcrete.efl_access_widget_action_mixin_get();
260 #pragma warning disable CA1707, CS1591, SA1300, SA1600
263 private delegate Efl.Access.ActionData efl_access_widget_action_elm_actions_get_delegate(System.IntPtr obj, System.IntPtr pd);
266 public delegate Efl.Access.ActionData efl_access_widget_action_elm_actions_get_api_delegate(System.IntPtr obj);
268 public static Efl.Eo.FunctionWrapper<efl_access_widget_action_elm_actions_get_api_delegate> efl_access_widget_action_elm_actions_get_ptr = new Efl.Eo.FunctionWrapper<efl_access_widget_action_elm_actions_get_api_delegate>(Module, "efl_access_widget_action_elm_actions_get");
270 private static Efl.Access.ActionData elm_actions_get(System.IntPtr obj, System.IntPtr pd)
272 Eina.Log.Debug("function efl_access_widget_action_elm_actions_get was called");
273 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
276 Efl.Access.ActionData _ret_var = default(Efl.Access.ActionData);
279 _ret_var = ((IAction)ws.Target).GetElmActions();
283 Eina.Log.Warning($"Callback error: {e.ToString()}");
284 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
292 return efl_access_widget_action_elm_actions_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
296 private static efl_access_widget_action_elm_actions_get_delegate efl_access_widget_action_elm_actions_get_static_delegate;
298 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
299 private delegate System.String efl_access_action_name_get_delegate(System.IntPtr obj, System.IntPtr pd, int id);
301 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
302 public delegate System.String efl_access_action_name_get_api_delegate(System.IntPtr obj, int id);
304 public static Efl.Eo.FunctionWrapper<efl_access_action_name_get_api_delegate> efl_access_action_name_get_ptr = new Efl.Eo.FunctionWrapper<efl_access_action_name_get_api_delegate>(Module, "efl_access_action_name_get");
306 private static System.String action_name_get(System.IntPtr obj, System.IntPtr pd, int id)
308 Eina.Log.Debug("function efl_access_action_name_get was called");
309 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
312 System.String _ret_var = default(System.String);
315 _ret_var = ((IAction)ws.Target).GetActionName(id);
319 Eina.Log.Warning($"Callback error: {e.ToString()}");
320 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
328 return efl_access_action_name_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
332 private static efl_access_action_name_get_delegate efl_access_action_name_get_static_delegate;
334 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
335 private delegate System.String efl_access_action_localized_name_get_delegate(System.IntPtr obj, System.IntPtr pd, int id);
337 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
338 public delegate System.String efl_access_action_localized_name_get_api_delegate(System.IntPtr obj, int id);
340 public static Efl.Eo.FunctionWrapper<efl_access_action_localized_name_get_api_delegate> efl_access_action_localized_name_get_ptr = new Efl.Eo.FunctionWrapper<efl_access_action_localized_name_get_api_delegate>(Module, "efl_access_action_localized_name_get");
342 private static System.String action_localized_name_get(System.IntPtr obj, System.IntPtr pd, int id)
344 Eina.Log.Debug("function efl_access_action_localized_name_get was called");
345 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
348 System.String _ret_var = default(System.String);
351 _ret_var = ((IAction)ws.Target).GetActionLocalizedName(id);
355 Eina.Log.Warning($"Callback error: {e.ToString()}");
356 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
364 return efl_access_action_localized_name_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
368 private static efl_access_action_localized_name_get_delegate efl_access_action_localized_name_get_static_delegate;
371 private delegate System.IntPtr efl_access_action_actions_get_delegate(System.IntPtr obj, System.IntPtr pd);
374 public delegate System.IntPtr efl_access_action_actions_get_api_delegate(System.IntPtr obj);
376 public static Efl.Eo.FunctionWrapper<efl_access_action_actions_get_api_delegate> efl_access_action_actions_get_ptr = new Efl.Eo.FunctionWrapper<efl_access_action_actions_get_api_delegate>(Module, "efl_access_action_actions_get");
378 private static System.IntPtr actions_get(System.IntPtr obj, System.IntPtr pd)
380 Eina.Log.Debug("function efl_access_action_actions_get was called");
381 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
384 Eina.List<Efl.Access.ActionData> _ret_var = default(Eina.List<Efl.Access.ActionData>);
387 _ret_var = ((IAction)ws.Target).GetActions();
391 Eina.Log.Warning($"Callback error: {e.ToString()}");
392 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
395 return _ret_var.Handle;
400 return efl_access_action_actions_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
404 private static efl_access_action_actions_get_delegate efl_access_action_actions_get_static_delegate;
406 [return: MarshalAs(UnmanagedType.U1)]
407 private delegate bool efl_access_action_do_delegate(System.IntPtr obj, System.IntPtr pd, int id);
409 [return: MarshalAs(UnmanagedType.U1)]
410 public delegate bool efl_access_action_do_api_delegate(System.IntPtr obj, int id);
412 public static Efl.Eo.FunctionWrapper<efl_access_action_do_api_delegate> efl_access_action_do_ptr = new Efl.Eo.FunctionWrapper<efl_access_action_do_api_delegate>(Module, "efl_access_action_do");
414 private static bool action_do(System.IntPtr obj, System.IntPtr pd, int id)
416 Eina.Log.Debug("function efl_access_action_do was called");
417 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
420 bool _ret_var = default(bool);
423 _ret_var = ((IAction)ws.Target).ActionDo(id);
427 Eina.Log.Warning($"Callback error: {e.ToString()}");
428 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
436 return efl_access_action_do_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
440 private static efl_access_action_do_delegate efl_access_action_do_static_delegate;
442 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
443 private delegate System.String efl_access_action_keybinding_get_delegate(System.IntPtr obj, System.IntPtr pd, int id);
445 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
446 public delegate System.String efl_access_action_keybinding_get_api_delegate(System.IntPtr obj, int id);
448 public static Efl.Eo.FunctionWrapper<efl_access_action_keybinding_get_api_delegate> efl_access_action_keybinding_get_ptr = new Efl.Eo.FunctionWrapper<efl_access_action_keybinding_get_api_delegate>(Module, "efl_access_action_keybinding_get");
450 private static System.String action_keybinding_get(System.IntPtr obj, System.IntPtr pd, int id)
452 Eina.Log.Debug("function efl_access_action_keybinding_get was called");
453 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
456 System.String _ret_var = default(System.String);
459 _ret_var = ((IAction)ws.Target).GetActionKeybinding(id);
463 Eina.Log.Warning($"Callback error: {e.ToString()}");
464 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
472 return efl_access_action_keybinding_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
476 private static efl_access_action_keybinding_get_delegate efl_access_action_keybinding_get_static_delegate;
478 #pragma warning restore CA1707, CS1591, SA1300, SA1600