1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Ui {
8 /// <summary>List Empty Item class. This item have only one swallow space, thus user can decorate item by filling the swallow with any kind of container.</summary>
9 [ListEmptyItemNativeInherit]
10 public class ListEmptyItem : Efl.Ui.ListItem, Efl.Eo.IWrapper,Efl.Content
12 public new static System.IntPtr klass = System.IntPtr.Zero;
13 public new static Efl.Ui.ListEmptyItemNativeInherit nativeInherit = new Efl.Ui.ListEmptyItemNativeInherit();
14 ///<summary>Pointer to the native class description.</summary>
15 public override System.IntPtr NativeClass {
17 if (((object)this).GetType() == typeof (ListEmptyItem))
18 return Efl.Ui.ListEmptyItemNativeInherit.GetEflClassStatic();
20 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
23 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
24 efl_ui_list_empty_item_class_get();
25 ///<summary>Creates a new instance.</summary>
26 ///<param name="parent">Parent instance.</param>
27 ///<param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle"/></param>
28 public ListEmptyItem(Efl.Object parent
29 , System.String style = null) :
30 base(efl_ui_list_empty_item_class_get(), typeof(ListEmptyItem), parent)
32 if (Efl.Eo.Globals.ParamHelperCheck(style))
33 SetStyle(Efl.Eo.Globals.GetParamHelper(style));
34 FinishInstantiation();
36 ///<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>
37 public ListEmptyItem(System.IntPtr raw) : base(raw)
39 register_event_proxies();
41 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
42 protected ListEmptyItem(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
43 ///<summary>Casts obj into an instance of this type.</summary>
44 public new static ListEmptyItem static_cast(Efl.Object obj)
47 throw new System.ArgumentNullException("obj");
48 return new ListEmptyItem(obj.NativeHandle);
50 ///<summary>Verifies if the given object is equal to this one.</summary>
51 public override bool Equals(object obj)
53 var other = obj as Efl.Object;
56 return this.NativeHandle == other.NativeHandle;
58 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
59 public override int GetHashCode()
61 return this.NativeHandle.ToInt32();
63 ///<summary>Turns the native pointer into a string representation.</summary>
64 public override String ToString()
66 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
68 private static object ContentChangedEvtKey = new object();
69 /// <summary>Sent after the content is set or unset using the current content object.</summary>
70 public event EventHandler<Efl.ContentContentChangedEvt_Args> ContentChangedEvt
74 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
75 if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_ContentChangedEvt_delegate)) {
76 eventHandlers.AddHandler(ContentChangedEvtKey , value);
78 Eina.Log.Error($"Error adding proxy for event {key}");
83 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
84 if (remove_cpp_event_handler(key, this.evt_ContentChangedEvt_delegate)) {
85 eventHandlers.RemoveHandler(ContentChangedEvtKey , value);
87 Eina.Log.Error($"Error removing proxy for event {key}");
91 ///<summary>Method to raise event ContentChangedEvt.</summary>
92 public void On_ContentChangedEvt(Efl.ContentContentChangedEvt_Args e)
94 EventHandler<Efl.ContentContentChangedEvt_Args> evt;
96 evt = (EventHandler<Efl.ContentContentChangedEvt_Args>)eventHandlers[ContentChangedEvtKey];
100 Efl.EventCb evt_ContentChangedEvt_delegate;
101 private void on_ContentChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
103 Efl.ContentContentChangedEvt_Args args = new Efl.ContentContentChangedEvt_Args();
104 args.arg = new Efl.Gfx.EntityConcrete(evt.Info);
106 On_ContentChangedEvt(args);
107 } catch (Exception e) {
108 Eina.Log.Error(e.ToString());
109 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
113 protected override void register_event_proxies()
115 base.register_event_proxies();
116 evt_ContentChangedEvt_delegate = new Efl.EventCb(on_ContentChangedEvt_NativeCallback);
118 /// <summary>Swallowed sub-object contained in this object.</summary>
119 /// <returns>The object to swallow.</returns>
120 virtual public Efl.Gfx.Entity GetContent() {
121 var _ret_var = Efl.ContentNativeInherit.efl_content_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
122 Eina.Error.RaiseIfUnhandledException();
125 /// <summary>Swallowed sub-object contained in this object.</summary>
126 /// <param name="content">The object to swallow.</param>
127 /// <returns><c>true</c> on success, <c>false</c> otherwise</returns>
128 virtual public bool SetContent( Efl.Gfx.Entity content) {
129 var _ret_var = Efl.ContentNativeInherit.efl_content_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), content);
130 Eina.Error.RaiseIfUnhandledException();
133 /// <summary>Unswallow the object in the current container and return it.</summary>
134 /// <returns>Unswallowed object</returns>
135 virtual public Efl.Gfx.Entity UnsetContent() {
136 var _ret_var = Efl.ContentNativeInherit.efl_content_unset_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
137 Eina.Error.RaiseIfUnhandledException();
140 /// <summary>Swallowed sub-object contained in this object.</summary>
141 /// <value>The object to swallow.</value>
142 public Efl.Gfx.Entity Content {
143 get { return GetContent(); }
144 set { SetContent( value); }
146 private static new IntPtr GetEflClassStatic()
148 return Efl.Ui.ListEmptyItem.efl_ui_list_empty_item_class_get();
151 public class ListEmptyItemNativeInherit : Efl.Ui.ListItemNativeInherit{
152 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
153 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
155 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
156 if (efl_content_get_static_delegate == null)
157 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
158 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_content_get"), func = Marshal.GetFunctionPointerForDelegate(efl_content_get_static_delegate)});
159 if (efl_content_set_static_delegate == null)
160 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
161 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_content_set"), func = Marshal.GetFunctionPointerForDelegate(efl_content_set_static_delegate)});
162 if (efl_content_unset_static_delegate == null)
163 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
164 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_content_unset"), func = Marshal.GetFunctionPointerForDelegate(efl_content_unset_static_delegate)});
165 descs.AddRange(base.GetEoOps(type));
168 public override IntPtr GetEflClass()
170 return Efl.Ui.ListEmptyItem.efl_ui_list_empty_item_class_get();
172 public static new IntPtr GetEflClassStatic()
174 return Efl.Ui.ListEmptyItem.efl_ui_list_empty_item_class_get();
178 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.EntityConcrete, Efl.Eo.NonOwnTag>))] private delegate Efl.Gfx.Entity efl_content_get_delegate(System.IntPtr obj, System.IntPtr pd);
181 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.EntityConcrete, Efl.Eo.NonOwnTag>))] public delegate Efl.Gfx.Entity efl_content_get_api_delegate(System.IntPtr obj);
182 public static Efl.Eo.FunctionWrapper<efl_content_get_api_delegate> efl_content_get_ptr = new Efl.Eo.FunctionWrapper<efl_content_get_api_delegate>(_Module, "efl_content_get");
183 private static Efl.Gfx.Entity content_get(System.IntPtr obj, System.IntPtr pd)
185 Eina.Log.Debug("function efl_content_get was called");
186 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
187 if(wrapper != null) {
188 Efl.Gfx.Entity _ret_var = default(Efl.Gfx.Entity);
190 _ret_var = ((ListEmptyItem)wrapper).GetContent();
191 } catch (Exception e) {
192 Eina.Log.Warning($"Callback error: {e.ToString()}");
193 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
197 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
200 private static efl_content_get_delegate efl_content_get_static_delegate;
203 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_content_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.EntityConcrete, Efl.Eo.NonOwnTag>))] Efl.Gfx.Entity content);
206 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_content_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.EntityConcrete, Efl.Eo.NonOwnTag>))] Efl.Gfx.Entity content);
207 public static Efl.Eo.FunctionWrapper<efl_content_set_api_delegate> efl_content_set_ptr = new Efl.Eo.FunctionWrapper<efl_content_set_api_delegate>(_Module, "efl_content_set");
208 private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.Entity content)
210 Eina.Log.Debug("function efl_content_set was called");
211 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
212 if(wrapper != null) {
213 bool _ret_var = default(bool);
215 _ret_var = ((ListEmptyItem)wrapper).SetContent( content);
216 } catch (Exception e) {
217 Eina.Log.Warning($"Callback error: {e.ToString()}");
218 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
222 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
225 private static efl_content_set_delegate efl_content_set_static_delegate;
228 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.EntityConcrete, Efl.Eo.NonOwnTag>))] private delegate Efl.Gfx.Entity efl_content_unset_delegate(System.IntPtr obj, System.IntPtr pd);
231 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.EntityConcrete, Efl.Eo.NonOwnTag>))] public delegate Efl.Gfx.Entity efl_content_unset_api_delegate(System.IntPtr obj);
232 public static Efl.Eo.FunctionWrapper<efl_content_unset_api_delegate> efl_content_unset_ptr = new Efl.Eo.FunctionWrapper<efl_content_unset_api_delegate>(_Module, "efl_content_unset");
233 private static Efl.Gfx.Entity content_unset(System.IntPtr obj, System.IntPtr pd)
235 Eina.Log.Debug("function efl_content_unset was called");
236 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
237 if(wrapper != null) {
238 Efl.Gfx.Entity _ret_var = default(Efl.Gfx.Entity);
240 _ret_var = ((ListEmptyItem)wrapper).UnsetContent();
241 } catch (Exception e) {
242 Eina.Log.Warning($"Callback error: {e.ToString()}");
243 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
247 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
250 private static efl_content_unset_delegate efl_content_unset_static_delegate;