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 public interface IAction :
18 Efl.Eo.IWrapper, IDisposable
20 /// <summary>Elementary actions</summary>
21 /// <returns>NULL-terminated array of Efl.Access.Action_Data.</returns>
22 Efl.Access.ActionData GetElmActions();
23 event EventHandler ReadingStateChangedEvt;
24 /// <summary>Elementary actions</summary>
25 /// <value>NULL-terminated array of Efl.Access.Action_Data.</value>
26 Efl.Access.ActionData ElmActions {
30 /// <summary>Access widget action mixin</summary>
31 sealed public class IActionConcrete :
36 ///<summary>Pointer to the native class description.</summary>
37 public override System.IntPtr NativeClass
41 if (((object)this).GetType() == typeof(IActionConcrete))
43 return GetEflClassStatic();
47 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
52 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
53 efl_access_widget_action_mixin_get();
54 /// <summary>Initializes a new instance of the <see cref="IAction"/> class.
55 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
56 private IActionConcrete(System.IntPtr raw) : base(raw)
60 public event EventHandler ReadingStateChangedEvt
66 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
68 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
71 EventArgs args = EventArgs.Empty;
74 value?.Invoke(obj, args);
78 Eina.Log.Error(e.ToString());
79 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
84 string key = "_EFL_ACCESS_WIDGET_ACTION_EVENT_READING_STATE_CHANGED";
85 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
93 string key = "_EFL_ACCESS_WIDGET_ACTION_EVENT_READING_STATE_CHANGED";
94 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
98 ///<summary>Method to raise event ReadingStateChangedEvt.</summary>
99 public void OnReadingStateChangedEvt(EventArgs e)
101 var key = "_EFL_ACCESS_WIDGET_ACTION_EVENT_READING_STATE_CHANGED";
102 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
103 if (desc == IntPtr.Zero)
105 Eina.Log.Error($"Failed to get native event {key}");
109 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
111 /// <summary>Elementary actions</summary>
112 /// <returns>NULL-terminated array of Efl.Access.Action_Data.</returns>
113 public Efl.Access.ActionData GetElmActions() {
114 var _ret_var = Efl.Access.Widget.IActionConcrete.NativeMethods.efl_access_widget_action_elm_actions_get_ptr.Value.Delegate(this.NativeHandle);
115 Eina.Error.RaiseIfUnhandledException();
118 /// <summary>Gets action name for given id</summary>
119 /// <param name="id">ID to get action name for</param>
120 /// <returns>Action name</returns>
121 public System.String GetActionName(int id) {
122 var _ret_var = Efl.Access.IActionConcrete.NativeMethods.efl_access_action_name_get_ptr.Value.Delegate(this.NativeHandle,id);
123 Eina.Error.RaiseIfUnhandledException();
126 /// <summary>Gets localized action name for given id</summary>
127 /// <param name="id">ID to get localized name for</param>
128 /// <returns>Localized name</returns>
129 public System.String GetActionLocalizedName(int id) {
130 var _ret_var = Efl.Access.IActionConcrete.NativeMethods.efl_access_action_localized_name_get_ptr.Value.Delegate(this.NativeHandle,id);
131 Eina.Error.RaiseIfUnhandledException();
134 /// <summary>Get list of available widget actions</summary>
135 /// <returns>Contains statically allocated strings.</returns>
136 public Eina.List<Efl.Access.ActionData> GetActions() {
137 var _ret_var = Efl.Access.IActionConcrete.NativeMethods.efl_access_action_actions_get_ptr.Value.Delegate(this.NativeHandle);
138 Eina.Error.RaiseIfUnhandledException();
139 return new Eina.List<Efl.Access.ActionData>(_ret_var, false, false);
141 /// <summary>Performs action on given widget.</summary>
142 /// <param name="id">ID for widget</param>
143 /// <returns><c>true</c> if action was performed, <c>false</c> otherwise</returns>
144 public bool ActionDo(int id) {
145 var _ret_var = Efl.Access.IActionConcrete.NativeMethods.efl_access_action_do_ptr.Value.Delegate(this.NativeHandle,id);
146 Eina.Error.RaiseIfUnhandledException();
149 /// <summary>Gets configured keybinding for specific action and widget.</summary>
150 /// <param name="id">ID for widget</param>
151 /// <returns>Should be freed by the user.</returns>
152 public System.String GetActionKeybinding(int id) {
153 var _ret_var = Efl.Access.IActionConcrete.NativeMethods.efl_access_action_keybinding_get_ptr.Value.Delegate(this.NativeHandle,id);
154 Eina.Error.RaiseIfUnhandledException();
157 /// <summary>Elementary actions</summary>
158 /// <value>NULL-terminated array of Efl.Access.Action_Data.</value>
159 public Efl.Access.ActionData ElmActions {
160 get { return GetElmActions(); }
162 /// <summary>Get list of available widget actions</summary>
163 /// <value>Contains statically allocated strings.</value>
164 public Eina.List<Efl.Access.ActionData> Actions {
165 get { return GetActions(); }
167 private static IntPtr GetEflClassStatic()
169 return Efl.Access.Widget.IActionConcrete.efl_access_widget_action_mixin_get();
171 /// <summary>Wrapper for native methods and virtual method delegates.
172 /// For internal use by generated code only.</summary>
173 public class NativeMethods : Efl.Eo.NativeClass
175 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
176 /// <summary>Gets the list of Eo operations to override.</summary>
177 /// <returns>The list of Eo operations to be overload.</returns>
178 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
180 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
181 var methods = Efl.Eo.Globals.GetUserMethods(type);
183 if (efl_access_widget_action_elm_actions_get_static_delegate == null)
185 efl_access_widget_action_elm_actions_get_static_delegate = new efl_access_widget_action_elm_actions_get_delegate(elm_actions_get);
188 if (methods.FirstOrDefault(m => m.Name == "GetElmActions") != null)
190 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) });
193 if (efl_access_action_name_get_static_delegate == null)
195 efl_access_action_name_get_static_delegate = new efl_access_action_name_get_delegate(action_name_get);
198 if (methods.FirstOrDefault(m => m.Name == "GetActionName") != null)
200 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) });
203 if (efl_access_action_localized_name_get_static_delegate == null)
205 efl_access_action_localized_name_get_static_delegate = new efl_access_action_localized_name_get_delegate(action_localized_name_get);
208 if (methods.FirstOrDefault(m => m.Name == "GetActionLocalizedName") != null)
210 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) });
213 if (efl_access_action_actions_get_static_delegate == null)
215 efl_access_action_actions_get_static_delegate = new efl_access_action_actions_get_delegate(actions_get);
218 if (methods.FirstOrDefault(m => m.Name == "GetActions") != null)
220 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) });
223 if (efl_access_action_do_static_delegate == null)
225 efl_access_action_do_static_delegate = new efl_access_action_do_delegate(action_do);
228 if (methods.FirstOrDefault(m => m.Name == "ActionDo") != null)
230 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) });
233 if (efl_access_action_keybinding_get_static_delegate == null)
235 efl_access_action_keybinding_get_static_delegate = new efl_access_action_keybinding_get_delegate(action_keybinding_get);
238 if (methods.FirstOrDefault(m => m.Name == "GetActionKeybinding") != null)
240 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) });
245 /// <summary>Returns the Eo class for the native methods of this class.</summary>
246 /// <returns>The native class pointer.</returns>
247 public override IntPtr GetEflClass()
249 return Efl.Access.Widget.IActionConcrete.efl_access_widget_action_mixin_get();
252 #pragma warning disable CA1707, CS1591, SA1300, SA1600
255 private delegate Efl.Access.ActionData efl_access_widget_action_elm_actions_get_delegate(System.IntPtr obj, System.IntPtr pd);
258 public delegate Efl.Access.ActionData efl_access_widget_action_elm_actions_get_api_delegate(System.IntPtr obj);
260 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");
262 private static Efl.Access.ActionData elm_actions_get(System.IntPtr obj, System.IntPtr pd)
264 Eina.Log.Debug("function efl_access_widget_action_elm_actions_get was called");
265 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
268 Efl.Access.ActionData _ret_var = default(Efl.Access.ActionData);
271 _ret_var = ((IActionConcrete)ws.Target).GetElmActions();
275 Eina.Log.Warning($"Callback error: {e.ToString()}");
276 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
284 return efl_access_widget_action_elm_actions_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
288 private static efl_access_widget_action_elm_actions_get_delegate efl_access_widget_action_elm_actions_get_static_delegate;
290 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
291 private delegate System.String efl_access_action_name_get_delegate(System.IntPtr obj, System.IntPtr pd, int id);
293 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
294 public delegate System.String efl_access_action_name_get_api_delegate(System.IntPtr obj, int id);
296 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");
298 private static System.String action_name_get(System.IntPtr obj, System.IntPtr pd, int id)
300 Eina.Log.Debug("function efl_access_action_name_get was called");
301 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
304 System.String _ret_var = default(System.String);
307 _ret_var = ((IActionConcrete)ws.Target).GetActionName(id);
311 Eina.Log.Warning($"Callback error: {e.ToString()}");
312 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
320 return efl_access_action_name_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
324 private static efl_access_action_name_get_delegate efl_access_action_name_get_static_delegate;
326 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
327 private delegate System.String efl_access_action_localized_name_get_delegate(System.IntPtr obj, System.IntPtr pd, int id);
329 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
330 public delegate System.String efl_access_action_localized_name_get_api_delegate(System.IntPtr obj, int id);
332 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");
334 private static System.String action_localized_name_get(System.IntPtr obj, System.IntPtr pd, int id)
336 Eina.Log.Debug("function efl_access_action_localized_name_get was called");
337 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
340 System.String _ret_var = default(System.String);
343 _ret_var = ((IActionConcrete)ws.Target).GetActionLocalizedName(id);
347 Eina.Log.Warning($"Callback error: {e.ToString()}");
348 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
356 return efl_access_action_localized_name_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
360 private static efl_access_action_localized_name_get_delegate efl_access_action_localized_name_get_static_delegate;
363 private delegate System.IntPtr efl_access_action_actions_get_delegate(System.IntPtr obj, System.IntPtr pd);
366 public delegate System.IntPtr efl_access_action_actions_get_api_delegate(System.IntPtr obj);
368 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");
370 private static System.IntPtr actions_get(System.IntPtr obj, System.IntPtr pd)
372 Eina.Log.Debug("function efl_access_action_actions_get was called");
373 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
376 Eina.List<Efl.Access.ActionData> _ret_var = default(Eina.List<Efl.Access.ActionData>);
379 _ret_var = ((IActionConcrete)ws.Target).GetActions();
383 Eina.Log.Warning($"Callback error: {e.ToString()}");
384 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
387 return _ret_var.Handle;
392 return efl_access_action_actions_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
396 private static efl_access_action_actions_get_delegate efl_access_action_actions_get_static_delegate;
398 [return: MarshalAs(UnmanagedType.U1)]
399 private delegate bool efl_access_action_do_delegate(System.IntPtr obj, System.IntPtr pd, int id);
401 [return: MarshalAs(UnmanagedType.U1)]
402 public delegate bool efl_access_action_do_api_delegate(System.IntPtr obj, int id);
404 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");
406 private static bool action_do(System.IntPtr obj, System.IntPtr pd, int id)
408 Eina.Log.Debug("function efl_access_action_do was called");
409 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
412 bool _ret_var = default(bool);
415 _ret_var = ((IActionConcrete)ws.Target).ActionDo(id);
419 Eina.Log.Warning($"Callback error: {e.ToString()}");
420 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
428 return efl_access_action_do_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
432 private static efl_access_action_do_delegate efl_access_action_do_static_delegate;
434 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
435 private delegate System.String efl_access_action_keybinding_get_delegate(System.IntPtr obj, System.IntPtr pd, int id);
437 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
438 public delegate System.String efl_access_action_keybinding_get_api_delegate(System.IntPtr obj, int id);
440 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");
442 private static System.String action_keybinding_get(System.IntPtr obj, System.IntPtr pd, int id)
444 Eina.Log.Debug("function efl_access_action_keybinding_get was called");
445 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
448 System.String _ret_var = default(System.String);
451 _ret_var = ((IActionConcrete)ws.Target).GetActionKeybinding(id);
455 Eina.Log.Warning($"Callback error: {e.ToString()}");
456 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
464 return efl_access_action_keybinding_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
468 private static efl_access_action_keybinding_get_delegate efl_access_action_keybinding_get_static_delegate;
470 #pragma warning restore CA1707, CS1591, SA1300, SA1600