1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
12 /// <summary>Page transition for <see cref="Efl.Ui.Pager"/>
13 /// With this type of transition, pages are arranged linearly and move parallel to the screen by scrolling. The current page is displayed at center, and previous and next pages might be displayed optionally.</summary>
14 [Efl.Page.TransitionScroll.NativeMethods]
15 public class TransitionScroll : Efl.Page.Transition, Efl.Eo.IWrapper
17 ///<summary>Pointer to the native class description.</summary>
18 public override System.IntPtr NativeClass
22 if (((object)this).GetType() == typeof(TransitionScroll))
24 return GetEflClassStatic();
28 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
33 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
34 efl_page_transition_scroll_class_get();
35 /// <summary>Initializes a new instance of the <see cref="TransitionScroll"/> class.</summary>
36 /// <param name="parent">Parent instance.</param>
37 public TransitionScroll(Efl.Object parent= null
38 ) : base(efl_page_transition_scroll_class_get(), typeof(TransitionScroll), parent)
40 FinishInstantiation();
43 /// <summary>Initializes a new instance of the <see cref="TransitionScroll"/> class.
44 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
45 /// <param name="raw">The native pointer to be wrapped.</param>
46 protected TransitionScroll(System.IntPtr raw) : base(raw)
50 /// <summary>Initializes a new instance of the <see cref="TransitionScroll"/> class.
51 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
52 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
53 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
54 /// <param name="parent">The Efl.Object parent of this instance.</param>
55 protected TransitionScroll(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
59 /// <summary>Verifies if the given object is equal to this one.</summary>
60 /// <param name="instance">The object to compare to.</param>
61 /// <returns>True if both objects point to the same native object.</returns>
62 public override bool Equals(object instance)
64 var other = instance as Efl.Object;
69 return this.NativeHandle == other.NativeHandle;
72 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
73 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
74 public override int GetHashCode()
76 return this.NativeHandle.ToInt32();
79 /// <summary>Turns the native pointer into a string representation.</summary>
80 /// <returns>A string with the type and the native pointer for this object.</returns>
81 public override String ToString()
83 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
86 /// <summary>The number of pages displayed on each side of the current page</summary>
87 virtual public int GetSidePageNum() {
88 var _ret_var = Efl.Page.TransitionScroll.NativeMethods.efl_page_transition_scroll_side_page_num_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
89 Eina.Error.RaiseIfUnhandledException();
92 /// <summary>The number of pages displayed on each side of the current page</summary>
93 virtual public void SetSidePageNum(int side_page_num) {
94 Efl.Page.TransitionScroll.NativeMethods.efl_page_transition_scroll_side_page_num_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),side_page_num);
95 Eina.Error.RaiseIfUnhandledException();
97 /// <summary>The number of pages displayed on each side of the current page</summary>
98 public int SidePageNum {
99 get { return GetSidePageNum(); }
100 set { SetSidePageNum(value); }
102 private static IntPtr GetEflClassStatic()
104 return Efl.Page.TransitionScroll.efl_page_transition_scroll_class_get();
106 /// <summary>Wrapper for native methods and virtual method delegates.
107 /// For internal use by generated code only.</summary>
108 public new class NativeMethods : Efl.Page.Transition.NativeMethods
110 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
111 /// <summary>Gets the list of Eo operations to override.</summary>
112 /// <returns>The list of Eo operations to be overload.</returns>
113 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
115 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
116 var methods = Efl.Eo.Globals.GetUserMethods(type);
118 if (efl_page_transition_scroll_side_page_num_get_static_delegate == null)
120 efl_page_transition_scroll_side_page_num_get_static_delegate = new efl_page_transition_scroll_side_page_num_get_delegate(side_page_num_get);
123 if (methods.FirstOrDefault(m => m.Name == "GetSidePageNum") != null)
125 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_page_transition_scroll_side_page_num_get"), func = Marshal.GetFunctionPointerForDelegate(efl_page_transition_scroll_side_page_num_get_static_delegate) });
128 if (efl_page_transition_scroll_side_page_num_set_static_delegate == null)
130 efl_page_transition_scroll_side_page_num_set_static_delegate = new efl_page_transition_scroll_side_page_num_set_delegate(side_page_num_set);
133 if (methods.FirstOrDefault(m => m.Name == "SetSidePageNum") != null)
135 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_page_transition_scroll_side_page_num_set"), func = Marshal.GetFunctionPointerForDelegate(efl_page_transition_scroll_side_page_num_set_static_delegate) });
138 descs.AddRange(base.GetEoOps(type));
141 /// <summary>Returns the Eo class for the native methods of this class.</summary>
142 /// <returns>The native class pointer.</returns>
143 public override IntPtr GetEflClass()
145 return Efl.Page.TransitionScroll.efl_page_transition_scroll_class_get();
148 #pragma warning disable CA1707, SA1300, SA1600
151 private delegate int efl_page_transition_scroll_side_page_num_get_delegate(System.IntPtr obj, System.IntPtr pd);
154 public delegate int efl_page_transition_scroll_side_page_num_get_api_delegate(System.IntPtr obj);
156 public static Efl.Eo.FunctionWrapper<efl_page_transition_scroll_side_page_num_get_api_delegate> efl_page_transition_scroll_side_page_num_get_ptr = new Efl.Eo.FunctionWrapper<efl_page_transition_scroll_side_page_num_get_api_delegate>(Module, "efl_page_transition_scroll_side_page_num_get");
158 private static int side_page_num_get(System.IntPtr obj, System.IntPtr pd)
160 Eina.Log.Debug("function efl_page_transition_scroll_side_page_num_get was called");
161 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
164 int _ret_var = default(int);
167 _ret_var = ((TransitionScroll)wrapper).GetSidePageNum();
171 Eina.Log.Warning($"Callback error: {e.ToString()}");
172 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
180 return efl_page_transition_scroll_side_page_num_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
184 private static efl_page_transition_scroll_side_page_num_get_delegate efl_page_transition_scroll_side_page_num_get_static_delegate;
187 private delegate void efl_page_transition_scroll_side_page_num_set_delegate(System.IntPtr obj, System.IntPtr pd, int side_page_num);
190 public delegate void efl_page_transition_scroll_side_page_num_set_api_delegate(System.IntPtr obj, int side_page_num);
192 public static Efl.Eo.FunctionWrapper<efl_page_transition_scroll_side_page_num_set_api_delegate> efl_page_transition_scroll_side_page_num_set_ptr = new Efl.Eo.FunctionWrapper<efl_page_transition_scroll_side_page_num_set_api_delegate>(Module, "efl_page_transition_scroll_side_page_num_set");
194 private static void side_page_num_set(System.IntPtr obj, System.IntPtr pd, int side_page_num)
196 Eina.Log.Debug("function efl_page_transition_scroll_side_page_num_set was called");
197 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
203 ((TransitionScroll)wrapper).SetSidePageNum(side_page_num);
207 Eina.Log.Warning($"Callback error: {e.ToString()}");
208 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
215 efl_page_transition_scroll_side_page_num_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), side_page_num);
219 private static efl_page_transition_scroll_side_page_num_set_delegate efl_page_transition_scroll_side_page_num_set_static_delegate;
221 #pragma warning restore CA1707, SA1300, SA1600