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 Action :
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 ActionConcrete :
44 ///<summary>Pointer to the native class description.</summary>
45 public System.IntPtr NativeClass {
47 if (((object)this).GetType() == typeof (ActionConcrete))
48 return Efl.Access.ActionNativeInherit.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 public ActionConcrete(System.IntPtr raw)
64 register_event_proxies();
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>Casts obj into an instance of this type.</summary>
86 public static ActionConcrete static_cast(Efl.Object obj)
89 throw new System.ArgumentNullException("obj");
90 return new ActionConcrete(obj.NativeHandle);
92 ///<summary>Verifies if the given object is equal to this one.</summary>
93 public override bool Equals(object obj)
95 var other = obj as Efl.Object;
98 return this.NativeHandle == other.NativeHandle;
100 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
101 public override int GetHashCode()
103 return this.NativeHandle.ToInt32();
105 ///<summary>Turns the native pointer into a string representation.</summary>
106 public override String ToString()
108 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
110 void register_event_proxies()
113 /// <summary>Gets action name for given id</summary>
114 /// <param name="id">ID to get action name for</param>
115 /// <returns>Action name</returns>
116 public System.String GetActionName( int id) {
117 var _ret_var = Efl.Access.ActionNativeInherit.efl_access_action_name_get_ptr.Value.Delegate(this.NativeHandle, id);
118 Eina.Error.RaiseIfUnhandledException();
121 /// <summary>Gets localized action name for given id</summary>
122 /// <param name="id">ID to get localized name for</param>
123 /// <returns>Localized name</returns>
124 public System.String GetActionLocalizedName( int id) {
125 var _ret_var = Efl.Access.ActionNativeInherit.efl_access_action_localized_name_get_ptr.Value.Delegate(this.NativeHandle, id);
126 Eina.Error.RaiseIfUnhandledException();
129 /// <summary>Get list of available widget actions</summary>
130 /// <returns>Contains statically allocated strings.</returns>
131 public Eina.List<Efl.Access.ActionData> GetActions() {
132 var _ret_var = Efl.Access.ActionNativeInherit.efl_access_action_actions_get_ptr.Value.Delegate(this.NativeHandle);
133 Eina.Error.RaiseIfUnhandledException();
134 return new Eina.List<Efl.Access.ActionData>(_ret_var, false, false);
136 /// <summary>Performs action on given widget.</summary>
137 /// <param name="id">ID for widget</param>
138 /// <returns><c>true</c> if action was performed, <c>false</c> otherwise</returns>
139 public bool ActionDo( int id) {
140 var _ret_var = Efl.Access.ActionNativeInherit.efl_access_action_do_ptr.Value.Delegate(this.NativeHandle, id);
141 Eina.Error.RaiseIfUnhandledException();
144 /// <summary>Gets configured keybinding for specific action and widget.</summary>
145 /// <param name="id">ID for widget</param>
146 /// <returns>Should be freed by the user.</returns>
147 public System.String GetActionKeybinding( int id) {
148 var _ret_var = Efl.Access.ActionNativeInherit.efl_access_action_keybinding_get_ptr.Value.Delegate(this.NativeHandle, id);
149 Eina.Error.RaiseIfUnhandledException();
152 /// <summary>Get list of available widget actions</summary>
153 /// <value>Contains statically allocated strings.</value>
154 public Eina.List<Efl.Access.ActionData> Actions {
155 get { return GetActions(); }
158 public class ActionNativeInherit : Efl.Eo.NativeClass{
159 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
160 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
162 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
163 if (efl_access_action_name_get_static_delegate == null)
164 efl_access_action_name_get_static_delegate = new efl_access_action_name_get_delegate(action_name_get);
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 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)});
169 if (efl_access_action_actions_get_static_delegate == null)
170 efl_access_action_actions_get_static_delegate = new efl_access_action_actions_get_delegate(actions_get);
171 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)});
172 if (efl_access_action_do_static_delegate == null)
173 efl_access_action_do_static_delegate = new efl_access_action_do_delegate(action_do);
174 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)});
175 if (efl_access_action_keybinding_get_static_delegate == null)
176 efl_access_action_keybinding_get_static_delegate = new efl_access_action_keybinding_get_delegate(action_keybinding_get);
177 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)});
180 public override IntPtr GetEflClass()
182 return Efl.Access.ActionConcrete.efl_access_action_mixin_get();
184 public static IntPtr GetEflClassStatic()
186 return Efl.Access.ActionConcrete.efl_access_action_mixin_get();
190 [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);
193 [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);
194 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");
195 private static System.String action_name_get(System.IntPtr obj, System.IntPtr pd, int id)
197 Eina.Log.Debug("function efl_access_action_name_get was called");
198 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
199 if(wrapper != null) {
200 System.String _ret_var = default( System.String);
202 _ret_var = ((ActionConcrete)wrapper).GetActionName( id);
203 } catch (Exception e) {
204 Eina.Log.Warning($"Callback error: {e.ToString()}");
205 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
209 return efl_access_action_name_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
212 private static efl_access_action_name_get_delegate efl_access_action_name_get_static_delegate;
215 [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);
218 [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);
219 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");
220 private static System.String action_localized_name_get(System.IntPtr obj, System.IntPtr pd, int id)
222 Eina.Log.Debug("function efl_access_action_localized_name_get was called");
223 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
224 if(wrapper != null) {
225 System.String _ret_var = default( System.String);
227 _ret_var = ((ActionConcrete)wrapper).GetActionLocalizedName( id);
228 } catch (Exception e) {
229 Eina.Log.Warning($"Callback error: {e.ToString()}");
230 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
234 return efl_access_action_localized_name_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
237 private static efl_access_action_localized_name_get_delegate efl_access_action_localized_name_get_static_delegate;
240 private delegate System.IntPtr efl_access_action_actions_get_delegate(System.IntPtr obj, System.IntPtr pd);
243 public delegate System.IntPtr efl_access_action_actions_get_api_delegate(System.IntPtr obj);
244 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");
245 private static System.IntPtr actions_get(System.IntPtr obj, System.IntPtr pd)
247 Eina.Log.Debug("function efl_access_action_actions_get was called");
248 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
249 if(wrapper != null) {
250 Eina.List<Efl.Access.ActionData> _ret_var = default(Eina.List<Efl.Access.ActionData>);
252 _ret_var = ((ActionConcrete)wrapper).GetActions();
253 } catch (Exception e) {
254 Eina.Log.Warning($"Callback error: {e.ToString()}");
255 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
257 return _ret_var.Handle;
259 return efl_access_action_actions_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
262 private static efl_access_action_actions_get_delegate efl_access_action_actions_get_static_delegate;
265 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_access_action_do_delegate(System.IntPtr obj, System.IntPtr pd, int id);
268 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_access_action_do_api_delegate(System.IntPtr obj, int id);
269 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");
270 private static bool action_do(System.IntPtr obj, System.IntPtr pd, int id)
272 Eina.Log.Debug("function efl_access_action_do was called");
273 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
274 if(wrapper != null) {
275 bool _ret_var = default(bool);
277 _ret_var = ((ActionConcrete)wrapper).ActionDo( id);
278 } catch (Exception e) {
279 Eina.Log.Warning($"Callback error: {e.ToString()}");
280 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
284 return efl_access_action_do_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
287 private static efl_access_action_do_delegate efl_access_action_do_static_delegate;
290 [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);
293 [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);
294 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");
295 private static System.String action_keybinding_get(System.IntPtr obj, System.IntPtr pd, int id)
297 Eina.Log.Debug("function efl_access_action_keybinding_get was called");
298 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
299 if(wrapper != null) {
300 System.String _ret_var = default( System.String);
302 _ret_var = ((ActionConcrete)wrapper).GetActionKeybinding( id);
303 } catch (Exception e) {
304 Eina.Log.Warning($"Callback error: {e.ToString()}");
305 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
309 return efl_access_action_keybinding_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), id);
312 private static efl_access_action_keybinding_get_delegate efl_access_action_keybinding_get_static_delegate;