1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Ui { namespace Focus {
8 /// <summary>Functions of focusable objects.
11 public interface Object :
12 Efl.Eo.IWrapper, IDisposable
14 /// <summary>The geometry (that is, the bounding rectangle) used to calculate the relationship with other objects.
16 /// <returns>The geometry to use.
18 Eina.Rect GetFocusGeometry();
19 /// <summary>Returns whether the widget is currently focused or not.
21 /// <returns>The focused state of the object.
24 /// <summary>This is called by the manager and should never be called by anyone else.
25 /// The function emits the focus state events, if focus is different to the previous state.
27 /// <param name="focus">The focused state of the object.
29 /// <returns></returns>
30 void SetFocus( bool focus);
31 /// <summary>This is the focus manager where this focus object is registered in. The element which is the <c>root</c> of a Efl.Ui.Focus.Manager will not have this focus manager as this object, but rather the second focus manager where it is registered in.
33 /// <returns>The manager object
35 Efl.Ui.Focus.Manager GetFocusManager();
36 /// <summary>Describes which logical parent is used by this object.
38 /// <returns>The focus parent.
40 Efl.Ui.Focus.Object GetFocusParent();
41 /// <summary>Indicates if a child of this object has focus set to true.
43 /// <returns><c>true</c> if a child has focus.
46 /// <summary>Indicates if a child of this object has focus set to true.
48 /// <param name="child_focus"><c>true</c> if a child has focus.
50 /// <returns></returns>
51 void SetChildFocus( bool child_focus);
52 /// <summary>Tells the object that its children will be queried soon by the focus manager. Overwrite this to update the order of the children. Deleting items in this call will result in undefined behaviour and may cause your system to crash.
54 /// <returns></returns>
56 /// <summary>This is called when <see cref="Efl.Ui.Focus.Object.SetupOrder"/> is called, but only on the first call, additional recursive calls to <see cref="Efl.Ui.Focus.Object.SetupOrder"/> will not call this function again.
58 /// <returns></returns>
59 void SetupOrderNonRecursive();
60 /// <summary>Virtual function handling focus in/out events on the widget
62 /// <returns><c>true</c> if this widget can handle focus, <c>false</c> otherwise
65 /// <summary>Emitted if the focus state has changed.
67 event EventHandler<Efl.Ui.Focus.ObjectFocusChangedEvt_Args> FocusChangedEvt;
68 /// <summary>Emitted when a new manager is the parent for this object.
70 event EventHandler<Efl.Ui.Focus.ObjectFocus_managerChangedEvt_Args> Focus_managerChangedEvt;
71 /// <summary>Emitted when a new logical parent should be used.
73 event EventHandler<Efl.Ui.Focus.ObjectFocus_parentChangedEvt_Args> Focus_parentChangedEvt;
74 /// <summary>Emitted if child_focus has changed.
76 event EventHandler<Efl.Ui.Focus.ObjectChild_focusChangedEvt_Args> Child_focusChangedEvt;
77 /// <summary>Emitted if focus geometry of this object has changed.
79 event EventHandler Focus_geometryChangedEvt;
80 /// <summary>The geometry (that is, the bounding rectangle) used to calculate the relationship with other objects.
82 /// <value>The geometry to use.
84 Eina.Rect FocusGeometry {
87 /// <summary>Returns whether the widget is currently focused or not.
89 /// <value>The focused state of the object.
95 /// <summary>This is the focus manager where this focus object is registered in. The element which is the <c>root</c> of a Efl.Ui.Focus.Manager will not have this focus manager as this object, but rather the second focus manager where it is registered in.
97 /// <value>The manager object
99 Efl.Ui.Focus.Manager FocusManager {
102 /// <summary>Describes which logical parent is used by this object.
104 /// <value>The focus parent.
106 Efl.Ui.Focus.Object FocusParent {
109 /// <summary>Indicates if a child of this object has focus set to true.
111 /// <value><c>true</c> if a child has focus.
118 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.Focus.Object.FocusChangedEvt"/>.</summary>
119 public class ObjectFocusChangedEvt_Args : EventArgs {
120 ///<summary>Actual event payload.</summary>
121 public bool arg { get; set; }
123 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.Focus.Object.Focus_managerChangedEvt"/>.</summary>
124 public class ObjectFocus_managerChangedEvt_Args : EventArgs {
125 ///<summary>Actual event payload.</summary>
126 public Efl.Ui.Focus.Manager arg { get; set; }
128 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.Focus.Object.Focus_parentChangedEvt"/>.</summary>
129 public class ObjectFocus_parentChangedEvt_Args : EventArgs {
130 ///<summary>Actual event payload.</summary>
131 public Efl.Ui.Focus.Object arg { get; set; }
133 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.Focus.Object.Child_focusChangedEvt"/>.</summary>
134 public class ObjectChild_focusChangedEvt_Args : EventArgs {
135 ///<summary>Actual event payload.</summary>
136 public bool arg { get; set; }
138 /// <summary>Functions of focusable objects.
140 sealed public class ObjectConcrete :
145 ///<summary>Pointer to the native class description.</summary>
146 public System.IntPtr NativeClass {
148 if (((object)this).GetType() == typeof (ObjectConcrete))
149 return Efl.Ui.Focus.ObjectNativeInherit.GetEflClassStatic();
151 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
154 private EventHandlerList eventHandlers = new EventHandlerList();
155 private System.IntPtr handle;
156 ///<summary>Pointer to the native instance.</summary>
157 public System.IntPtr NativeHandle {
158 get { return handle; }
160 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
161 efl_ui_focus_object_mixin_get();
162 ///<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>
163 public ObjectConcrete(System.IntPtr raw)
166 register_event_proxies();
168 ///<summary>Destructor.</summary>
173 ///<summary>Releases the underlying native instance.</summary>
174 void Dispose(bool disposing)
176 if (handle != System.IntPtr.Zero) {
177 Efl.Eo.Globals.efl_unref(handle);
178 handle = System.IntPtr.Zero;
181 ///<summary>Releases the underlying native instance.</summary>
182 public void Dispose()
185 GC.SuppressFinalize(this);
187 ///<summary>Casts obj into an instance of this type.</summary>
188 public static ObjectConcrete static_cast(Efl.Object obj)
191 throw new System.ArgumentNullException("obj");
192 return new ObjectConcrete(obj.NativeHandle);
194 ///<summary>Verifies if the given object is equal to this one.</summary>
195 public override bool Equals(object obj)
197 var other = obj as Efl.Object;
200 return this.NativeHandle == other.NativeHandle;
202 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
203 public override int GetHashCode()
205 return this.NativeHandle.ToInt32();
207 ///<summary>Turns the native pointer into a string representation.</summary>
208 public override String ToString()
210 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
212 private readonly object eventLock = new object();
213 private Dictionary<string, int> event_cb_count = new Dictionary<string, int>();
214 private bool add_cpp_event_handler(string lib, string key, Efl.EventCb evt_delegate) {
216 if (!event_cb_count.TryGetValue(key, out event_count))
217 event_cb_count[key] = event_count;
218 if (event_count == 0) {
219 IntPtr desc = Efl.EventDescription.GetNative(lib, key);
220 if (desc == IntPtr.Zero) {
221 Eina.Log.Error($"Failed to get native event {key}");
224 bool result = Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero);
226 Eina.Log.Error($"Failed to add event proxy for event {key}");
229 Eina.Error.RaiseIfUnhandledException();
231 event_cb_count[key]++;
234 private bool remove_cpp_event_handler(string key, Efl.EventCb evt_delegate) {
236 if (!event_cb_count.TryGetValue(key, out event_count))
237 event_cb_count[key] = event_count;
238 if (event_count == 1) {
239 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
240 if (desc == IntPtr.Zero) {
241 Eina.Log.Error($"Failed to get native event {key}");
244 bool result = Efl.Eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero);
246 Eina.Log.Error($"Failed to remove event proxy for event {key}");
249 Eina.Error.RaiseIfUnhandledException();
250 } else if (event_count == 0) {
251 Eina.Log.Error($"Trying to remove proxy for event {key} when there is nothing registered.");
254 event_cb_count[key]--;
257 private static object FocusChangedEvtKey = new object();
258 /// <summary>Emitted if the focus state has changed.
260 public event EventHandler<Efl.Ui.Focus.ObjectFocusChangedEvt_Args> FocusChangedEvt
264 string key = "_EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED";
265 if (add_cpp_event_handler(efl.Libs.Elementary, key, this.evt_FocusChangedEvt_delegate)) {
266 eventHandlers.AddHandler(FocusChangedEvtKey , value);
268 Eina.Log.Error($"Error adding proxy for event {key}");
273 string key = "_EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED";
274 if (remove_cpp_event_handler(key, this.evt_FocusChangedEvt_delegate)) {
275 eventHandlers.RemoveHandler(FocusChangedEvtKey , value);
277 Eina.Log.Error($"Error removing proxy for event {key}");
281 ///<summary>Method to raise event FocusChangedEvt.</summary>
282 public void On_FocusChangedEvt(Efl.Ui.Focus.ObjectFocusChangedEvt_Args e)
284 EventHandler<Efl.Ui.Focus.ObjectFocusChangedEvt_Args> evt;
286 evt = (EventHandler<Efl.Ui.Focus.ObjectFocusChangedEvt_Args>)eventHandlers[FocusChangedEvtKey];
288 evt?.Invoke(this, e);
290 Efl.EventCb evt_FocusChangedEvt_delegate;
291 private void on_FocusChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
293 Efl.Ui.Focus.ObjectFocusChangedEvt_Args args = new Efl.Ui.Focus.ObjectFocusChangedEvt_Args();
294 args.arg = evt.Info != IntPtr.Zero;
296 On_FocusChangedEvt(args);
297 } catch (Exception e) {
298 Eina.Log.Error(e.ToString());
299 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
303 private static object Focus_managerChangedEvtKey = new object();
304 /// <summary>Emitted when a new manager is the parent for this object.
306 public event EventHandler<Efl.Ui.Focus.ObjectFocus_managerChangedEvt_Args> Focus_managerChangedEvt
310 string key = "_EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED";
311 if (add_cpp_event_handler(efl.Libs.Elementary, key, this.evt_Focus_managerChangedEvt_delegate)) {
312 eventHandlers.AddHandler(Focus_managerChangedEvtKey , value);
314 Eina.Log.Error($"Error adding proxy for event {key}");
319 string key = "_EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED";
320 if (remove_cpp_event_handler(key, this.evt_Focus_managerChangedEvt_delegate)) {
321 eventHandlers.RemoveHandler(Focus_managerChangedEvtKey , value);
323 Eina.Log.Error($"Error removing proxy for event {key}");
327 ///<summary>Method to raise event Focus_managerChangedEvt.</summary>
328 public void On_Focus_managerChangedEvt(Efl.Ui.Focus.ObjectFocus_managerChangedEvt_Args e)
330 EventHandler<Efl.Ui.Focus.ObjectFocus_managerChangedEvt_Args> evt;
332 evt = (EventHandler<Efl.Ui.Focus.ObjectFocus_managerChangedEvt_Args>)eventHandlers[Focus_managerChangedEvtKey];
334 evt?.Invoke(this, e);
336 Efl.EventCb evt_Focus_managerChangedEvt_delegate;
337 private void on_Focus_managerChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
339 Efl.Ui.Focus.ObjectFocus_managerChangedEvt_Args args = new Efl.Ui.Focus.ObjectFocus_managerChangedEvt_Args();
340 args.arg = new Efl.Ui.Focus.ManagerConcrete(evt.Info);
342 On_Focus_managerChangedEvt(args);
343 } catch (Exception e) {
344 Eina.Log.Error(e.ToString());
345 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
349 private static object Focus_parentChangedEvtKey = new object();
350 /// <summary>Emitted when a new logical parent should be used.
352 public event EventHandler<Efl.Ui.Focus.ObjectFocus_parentChangedEvt_Args> Focus_parentChangedEvt
356 string key = "_EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_PARENT_CHANGED";
357 if (add_cpp_event_handler(efl.Libs.Elementary, key, this.evt_Focus_parentChangedEvt_delegate)) {
358 eventHandlers.AddHandler(Focus_parentChangedEvtKey , value);
360 Eina.Log.Error($"Error adding proxy for event {key}");
365 string key = "_EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_PARENT_CHANGED";
366 if (remove_cpp_event_handler(key, this.evt_Focus_parentChangedEvt_delegate)) {
367 eventHandlers.RemoveHandler(Focus_parentChangedEvtKey , value);
369 Eina.Log.Error($"Error removing proxy for event {key}");
373 ///<summary>Method to raise event Focus_parentChangedEvt.</summary>
374 public void On_Focus_parentChangedEvt(Efl.Ui.Focus.ObjectFocus_parentChangedEvt_Args e)
376 EventHandler<Efl.Ui.Focus.ObjectFocus_parentChangedEvt_Args> evt;
378 evt = (EventHandler<Efl.Ui.Focus.ObjectFocus_parentChangedEvt_Args>)eventHandlers[Focus_parentChangedEvtKey];
380 evt?.Invoke(this, e);
382 Efl.EventCb evt_Focus_parentChangedEvt_delegate;
383 private void on_Focus_parentChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
385 Efl.Ui.Focus.ObjectFocus_parentChangedEvt_Args args = new Efl.Ui.Focus.ObjectFocus_parentChangedEvt_Args();
386 args.arg = new Efl.Ui.Focus.ObjectConcrete(evt.Info);
388 On_Focus_parentChangedEvt(args);
389 } catch (Exception e) {
390 Eina.Log.Error(e.ToString());
391 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
395 private static object Child_focusChangedEvtKey = new object();
396 /// <summary>Emitted if child_focus has changed.
398 public event EventHandler<Efl.Ui.Focus.ObjectChild_focusChangedEvt_Args> Child_focusChangedEvt
402 string key = "_EFL_UI_FOCUS_OBJECT_EVENT_CHILD_FOCUS_CHANGED";
403 if (add_cpp_event_handler(efl.Libs.Elementary, key, this.evt_Child_focusChangedEvt_delegate)) {
404 eventHandlers.AddHandler(Child_focusChangedEvtKey , value);
406 Eina.Log.Error($"Error adding proxy for event {key}");
411 string key = "_EFL_UI_FOCUS_OBJECT_EVENT_CHILD_FOCUS_CHANGED";
412 if (remove_cpp_event_handler(key, this.evt_Child_focusChangedEvt_delegate)) {
413 eventHandlers.RemoveHandler(Child_focusChangedEvtKey , value);
415 Eina.Log.Error($"Error removing proxy for event {key}");
419 ///<summary>Method to raise event Child_focusChangedEvt.</summary>
420 public void On_Child_focusChangedEvt(Efl.Ui.Focus.ObjectChild_focusChangedEvt_Args e)
422 EventHandler<Efl.Ui.Focus.ObjectChild_focusChangedEvt_Args> evt;
424 evt = (EventHandler<Efl.Ui.Focus.ObjectChild_focusChangedEvt_Args>)eventHandlers[Child_focusChangedEvtKey];
426 evt?.Invoke(this, e);
428 Efl.EventCb evt_Child_focusChangedEvt_delegate;
429 private void on_Child_focusChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
431 Efl.Ui.Focus.ObjectChild_focusChangedEvt_Args args = new Efl.Ui.Focus.ObjectChild_focusChangedEvt_Args();
432 args.arg = evt.Info != IntPtr.Zero;
434 On_Child_focusChangedEvt(args);
435 } catch (Exception e) {
436 Eina.Log.Error(e.ToString());
437 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
441 private static object Focus_geometryChangedEvtKey = new object();
442 /// <summary>Emitted if focus geometry of this object has changed.
444 public event EventHandler Focus_geometryChangedEvt
448 string key = "_EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_GEOMETRY_CHANGED";
449 if (add_cpp_event_handler(efl.Libs.Elementary, key, this.evt_Focus_geometryChangedEvt_delegate)) {
450 eventHandlers.AddHandler(Focus_geometryChangedEvtKey , value);
452 Eina.Log.Error($"Error adding proxy for event {key}");
457 string key = "_EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_GEOMETRY_CHANGED";
458 if (remove_cpp_event_handler(key, this.evt_Focus_geometryChangedEvt_delegate)) {
459 eventHandlers.RemoveHandler(Focus_geometryChangedEvtKey , value);
461 Eina.Log.Error($"Error removing proxy for event {key}");
465 ///<summary>Method to raise event Focus_geometryChangedEvt.</summary>
466 public void On_Focus_geometryChangedEvt(EventArgs e)
470 evt = (EventHandler)eventHandlers[Focus_geometryChangedEvtKey];
472 evt?.Invoke(this, e);
474 Efl.EventCb evt_Focus_geometryChangedEvt_delegate;
475 private void on_Focus_geometryChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
477 EventArgs args = EventArgs.Empty;
479 On_Focus_geometryChangedEvt(args);
480 } catch (Exception e) {
481 Eina.Log.Error(e.ToString());
482 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
486 void register_event_proxies()
488 evt_FocusChangedEvt_delegate = new Efl.EventCb(on_FocusChangedEvt_NativeCallback);
489 evt_Focus_managerChangedEvt_delegate = new Efl.EventCb(on_Focus_managerChangedEvt_NativeCallback);
490 evt_Focus_parentChangedEvt_delegate = new Efl.EventCb(on_Focus_parentChangedEvt_NativeCallback);
491 evt_Child_focusChangedEvt_delegate = new Efl.EventCb(on_Child_focusChangedEvt_NativeCallback);
492 evt_Focus_geometryChangedEvt_delegate = new Efl.EventCb(on_Focus_geometryChangedEvt_NativeCallback);
494 /// <summary>The geometry (that is, the bounding rectangle) used to calculate the relationship with other objects.
496 /// <returns>The geometry to use.
498 public Eina.Rect GetFocusGeometry() {
499 var _ret_var = Efl.Ui.Focus.ObjectNativeInherit.efl_ui_focus_object_focus_geometry_get_ptr.Value.Delegate(this.NativeHandle);
500 Eina.Error.RaiseIfUnhandledException();
501 return Eina.Rect_StructConversion.ToManaged(_ret_var);
503 /// <summary>Returns whether the widget is currently focused or not.
505 /// <returns>The focused state of the object.
507 public bool GetFocus() {
508 var _ret_var = Efl.Ui.Focus.ObjectNativeInherit.efl_ui_focus_object_focus_get_ptr.Value.Delegate(this.NativeHandle);
509 Eina.Error.RaiseIfUnhandledException();
512 /// <summary>This is called by the manager and should never be called by anyone else.
513 /// The function emits the focus state events, if focus is different to the previous state.
515 /// <param name="focus">The focused state of the object.
517 /// <returns></returns>
518 public void SetFocus( bool focus) {
519 Efl.Ui.Focus.ObjectNativeInherit.efl_ui_focus_object_focus_set_ptr.Value.Delegate(this.NativeHandle, focus);
520 Eina.Error.RaiseIfUnhandledException();
522 /// <summary>This is the focus manager where this focus object is registered in. The element which is the <c>root</c> of a Efl.Ui.Focus.Manager will not have this focus manager as this object, but rather the second focus manager where it is registered in.
524 /// <returns>The manager object
526 public Efl.Ui.Focus.Manager GetFocusManager() {
527 var _ret_var = Efl.Ui.Focus.ObjectNativeInherit.efl_ui_focus_object_focus_manager_get_ptr.Value.Delegate(this.NativeHandle);
528 Eina.Error.RaiseIfUnhandledException();
531 /// <summary>Describes which logical parent is used by this object.
533 /// <returns>The focus parent.
535 public Efl.Ui.Focus.Object GetFocusParent() {
536 var _ret_var = Efl.Ui.Focus.ObjectNativeInherit.efl_ui_focus_object_focus_parent_get_ptr.Value.Delegate(this.NativeHandle);
537 Eina.Error.RaiseIfUnhandledException();
540 /// <summary>Indicates if a child of this object has focus set to true.
542 /// <returns><c>true</c> if a child has focus.
544 public bool GetChildFocus() {
545 var _ret_var = Efl.Ui.Focus.ObjectNativeInherit.efl_ui_focus_object_child_focus_get_ptr.Value.Delegate(this.NativeHandle);
546 Eina.Error.RaiseIfUnhandledException();
549 /// <summary>Indicates if a child of this object has focus set to true.
551 /// <param name="child_focus"><c>true</c> if a child has focus.
553 /// <returns></returns>
554 public void SetChildFocus( bool child_focus) {
555 Efl.Ui.Focus.ObjectNativeInherit.efl_ui_focus_object_child_focus_set_ptr.Value.Delegate(this.NativeHandle, child_focus);
556 Eina.Error.RaiseIfUnhandledException();
558 /// <summary>Tells the object that its children will be queried soon by the focus manager. Overwrite this to update the order of the children. Deleting items in this call will result in undefined behaviour and may cause your system to crash.
560 /// <returns></returns>
561 public void SetupOrder() {
562 Efl.Ui.Focus.ObjectNativeInherit.efl_ui_focus_object_setup_order_ptr.Value.Delegate(this.NativeHandle);
563 Eina.Error.RaiseIfUnhandledException();
565 /// <summary>This is called when <see cref="Efl.Ui.Focus.Object.SetupOrder"/> is called, but only on the first call, additional recursive calls to <see cref="Efl.Ui.Focus.Object.SetupOrder"/> will not call this function again.
567 /// <returns></returns>
568 public void SetupOrderNonRecursive() {
569 Efl.Ui.Focus.ObjectNativeInherit.efl_ui_focus_object_setup_order_non_recursive_ptr.Value.Delegate(this.NativeHandle);
570 Eina.Error.RaiseIfUnhandledException();
572 /// <summary>Virtual function handling focus in/out events on the widget
574 /// <returns><c>true</c> if this widget can handle focus, <c>false</c> otherwise
576 public bool UpdateOnFocus() {
577 var _ret_var = Efl.Ui.Focus.ObjectNativeInherit.efl_ui_focus_object_on_focus_update_ptr.Value.Delegate(this.NativeHandle);
578 Eina.Error.RaiseIfUnhandledException();
581 /// <summary>The geometry (that is, the bounding rectangle) used to calculate the relationship with other objects.
583 /// <value>The geometry to use.
585 public Eina.Rect FocusGeometry {
586 get { return GetFocusGeometry(); }
588 /// <summary>Returns whether the widget is currently focused or not.
590 /// <value>The focused state of the object.
593 get { return GetFocus(); }
594 set { SetFocus( value); }
596 /// <summary>This is the focus manager where this focus object is registered in. The element which is the <c>root</c> of a Efl.Ui.Focus.Manager will not have this focus manager as this object, but rather the second focus manager where it is registered in.
598 /// <value>The manager object
600 public Efl.Ui.Focus.Manager FocusManager {
601 get { return GetFocusManager(); }
603 /// <summary>Describes which logical parent is used by this object.
605 /// <value>The focus parent.
607 public Efl.Ui.Focus.Object FocusParent {
608 get { return GetFocusParent(); }
610 /// <summary>Indicates if a child of this object has focus set to true.
612 /// <value><c>true</c> if a child has focus.
614 public bool ChildFocus {
615 get { return GetChildFocus(); }
616 set { SetChildFocus( value); }
619 public class ObjectNativeInherit : Efl.Eo.NativeClass{
620 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
621 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
623 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
624 if (efl_ui_focus_object_focus_geometry_get_static_delegate == null)
625 efl_ui_focus_object_focus_geometry_get_static_delegate = new efl_ui_focus_object_focus_geometry_get_delegate(focus_geometry_get);
626 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_focus_object_focus_geometry_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_focus_object_focus_geometry_get_static_delegate)});
627 if (efl_ui_focus_object_focus_get_static_delegate == null)
628 efl_ui_focus_object_focus_get_static_delegate = new efl_ui_focus_object_focus_get_delegate(focus_get);
629 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_focus_object_focus_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_focus_object_focus_get_static_delegate)});
630 if (efl_ui_focus_object_focus_set_static_delegate == null)
631 efl_ui_focus_object_focus_set_static_delegate = new efl_ui_focus_object_focus_set_delegate(focus_set);
632 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_focus_object_focus_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_focus_object_focus_set_static_delegate)});
633 if (efl_ui_focus_object_focus_manager_get_static_delegate == null)
634 efl_ui_focus_object_focus_manager_get_static_delegate = new efl_ui_focus_object_focus_manager_get_delegate(focus_manager_get);
635 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_focus_object_focus_manager_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_focus_object_focus_manager_get_static_delegate)});
636 if (efl_ui_focus_object_focus_parent_get_static_delegate == null)
637 efl_ui_focus_object_focus_parent_get_static_delegate = new efl_ui_focus_object_focus_parent_get_delegate(focus_parent_get);
638 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_focus_object_focus_parent_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_focus_object_focus_parent_get_static_delegate)});
639 if (efl_ui_focus_object_child_focus_get_static_delegate == null)
640 efl_ui_focus_object_child_focus_get_static_delegate = new efl_ui_focus_object_child_focus_get_delegate(child_focus_get);
641 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_focus_object_child_focus_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_focus_object_child_focus_get_static_delegate)});
642 if (efl_ui_focus_object_child_focus_set_static_delegate == null)
643 efl_ui_focus_object_child_focus_set_static_delegate = new efl_ui_focus_object_child_focus_set_delegate(child_focus_set);
644 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_focus_object_child_focus_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_focus_object_child_focus_set_static_delegate)});
645 if (efl_ui_focus_object_setup_order_static_delegate == null)
646 efl_ui_focus_object_setup_order_static_delegate = new efl_ui_focus_object_setup_order_delegate(setup_order);
647 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_focus_object_setup_order"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_focus_object_setup_order_static_delegate)});
648 if (efl_ui_focus_object_setup_order_non_recursive_static_delegate == null)
649 efl_ui_focus_object_setup_order_non_recursive_static_delegate = new efl_ui_focus_object_setup_order_non_recursive_delegate(setup_order_non_recursive);
650 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_focus_object_setup_order_non_recursive"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_focus_object_setup_order_non_recursive_static_delegate)});
651 if (efl_ui_focus_object_on_focus_update_static_delegate == null)
652 efl_ui_focus_object_on_focus_update_static_delegate = new efl_ui_focus_object_on_focus_update_delegate(on_focus_update);
653 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_focus_object_on_focus_update"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_focus_object_on_focus_update_static_delegate)});
656 public override IntPtr GetEflClass()
658 return Efl.Ui.Focus.ObjectConcrete.efl_ui_focus_object_mixin_get();
660 public static IntPtr GetEflClassStatic()
662 return Efl.Ui.Focus.ObjectConcrete.efl_ui_focus_object_mixin_get();
666 private delegate Eina.Rect_StructInternal efl_ui_focus_object_focus_geometry_get_delegate(System.IntPtr obj, System.IntPtr pd);
669 public delegate Eina.Rect_StructInternal efl_ui_focus_object_focus_geometry_get_api_delegate(System.IntPtr obj);
670 public static Efl.Eo.FunctionWrapper<efl_ui_focus_object_focus_geometry_get_api_delegate> efl_ui_focus_object_focus_geometry_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_focus_object_focus_geometry_get_api_delegate>(_Module, "efl_ui_focus_object_focus_geometry_get");
671 private static Eina.Rect_StructInternal focus_geometry_get(System.IntPtr obj, System.IntPtr pd)
673 Eina.Log.Debug("function efl_ui_focus_object_focus_geometry_get was called");
674 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
675 if(wrapper != null) {
676 Eina.Rect _ret_var = default(Eina.Rect);
678 _ret_var = ((ObjectConcrete)wrapper).GetFocusGeometry();
679 } catch (Exception e) {
680 Eina.Log.Warning($"Callback error: {e.ToString()}");
681 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
683 return Eina.Rect_StructConversion.ToInternal(_ret_var);
685 return efl_ui_focus_object_focus_geometry_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
688 private static efl_ui_focus_object_focus_geometry_get_delegate efl_ui_focus_object_focus_geometry_get_static_delegate;
691 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_ui_focus_object_focus_get_delegate(System.IntPtr obj, System.IntPtr pd);
694 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_ui_focus_object_focus_get_api_delegate(System.IntPtr obj);
695 public static Efl.Eo.FunctionWrapper<efl_ui_focus_object_focus_get_api_delegate> efl_ui_focus_object_focus_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_focus_object_focus_get_api_delegate>(_Module, "efl_ui_focus_object_focus_get");
696 private static bool focus_get(System.IntPtr obj, System.IntPtr pd)
698 Eina.Log.Debug("function efl_ui_focus_object_focus_get was called");
699 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
700 if(wrapper != null) {
701 bool _ret_var = default(bool);
703 _ret_var = ((ObjectConcrete)wrapper).GetFocus();
704 } catch (Exception e) {
705 Eina.Log.Warning($"Callback error: {e.ToString()}");
706 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
710 return efl_ui_focus_object_focus_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
713 private static efl_ui_focus_object_focus_get_delegate efl_ui_focus_object_focus_get_static_delegate;
716 private delegate void efl_ui_focus_object_focus_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool focus);
719 public delegate void efl_ui_focus_object_focus_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool focus);
720 public static Efl.Eo.FunctionWrapper<efl_ui_focus_object_focus_set_api_delegate> efl_ui_focus_object_focus_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_focus_object_focus_set_api_delegate>(_Module, "efl_ui_focus_object_focus_set");
721 private static void focus_set(System.IntPtr obj, System.IntPtr pd, bool focus)
723 Eina.Log.Debug("function efl_ui_focus_object_focus_set was called");
724 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
725 if(wrapper != null) {
728 ((ObjectConcrete)wrapper).SetFocus( focus);
729 } catch (Exception e) {
730 Eina.Log.Warning($"Callback error: {e.ToString()}");
731 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
734 efl_ui_focus_object_focus_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), focus);
737 private static efl_ui_focus_object_focus_set_delegate efl_ui_focus_object_focus_set_static_delegate;
740 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Ui.Focus.ManagerConcrete, Efl.Eo.NonOwnTag>))] private delegate Efl.Ui.Focus.Manager efl_ui_focus_object_focus_manager_get_delegate(System.IntPtr obj, System.IntPtr pd);
743 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Ui.Focus.ManagerConcrete, Efl.Eo.NonOwnTag>))] public delegate Efl.Ui.Focus.Manager efl_ui_focus_object_focus_manager_get_api_delegate(System.IntPtr obj);
744 public static Efl.Eo.FunctionWrapper<efl_ui_focus_object_focus_manager_get_api_delegate> efl_ui_focus_object_focus_manager_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_focus_object_focus_manager_get_api_delegate>(_Module, "efl_ui_focus_object_focus_manager_get");
745 private static Efl.Ui.Focus.Manager focus_manager_get(System.IntPtr obj, System.IntPtr pd)
747 Eina.Log.Debug("function efl_ui_focus_object_focus_manager_get was called");
748 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
749 if(wrapper != null) {
750 Efl.Ui.Focus.Manager _ret_var = default(Efl.Ui.Focus.Manager);
752 _ret_var = ((ObjectConcrete)wrapper).GetFocusManager();
753 } catch (Exception e) {
754 Eina.Log.Warning($"Callback error: {e.ToString()}");
755 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
759 return efl_ui_focus_object_focus_manager_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
762 private static efl_ui_focus_object_focus_manager_get_delegate efl_ui_focus_object_focus_manager_get_static_delegate;
765 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Ui.Focus.ObjectConcrete, Efl.Eo.NonOwnTag>))] private delegate Efl.Ui.Focus.Object efl_ui_focus_object_focus_parent_get_delegate(System.IntPtr obj, System.IntPtr pd);
768 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Ui.Focus.ObjectConcrete, Efl.Eo.NonOwnTag>))] public delegate Efl.Ui.Focus.Object efl_ui_focus_object_focus_parent_get_api_delegate(System.IntPtr obj);
769 public static Efl.Eo.FunctionWrapper<efl_ui_focus_object_focus_parent_get_api_delegate> efl_ui_focus_object_focus_parent_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_focus_object_focus_parent_get_api_delegate>(_Module, "efl_ui_focus_object_focus_parent_get");
770 private static Efl.Ui.Focus.Object focus_parent_get(System.IntPtr obj, System.IntPtr pd)
772 Eina.Log.Debug("function efl_ui_focus_object_focus_parent_get was called");
773 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
774 if(wrapper != null) {
775 Efl.Ui.Focus.Object _ret_var = default(Efl.Ui.Focus.Object);
777 _ret_var = ((ObjectConcrete)wrapper).GetFocusParent();
778 } catch (Exception e) {
779 Eina.Log.Warning($"Callback error: {e.ToString()}");
780 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
784 return efl_ui_focus_object_focus_parent_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
787 private static efl_ui_focus_object_focus_parent_get_delegate efl_ui_focus_object_focus_parent_get_static_delegate;
790 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_ui_focus_object_child_focus_get_delegate(System.IntPtr obj, System.IntPtr pd);
793 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_ui_focus_object_child_focus_get_api_delegate(System.IntPtr obj);
794 public static Efl.Eo.FunctionWrapper<efl_ui_focus_object_child_focus_get_api_delegate> efl_ui_focus_object_child_focus_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_focus_object_child_focus_get_api_delegate>(_Module, "efl_ui_focus_object_child_focus_get");
795 private static bool child_focus_get(System.IntPtr obj, System.IntPtr pd)
797 Eina.Log.Debug("function efl_ui_focus_object_child_focus_get was called");
798 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
799 if(wrapper != null) {
800 bool _ret_var = default(bool);
802 _ret_var = ((ObjectConcrete)wrapper).GetChildFocus();
803 } catch (Exception e) {
804 Eina.Log.Warning($"Callback error: {e.ToString()}");
805 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
809 return efl_ui_focus_object_child_focus_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
812 private static efl_ui_focus_object_child_focus_get_delegate efl_ui_focus_object_child_focus_get_static_delegate;
815 private delegate void efl_ui_focus_object_child_focus_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool child_focus);
818 public delegate void efl_ui_focus_object_child_focus_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool child_focus);
819 public static Efl.Eo.FunctionWrapper<efl_ui_focus_object_child_focus_set_api_delegate> efl_ui_focus_object_child_focus_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_focus_object_child_focus_set_api_delegate>(_Module, "efl_ui_focus_object_child_focus_set");
820 private static void child_focus_set(System.IntPtr obj, System.IntPtr pd, bool child_focus)
822 Eina.Log.Debug("function efl_ui_focus_object_child_focus_set was called");
823 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
824 if(wrapper != null) {
827 ((ObjectConcrete)wrapper).SetChildFocus( child_focus);
828 } catch (Exception e) {
829 Eina.Log.Warning($"Callback error: {e.ToString()}");
830 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
833 efl_ui_focus_object_child_focus_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), child_focus);
836 private static efl_ui_focus_object_child_focus_set_delegate efl_ui_focus_object_child_focus_set_static_delegate;
839 private delegate void efl_ui_focus_object_setup_order_delegate(System.IntPtr obj, System.IntPtr pd);
842 public delegate void efl_ui_focus_object_setup_order_api_delegate(System.IntPtr obj);
843 public static Efl.Eo.FunctionWrapper<efl_ui_focus_object_setup_order_api_delegate> efl_ui_focus_object_setup_order_ptr = new Efl.Eo.FunctionWrapper<efl_ui_focus_object_setup_order_api_delegate>(_Module, "efl_ui_focus_object_setup_order");
844 private static void setup_order(System.IntPtr obj, System.IntPtr pd)
846 Eina.Log.Debug("function efl_ui_focus_object_setup_order was called");
847 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
848 if(wrapper != null) {
851 ((ObjectConcrete)wrapper).SetupOrder();
852 } catch (Exception e) {
853 Eina.Log.Warning($"Callback error: {e.ToString()}");
854 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
857 efl_ui_focus_object_setup_order_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
860 private static efl_ui_focus_object_setup_order_delegate efl_ui_focus_object_setup_order_static_delegate;
863 private delegate void efl_ui_focus_object_setup_order_non_recursive_delegate(System.IntPtr obj, System.IntPtr pd);
866 public delegate void efl_ui_focus_object_setup_order_non_recursive_api_delegate(System.IntPtr obj);
867 public static Efl.Eo.FunctionWrapper<efl_ui_focus_object_setup_order_non_recursive_api_delegate> efl_ui_focus_object_setup_order_non_recursive_ptr = new Efl.Eo.FunctionWrapper<efl_ui_focus_object_setup_order_non_recursive_api_delegate>(_Module, "efl_ui_focus_object_setup_order_non_recursive");
868 private static void setup_order_non_recursive(System.IntPtr obj, System.IntPtr pd)
870 Eina.Log.Debug("function efl_ui_focus_object_setup_order_non_recursive was called");
871 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
872 if(wrapper != null) {
875 ((ObjectConcrete)wrapper).SetupOrderNonRecursive();
876 } catch (Exception e) {
877 Eina.Log.Warning($"Callback error: {e.ToString()}");
878 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
881 efl_ui_focus_object_setup_order_non_recursive_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
884 private static efl_ui_focus_object_setup_order_non_recursive_delegate efl_ui_focus_object_setup_order_non_recursive_static_delegate;
887 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_ui_focus_object_on_focus_update_delegate(System.IntPtr obj, System.IntPtr pd);
890 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_ui_focus_object_on_focus_update_api_delegate(System.IntPtr obj);
891 public static Efl.Eo.FunctionWrapper<efl_ui_focus_object_on_focus_update_api_delegate> efl_ui_focus_object_on_focus_update_ptr = new Efl.Eo.FunctionWrapper<efl_ui_focus_object_on_focus_update_api_delegate>(_Module, "efl_ui_focus_object_on_focus_update");
892 private static bool on_focus_update(System.IntPtr obj, System.IntPtr pd)
894 Eina.Log.Debug("function efl_ui_focus_object_on_focus_update was called");
895 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
896 if(wrapper != null) {
897 bool _ret_var = default(bool);
899 _ret_var = ((ObjectConcrete)wrapper).UpdateOnFocus();
900 } catch (Exception e) {
901 Eina.Log.Warning($"Callback error: {e.ToString()}");
902 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
906 return efl_ui_focus_object_on_focus_update_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
909 private static efl_ui_focus_object_on_focus_update_delegate efl_ui_focus_object_on_focus_update_static_delegate;