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>Grid Default Item class. This class need to be sub object of list widget. Text and contents can be set using <see cref="Efl.Text"/>, <see cref="Efl.Content"/> or <see cref="Efl.Part"/>.</summary>
9 [GridDefaultItemNativeInherit]
10 public class GridDefaultItem : Efl.Ui.GridItem, Efl.Eo.IWrapper,Efl.Content,Efl.Text,Efl.TextMarkup
12 public new static System.IntPtr klass = System.IntPtr.Zero;
13 public new static Efl.Ui.GridDefaultItemNativeInherit nativeInherit = new Efl.Ui.GridDefaultItemNativeInherit();
14 ///<summary>Pointer to the native class description.</summary>
15 public override System.IntPtr NativeClass {
17 if (((object)this).GetType() == typeof (GridDefaultItem))
18 return Efl.Ui.GridDefaultItemNativeInherit.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_grid_default_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 GridDefaultItem(Efl.Object parent
29 , System.String style = null) :
30 base(efl_ui_grid_default_item_class_get(), typeof(GridDefaultItem), 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 GridDefaultItem(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 GridDefaultItem(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 GridDefaultItem static_cast(Efl.Object obj)
47 throw new System.ArgumentNullException("obj");
48 return new GridDefaultItem(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>No description supplied.</summary>
119 public Efl.Ui.GridDefaultItemPartEnd End
123 Efl.Object obj = Efl.PartNativeInherit.efl_part_get_ptr.Value.Delegate(NativeHandle, "end");
124 return Efl.Ui.GridDefaultItemPartEnd.static_cast(obj);
127 /// <summary>No description supplied.</summary>
128 public Efl.Ui.GridDefaultItemPartIcon Icon
132 Efl.Object obj = Efl.PartNativeInherit.efl_part_get_ptr.Value.Delegate(NativeHandle, "icon");
133 return Efl.Ui.GridDefaultItemPartIcon.static_cast(obj);
136 /// <summary>Swallowed sub-object contained in this object.</summary>
137 /// <returns>The object to swallow.</returns>
138 virtual public Efl.Gfx.Entity GetContent() {
139 var _ret_var = Efl.ContentNativeInherit.efl_content_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
140 Eina.Error.RaiseIfUnhandledException();
143 /// <summary>Swallowed sub-object contained in this object.</summary>
144 /// <param name="content">The object to swallow.</param>
145 /// <returns><c>true</c> on success, <c>false</c> otherwise</returns>
146 virtual public bool SetContent( Efl.Gfx.Entity content) {
147 var _ret_var = Efl.ContentNativeInherit.efl_content_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), content);
148 Eina.Error.RaiseIfUnhandledException();
151 /// <summary>Unswallow the object in the current container and return it.</summary>
152 /// <returns>Unswallowed object</returns>
153 virtual public Efl.Gfx.Entity UnsetContent() {
154 var _ret_var = Efl.ContentNativeInherit.efl_content_unset_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
155 Eina.Error.RaiseIfUnhandledException();
158 /// <summary>Retrieves the text string currently being displayed by the given text object.
159 /// Do not free() the return value.
161 /// See also <see cref="Efl.Text.GetText"/>.</summary>
162 /// <returns>Text string to display on it.</returns>
163 virtual public System.String GetText() {
164 var _ret_var = Efl.TextNativeInherit.efl_text_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
165 Eina.Error.RaiseIfUnhandledException();
168 /// <summary>Sets the text string to be displayed by the given text object.
169 /// See also <see cref="Efl.Text.GetText"/>.</summary>
170 /// <param name="text">Text string to display on it.</param>
171 /// <returns></returns>
172 virtual public void SetText( System.String text) {
173 Efl.TextNativeInherit.efl_text_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), text);
174 Eina.Error.RaiseIfUnhandledException();
176 /// <summary>Markup property
178 /// <returns>The markup-text representation set to this text.
180 virtual public System.String GetMarkup() {
181 var _ret_var = Efl.TextMarkupNativeInherit.efl_text_markup_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
182 Eina.Error.RaiseIfUnhandledException();
185 /// <summary>Markup property
187 /// <param name="markup">The markup-text representation set to this text.
189 /// <returns></returns>
190 virtual public void SetMarkup( System.String markup) {
191 Efl.TextMarkupNativeInherit.efl_text_markup_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), markup);
192 Eina.Error.RaiseIfUnhandledException();
194 /// <summary>Swallowed sub-object contained in this object.</summary>
195 /// <value>The object to swallow.</value>
196 public Efl.Gfx.Entity Content {
197 get { return GetContent(); }
198 set { SetContent( value); }
200 /// <summary>Markup property
202 /// <value>The markup-text representation set to this text.
204 public System.String Markup {
205 get { return GetMarkup(); }
206 set { SetMarkup( value); }
208 private static new IntPtr GetEflClassStatic()
210 return Efl.Ui.GridDefaultItem.efl_ui_grid_default_item_class_get();
213 public class GridDefaultItemNativeInherit : Efl.Ui.GridItemNativeInherit{
214 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
215 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
217 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
218 if (efl_content_get_static_delegate == null)
219 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
220 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)});
221 if (efl_content_set_static_delegate == null)
222 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
223 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)});
224 if (efl_content_unset_static_delegate == null)
225 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
226 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)});
227 if (efl_text_get_static_delegate == null)
228 efl_text_get_static_delegate = new efl_text_get_delegate(text_get);
229 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_text_get"), func = Marshal.GetFunctionPointerForDelegate(efl_text_get_static_delegate)});
230 if (efl_text_set_static_delegate == null)
231 efl_text_set_static_delegate = new efl_text_set_delegate(text_set);
232 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_text_set"), func = Marshal.GetFunctionPointerForDelegate(efl_text_set_static_delegate)});
233 if (efl_text_markup_get_static_delegate == null)
234 efl_text_markup_get_static_delegate = new efl_text_markup_get_delegate(markup_get);
235 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_text_markup_get"), func = Marshal.GetFunctionPointerForDelegate(efl_text_markup_get_static_delegate)});
236 if (efl_text_markup_set_static_delegate == null)
237 efl_text_markup_set_static_delegate = new efl_text_markup_set_delegate(markup_set);
238 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_text_markup_set"), func = Marshal.GetFunctionPointerForDelegate(efl_text_markup_set_static_delegate)});
239 descs.AddRange(base.GetEoOps(type));
242 public override IntPtr GetEflClass()
244 return Efl.Ui.GridDefaultItem.efl_ui_grid_default_item_class_get();
246 public static new IntPtr GetEflClassStatic()
248 return Efl.Ui.GridDefaultItem.efl_ui_grid_default_item_class_get();
252 [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);
255 [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);
256 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");
257 private static Efl.Gfx.Entity content_get(System.IntPtr obj, System.IntPtr pd)
259 Eina.Log.Debug("function efl_content_get was called");
260 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
261 if(wrapper != null) {
262 Efl.Gfx.Entity _ret_var = default(Efl.Gfx.Entity);
264 _ret_var = ((GridDefaultItem)wrapper).GetContent();
265 } catch (Exception e) {
266 Eina.Log.Warning($"Callback error: {e.ToString()}");
267 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
271 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
274 private static efl_content_get_delegate efl_content_get_static_delegate;
277 [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);
280 [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);
281 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");
282 private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.Entity content)
284 Eina.Log.Debug("function efl_content_set was called");
285 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
286 if(wrapper != null) {
287 bool _ret_var = default(bool);
289 _ret_var = ((GridDefaultItem)wrapper).SetContent( content);
290 } catch (Exception e) {
291 Eina.Log.Warning($"Callback error: {e.ToString()}");
292 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
296 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
299 private static efl_content_set_delegate efl_content_set_static_delegate;
302 [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);
305 [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);
306 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");
307 private static Efl.Gfx.Entity content_unset(System.IntPtr obj, System.IntPtr pd)
309 Eina.Log.Debug("function efl_content_unset was called");
310 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
311 if(wrapper != null) {
312 Efl.Gfx.Entity _ret_var = default(Efl.Gfx.Entity);
314 _ret_var = ((GridDefaultItem)wrapper).UnsetContent();
315 } catch (Exception e) {
316 Eina.Log.Warning($"Callback error: {e.ToString()}");
317 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
321 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
324 private static efl_content_unset_delegate efl_content_unset_static_delegate;
327 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] private delegate System.String efl_text_get_delegate(System.IntPtr obj, System.IntPtr pd);
330 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] public delegate System.String efl_text_get_api_delegate(System.IntPtr obj);
331 public static Efl.Eo.FunctionWrapper<efl_text_get_api_delegate> efl_text_get_ptr = new Efl.Eo.FunctionWrapper<efl_text_get_api_delegate>(_Module, "efl_text_get");
332 private static System.String text_get(System.IntPtr obj, System.IntPtr pd)
334 Eina.Log.Debug("function efl_text_get was called");
335 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
336 if(wrapper != null) {
337 System.String _ret_var = default( System.String);
339 _ret_var = ((GridDefaultItem)wrapper).GetText();
340 } catch (Exception e) {
341 Eina.Log.Warning($"Callback error: {e.ToString()}");
342 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
346 return efl_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
349 private static efl_text_get_delegate efl_text_get_static_delegate;
352 private delegate void efl_text_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
355 public delegate void efl_text_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
356 public static Efl.Eo.FunctionWrapper<efl_text_set_api_delegate> efl_text_set_ptr = new Efl.Eo.FunctionWrapper<efl_text_set_api_delegate>(_Module, "efl_text_set");
357 private static void text_set(System.IntPtr obj, System.IntPtr pd, System.String text)
359 Eina.Log.Debug("function efl_text_set was called");
360 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
361 if(wrapper != null) {
364 ((GridDefaultItem)wrapper).SetText( text);
365 } catch (Exception e) {
366 Eina.Log.Warning($"Callback error: {e.ToString()}");
367 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
370 efl_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text);
373 private static efl_text_set_delegate efl_text_set_static_delegate;
376 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] private delegate System.String efl_text_markup_get_delegate(System.IntPtr obj, System.IntPtr pd);
379 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] public delegate System.String efl_text_markup_get_api_delegate(System.IntPtr obj);
380 public static Efl.Eo.FunctionWrapper<efl_text_markup_get_api_delegate> efl_text_markup_get_ptr = new Efl.Eo.FunctionWrapper<efl_text_markup_get_api_delegate>(_Module, "efl_text_markup_get");
381 private static System.String markup_get(System.IntPtr obj, System.IntPtr pd)
383 Eina.Log.Debug("function efl_text_markup_get was called");
384 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
385 if(wrapper != null) {
386 System.String _ret_var = default( System.String);
388 _ret_var = ((GridDefaultItem)wrapper).GetMarkup();
389 } catch (Exception e) {
390 Eina.Log.Warning($"Callback error: {e.ToString()}");
391 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
395 return efl_text_markup_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
398 private static efl_text_markup_get_delegate efl_text_markup_get_static_delegate;
401 private delegate void efl_text_markup_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String markup);
404 public delegate void efl_text_markup_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String markup);
405 public static Efl.Eo.FunctionWrapper<efl_text_markup_set_api_delegate> efl_text_markup_set_ptr = new Efl.Eo.FunctionWrapper<efl_text_markup_set_api_delegate>(_Module, "efl_text_markup_set");
406 private static void markup_set(System.IntPtr obj, System.IntPtr pd, System.String markup)
408 Eina.Log.Debug("function efl_text_markup_set was called");
409 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
410 if(wrapper != null) {
413 ((GridDefaultItem)wrapper).SetMarkup( markup);
414 } catch (Exception e) {
415 Eina.Log.Warning($"Callback error: {e.ToString()}");
416 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
419 efl_text_markup_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), markup);
422 private static efl_text_markup_set_delegate efl_text_markup_set_static_delegate;