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>Class to be used to store object item size for List/Grid View.
9 /// This model provide "<c>total</c>.width" and "<c>total</c>.height" as an accumulated size of all its children "<c>self</c>.width" and "<c>self</c>.height" <see cref="Efl.IModel.GetProperty"/>. This is currently assuming a vertical list only.
11 /// This model will return an error code EAGAIN for "<c>item</c>.width" and "<c>item</c>.height" all the time and the View that use this Model should continue to get this value even after computing all the "<c>self</c>.width" and "<c>self</c>.height" of this object children.</summary>
12 [ExactModelNativeInherit]
13 public class ExactModel : Efl.Ui.SizeModel, Efl.Eo.IWrapper
15 ///<summary>Pointer to the native class description.</summary>
16 public override System.IntPtr NativeClass {
18 if (((object)this).GetType() == typeof (ExactModel))
19 return Efl.Ui.ExactModelNativeInherit.GetEflClassStatic();
21 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
24 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
25 efl_ui_exact_model_class_get();
26 ///<summary>Creates a new instance.</summary>
27 ///<param name="parent">Parent instance.</param>
28 ///<param name="model">Model that is/will be See <see cref="Efl.Ui.IView.SetModel"/></param>
29 ///<param name="index">Position of this object in the parent model. See <see cref="Efl.CompositeModel.SetIndex"/></param>
30 public ExactModel(Efl.Object parent
31 , Efl.IModel model, uint? index = null) :
32 base(efl_ui_exact_model_class_get(), typeof(ExactModel), parent)
34 if (Efl.Eo.Globals.ParamHelperCheck(model))
35 SetModel(Efl.Eo.Globals.GetParamHelper(model));
36 if (Efl.Eo.Globals.ParamHelperCheck(index))
37 SetIndex(Efl.Eo.Globals.GetParamHelper(index));
38 FinishInstantiation();
40 ///<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>
41 protected ExactModel(System.IntPtr raw) : base(raw)
43 RegisterEventProxies();
45 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
46 protected ExactModel(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
47 ///<summary>Verifies if the given object is equal to this one.</summary>
48 public override bool Equals(object obj)
50 var other = obj as Efl.Object;
53 return this.NativeHandle == other.NativeHandle;
55 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
56 public override int GetHashCode()
58 return this.NativeHandle.ToInt32();
60 ///<summary>Turns the native pointer into a string representation.</summary>
61 public override String ToString()
63 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
65 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
66 protected override void RegisterEventProxies()
68 base.RegisterEventProxies();
70 private static IntPtr GetEflClassStatic()
72 return Efl.Ui.ExactModel.efl_ui_exact_model_class_get();
75 public class ExactModelNativeInherit : Efl.Ui.SizeModelNativeInherit{
76 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
77 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
79 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
80 var methods = Efl.Eo.Globals.GetUserMethods(type);
81 descs.AddRange(base.GetEoOps(type));
84 public override IntPtr GetEflClass()
86 return Efl.Ui.ExactModel.efl_ui_exact_model_class_get();
88 public static new IntPtr GetEflClassStatic()
90 return Efl.Ui.ExactModel.efl_ui_exact_model_class_get();