1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Access {
8 /// <summary>Accessible action mixin</summary>
10 public interface IAction :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Gets action name for given id</summary>
14 /// <param name="id">ID to get action name for</param>
15 /// <returns>Action name</returns>
16 System.String GetActionName( int id);
17 /// <summary>Gets localized action name for given id</summary>
18 /// <param name="id">ID to get localized name for</param>
19 /// <returns>Localized name</returns>
20 System.String GetActionLocalizedName( int id);
21 /// <summary>Get list of available widget actions</summary>
22 /// <returns>Contains statically allocated strings.</returns>
23 Eina.List<Efl.Access.ActionData> GetActions();
24 /// <summary>Performs action on given widget.</summary>
25 /// <param name="id">ID for widget</param>
26 /// <returns><c>true</c> if action was performed, <c>false</c> otherwise</returns>
27 bool ActionDo( int id);
28 /// <summary>Gets configured keybinding for specific action and widget.</summary>
29 /// <param name="id">ID for widget</param>
30 /// <returns>Should be freed by the user.</returns>
31 System.String GetActionKeybinding( int id);
32 /// <summary>Get list of available widget actions</summary>
33 /// <value>Contains statically allocated strings.</value>
34 Eina.List<Efl.Access.ActionData> Actions {
38 /// <summary>Accessible action mixin</summary>
39 sealed public class IActionConcrete :
44 ///<summary>Pointer to the native class description.</summary>
45 public System.IntPtr NativeClass {
47 if (((object)this).GetType() == typeof (IActionConcrete))
48 return Efl.Access.IActionNativeInherit.GetEflClassStatic();
50 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
53 private System.IntPtr handle;
54 ///<summary>Pointer to the native instance.</summary>
55 public System.IntPtr NativeHandle {
56 get { return handle; }
58 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
59 efl_access_action_mixin_get();
60 ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
61 private IActionConcrete(System.IntPtr raw)
64 RegisterEventProxies();
66 ///<summary>Destructor.</summary>
71 ///<summary>Releases the underlying native instance.</summary>
72 void Dispose(bool disposing)
74 if (handle != System.IntPtr.Zero) {
75 Efl.Eo.Globals.efl_unref(handle);
76 handle = System.IntPtr.Zero;
79 ///<summary>Releases the underlying native instance.</summary>
83 GC.SuppressFinalize(this);
85 ///<summary>Verifies if the given object is equal to this one.</summary>
86 public override bool Equals(object obj)
88 var other = obj as Efl.Object;
91 return this.NativeHandle == other.NativeHandle;
93 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
94 public override int GetHashCode()
96 return this.NativeHandle.ToInt32();
98 ///<summary>Turns the native pointer into a string representation.</summary>
99 public override String ToString()
101 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
103 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
104 void RegisterEventProxies()
107 /// <summary>Gets action name for given id</summary>
108 /// <param name="id">ID to get action name for</param>
109 /// <returns>Action name</returns>
110 public System.String GetActionName( int id) {
111 var _ret_var = Efl.Access.IActionNativeInherit.efl_access_action_name_get_ptr.Value.Delegate(this.NativeHandle, id);
112 Eina.Error.RaiseIfUnhandledException();
115 /// <summary>Gets localized action name for given id</summary>
116 /// <param name="id">ID to get localized name for</param>
117 /// <returns>Localized name</returns>
118 public System.String GetActionLocalizedName( int id) {
119 var _ret_var = Efl.Access.IActionNativeInherit.efl_access_action_localized_name_get_ptr.Value.Delegate(this.NativeHandle, id);
120 Eina.Error.RaiseIfUnhandledException();
123 /// <summary>Get list of available widget actions</summary>
124 /// <returns>Contains statically allocated strings.</returns>
125 public Eina.List<Efl.Access.ActionData> GetActions() {
126 var _ret_var = Efl.Access.IActionNativeInherit.efl_access_action_actions_get_ptr.Value.Delegate(this.NativeHandle);
127 Eina.Error.RaiseIfUnhandledException();
128 return new Eina.List<Efl.Access.ActionData>(_ret_var, false, false);
130 /// <summary>Performs action on given widget.</summary>
131 /// <param name="id">ID for widget</param>
132 /// <returns><c>true</c> if action was performed, <c>false</c> otherwise</returns>
133 public bool ActionDo( int id) {
134 var _ret_var = Efl.Access.IActionNativeInherit.efl_access_action_do_ptr.Value.Delegate(this.NativeHandle, id);
135 Eina.Error.RaiseIfUnhandledException();
138 /// <summary>Gets configured keybinding for specific action and widget.</summary>
139 /// <param name="id">ID for widget</param>
140 /// <returns>Should be freed by the user.</returns>
141 public System.String GetActionKeybinding( int id) {
142 var _ret_var = Efl.Access.IActionNativeInherit.efl_access_action_keybinding_get_ptr.Value.Delegate(this.NativeHandle, id);
143 Eina.Error.RaiseIfUnhandledException();
146 /// <summary>Get list of available widget actions</summary>
147 /// <value>Contains statically allocated strings.</value>
148 public Eina.List<Efl.Access.ActionData> Actions {
149 get { return GetActions(); }
151 private static IntPtr GetEflClassStatic()
153 return Efl.Access.IActionConcrete.efl_access_action_mixin_get();
156 public class IActionNativeInherit : Efl.Eo.NativeClass{
157 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
158 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
160 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
161 var methods = Efl.Eo.Globals.GetUserMethods(type);
162 if (efl_access_action_name_get_static_delegate == null)
163 efl_access_action_name_get_static_delegate = new efl_access_action_name_get_delegate(action_name_get);
164 if (methods.FirstOrDefault(m => m.Name == "GetActionName") != null)
165 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)});
166 if (efl_access_action_localized_name_get_static_delegate == null)
167 efl_access_action_localized_name_get_static_delegate = new efl_access_action_localized_name_get_delegate(action_localized_name_get);
168 if (methods.FirstOrDefault(m => m.Name == "GetActionLocalizedName") != null)
169 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)});
170 if (efl_access_action_actions_get_static_delegate == null)
171 efl_access_action_actions_get_static_delegate = new efl_access_action_actions_get_delegate(actions_get);
172 if (methods.FirstOrDefault(m => m.Name == "GetActions") != null)
173 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)});
174 if (efl_access_action_do_static_delegate == null)
175 efl_access_action_do_static_delegate = new efl_access_action_do_delegate(action_do);
176 if (methods.FirstOrDefault(m => m.Name == "ActionDo") != null)
177 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)});
178 if (efl_access_action_keybinding_get_static_delegate == null)
179 efl_access_action_keybinding_get_static_delegate = new efl_access_action_keybinding_get_delegate(action_keybinding_get);
180 if (methods.FirstOrDefault(m => m.Name == "GetActionKeybinding") != null)
181 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)});
184 public override IntPtr GetEflClass()
186 return Efl.Access.IActionConcrete.efl_access_action_mixin_get();
188 public static IntPtr GetEflClassStatic()
190 return Efl.Access.IActionConcrete.efl_access_action_mixin_get();
194 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] private delegate System.String efl_access_action_name_get_delegate(System.IntPtr obj, System.IntPtr pd, int id);
197 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] public delegate System.String efl_access_action_name_get_api_delegate(System.IntPtr obj, int id);
198 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");
199 private static System.String action_name_get(System.IntPtr obj, System.IntPtr pd, int id)
201 Eina.Log.Debug("function efl_access_action_name_get was called");
202 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
203 if(wrapper != null) {
204 System.String _ret_var = default(System.String);
206 _ret_var = ((IActionConcrete)wrapper).GetActionName( id);
207 } catch (Exception e) {
208 Eina.Log.Warning($"Callback error: {e.ToString()}");
209 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
213 return efl_access_action_name_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
216 private static efl_access_action_name_get_delegate efl_access_action_name_get_static_delegate;
219 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] private delegate System.String efl_access_action_localized_name_get_delegate(System.IntPtr obj, System.IntPtr pd, int id);
222 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] public delegate System.String efl_access_action_localized_name_get_api_delegate(System.IntPtr obj, int id);
223 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");
224 private static System.String action_localized_name_get(System.IntPtr obj, System.IntPtr pd, int id)
226 Eina.Log.Debug("function efl_access_action_localized_name_get was called");
227 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
228 if(wrapper != null) {
229 System.String _ret_var = default(System.String);
231 _ret_var = ((IActionConcrete)wrapper).GetActionLocalizedName( id);
232 } catch (Exception e) {
233 Eina.Log.Warning($"Callback error: {e.ToString()}");
234 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
238 return efl_access_action_localized_name_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
241 private static efl_access_action_localized_name_get_delegate efl_access_action_localized_name_get_static_delegate;
244 private delegate System.IntPtr efl_access_action_actions_get_delegate(System.IntPtr obj, System.IntPtr pd);
247 public delegate System.IntPtr efl_access_action_actions_get_api_delegate(System.IntPtr obj);
248 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");
249 private static System.IntPtr actions_get(System.IntPtr obj, System.IntPtr pd)
251 Eina.Log.Debug("function efl_access_action_actions_get was called");
252 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
253 if(wrapper != null) {
254 Eina.List<Efl.Access.ActionData> _ret_var = default(Eina.List<Efl.Access.ActionData>);
256 _ret_var = ((IActionConcrete)wrapper).GetActions();
257 } catch (Exception e) {
258 Eina.Log.Warning($"Callback error: {e.ToString()}");
259 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
261 return _ret_var.Handle;
263 return efl_access_action_actions_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
266 private static efl_access_action_actions_get_delegate efl_access_action_actions_get_static_delegate;
269 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_access_action_do_delegate(System.IntPtr obj, System.IntPtr pd, int id);
272 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_access_action_do_api_delegate(System.IntPtr obj, int id);
273 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");
274 private static bool action_do(System.IntPtr obj, System.IntPtr pd, int id)
276 Eina.Log.Debug("function efl_access_action_do was called");
277 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
278 if(wrapper != null) {
279 bool _ret_var = default(bool);
281 _ret_var = ((IActionConcrete)wrapper).ActionDo( id);
282 } catch (Exception e) {
283 Eina.Log.Warning($"Callback error: {e.ToString()}");
284 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
288 return efl_access_action_do_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
291 private static efl_access_action_do_delegate efl_access_action_do_static_delegate;
294 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))] private delegate System.String efl_access_action_keybinding_get_delegate(System.IntPtr obj, System.IntPtr pd, int id);
297 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))] public delegate System.String efl_access_action_keybinding_get_api_delegate(System.IntPtr obj, int id);
298 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");
299 private static System.String action_keybinding_get(System.IntPtr obj, System.IntPtr pd, int id)
301 Eina.Log.Debug("function efl_access_action_keybinding_get was called");
302 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
303 if(wrapper != null) {
304 System.String _ret_var = default(System.String);
306 _ret_var = ((IActionConcrete)wrapper).GetActionKeybinding( id);
307 } catch (Exception e) {
308 Eina.Log.Warning($"Callback error: {e.ToString()}");
309 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
313 return efl_access_action_keybinding_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
316 private static efl_access_action_keybinding_get_delegate efl_access_action_keybinding_get_static_delegate;