4340822afb80ec42f8ecf3831be0ba225aff48a9
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_direction.eo.cs
1 #pragma warning disable CS1591
2 using System;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Threading;
7 using System.ComponentModel;
8 namespace Efl {
9
10 namespace Ui {
11
12 /// <summary>EFL UI object direction interface</summary>
13 [Efl.Ui.IDirectionConcrete.NativeMethods]
14 public interface IDirection : 
15     Efl.Eo.IWrapper, IDisposable
16 {
17     /// <summary>Control the direction of a given widget.
18 /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
19 /// 
20 /// Mirroring as defined in <see cref="Efl.Ui.II18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
21 /// <returns>Direction of the widget.</returns>
22 Efl.Ui.Dir GetDirection();
23     /// <summary>Control the direction of a given widget.
24 /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
25 /// 
26 /// Mirroring as defined in <see cref="Efl.Ui.II18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
27 /// <param name="dir">Direction of the widget.</param>
28 void SetDirection(Efl.Ui.Dir dir);
29             /// <summary>Control the direction of a given widget.
30 /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
31 /// 
32 /// Mirroring as defined in <see cref="Efl.Ui.II18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
33 /// <value>Direction of the widget.</value>
34     Efl.Ui.Dir Direction {
35         get ;
36         set ;
37     }
38 }
39 /// <summary>EFL UI object direction interface</summary>
40 sealed public class IDirectionConcrete : 
41
42 IDirection
43     
44 {
45     ///<summary>Pointer to the native class description.</summary>
46     public System.IntPtr NativeClass
47     {
48         get
49         {
50             if (((object)this).GetType() == typeof(IDirectionConcrete))
51             {
52                 return GetEflClassStatic();
53             }
54             else
55             {
56                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
57             }
58         }
59     }
60
61     private  System.IntPtr handle;
62     ///<summary>Pointer to the native instance.</summary>
63     public System.IntPtr NativeHandle
64     {
65         get { return handle; }
66     }
67
68     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
69         efl_ui_direction_interface_get();
70     /// <summary>Initializes a new instance of the <see cref="IDirection"/> class.
71     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
72     private IDirectionConcrete(System.IntPtr raw)
73     {
74         handle = raw;
75     }
76     ///<summary>Destructor.</summary>
77     ~IDirectionConcrete()
78     {
79         Dispose(false);
80     }
81
82     ///<summary>Releases the underlying native instance.</summary>
83     private void Dispose(bool disposing)
84     {
85         if (handle != System.IntPtr.Zero)
86         {
87             IntPtr h = handle;
88             handle = IntPtr.Zero;
89
90             IntPtr gcHandlePtr = IntPtr.Zero;
91             if (disposing)
92             {
93                 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
94             }
95             else
96             {
97                 Monitor.Enter(Efl.All.InitLock);
98                 if (Efl.All.MainLoopInitialized)
99                 {
100                     Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
101                 }
102
103                 Monitor.Exit(Efl.All.InitLock);
104             }
105         }
106
107     }
108
109     ///<summary>Releases the underlying native instance.</summary>
110     public void Dispose()
111     {
112         Dispose(true);
113         GC.SuppressFinalize(this);
114     }
115
116     /// <summary>Verifies if the given object is equal to this one.</summary>
117     /// <param name="instance">The object to compare to.</param>
118     /// <returns>True if both objects point to the same native object.</returns>
119     public override bool Equals(object instance)
120     {
121         var other = instance as Efl.Object;
122         if (other == null)
123         {
124             return false;
125         }
126         return this.NativeHandle == other.NativeHandle;
127     }
128
129     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
130     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
131     public override int GetHashCode()
132     {
133         return this.NativeHandle.ToInt32();
134     }
135
136     /// <summary>Turns the native pointer into a string representation.</summary>
137     /// <returns>A string with the type and the native pointer for this object.</returns>
138     public override String ToString()
139     {
140         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
141     }
142
143     /// <summary>Control the direction of a given widget.
144     /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
145     /// 
146     /// Mirroring as defined in <see cref="Efl.Ui.II18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
147     /// <returns>Direction of the widget.</returns>
148     public Efl.Ui.Dir GetDirection() {
149          var _ret_var = Efl.Ui.IDirectionConcrete.NativeMethods.efl_ui_direction_get_ptr.Value.Delegate(this.NativeHandle);
150         Eina.Error.RaiseIfUnhandledException();
151         return _ret_var;
152  }
153     /// <summary>Control the direction of a given widget.
154     /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
155     /// 
156     /// Mirroring as defined in <see cref="Efl.Ui.II18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
157     /// <param name="dir">Direction of the widget.</param>
158     public void SetDirection(Efl.Ui.Dir dir) {
159                                  Efl.Ui.IDirectionConcrete.NativeMethods.efl_ui_direction_set_ptr.Value.Delegate(this.NativeHandle,dir);
160         Eina.Error.RaiseIfUnhandledException();
161                          }
162     /// <summary>Control the direction of a given widget.
163 /// Use this function to change how your widget is to be disposed: vertically or horizontally or inverted vertically or inverted horizontally.
164 /// 
165 /// Mirroring as defined in <see cref="Efl.Ui.II18n"/> can invert the <c>horizontal</c> direction: it is <c>ltr</c> by default, but becomes <c>rtl</c> if the object is mirrored.</summary>
166 /// <value>Direction of the widget.</value>
167     public Efl.Ui.Dir Direction {
168         get { return GetDirection(); }
169         set { SetDirection(value); }
170     }
171     private static IntPtr GetEflClassStatic()
172     {
173         return Efl.Ui.IDirectionConcrete.efl_ui_direction_interface_get();
174     }
175     /// <summary>Wrapper for native methods and virtual method delegates.
176     /// For internal use by generated code only.</summary>
177     public class NativeMethods  : Efl.Eo.NativeClass
178     {
179         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
180         /// <summary>Gets the list of Eo operations to override.</summary>
181         /// <returns>The list of Eo operations to be overload.</returns>
182         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
183         {
184             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
185             var methods = Efl.Eo.Globals.GetUserMethods(type);
186
187             if (efl_ui_direction_get_static_delegate == null)
188             {
189                 efl_ui_direction_get_static_delegate = new efl_ui_direction_get_delegate(direction_get);
190             }
191
192             if (methods.FirstOrDefault(m => m.Name == "GetDirection") != null)
193             {
194                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_direction_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_direction_get_static_delegate) });
195             }
196
197             if (efl_ui_direction_set_static_delegate == null)
198             {
199                 efl_ui_direction_set_static_delegate = new efl_ui_direction_set_delegate(direction_set);
200             }
201
202             if (methods.FirstOrDefault(m => m.Name == "SetDirection") != null)
203             {
204                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_direction_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_direction_set_static_delegate) });
205             }
206
207             return descs;
208         }
209         /// <summary>Returns the Eo class for the native methods of this class.</summary>
210         /// <returns>The native class pointer.</returns>
211         public override IntPtr GetEflClass()
212         {
213             return Efl.Ui.IDirectionConcrete.efl_ui_direction_interface_get();
214         }
215
216         #pragma warning disable CA1707, SA1300, SA1600
217
218         
219         private delegate Efl.Ui.Dir efl_ui_direction_get_delegate(System.IntPtr obj, System.IntPtr pd);
220
221         
222         public delegate Efl.Ui.Dir efl_ui_direction_get_api_delegate(System.IntPtr obj);
223
224         public static Efl.Eo.FunctionWrapper<efl_ui_direction_get_api_delegate> efl_ui_direction_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_direction_get_api_delegate>(Module, "efl_ui_direction_get");
225
226         private static Efl.Ui.Dir direction_get(System.IntPtr obj, System.IntPtr pd)
227         {
228             Eina.Log.Debug("function efl_ui_direction_get was called");
229             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
230             if (wrapper != null)
231             {
232             Efl.Ui.Dir _ret_var = default(Efl.Ui.Dir);
233                 try
234                 {
235                     _ret_var = ((IDirection)wrapper).GetDirection();
236                 }
237                 catch (Exception e)
238                 {
239                     Eina.Log.Warning($"Callback error: {e.ToString()}");
240                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
241                 }
242
243         return _ret_var;
244
245             }
246             else
247             {
248                 return efl_ui_direction_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
249             }
250         }
251
252         private static efl_ui_direction_get_delegate efl_ui_direction_get_static_delegate;
253
254         
255         private delegate void efl_ui_direction_set_delegate(System.IntPtr obj, System.IntPtr pd,  Efl.Ui.Dir dir);
256
257         
258         public delegate void efl_ui_direction_set_api_delegate(System.IntPtr obj,  Efl.Ui.Dir dir);
259
260         public static Efl.Eo.FunctionWrapper<efl_ui_direction_set_api_delegate> efl_ui_direction_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_direction_set_api_delegate>(Module, "efl_ui_direction_set");
261
262         private static void direction_set(System.IntPtr obj, System.IntPtr pd, Efl.Ui.Dir dir)
263         {
264             Eina.Log.Debug("function efl_ui_direction_set was called");
265             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
266             if (wrapper != null)
267             {
268                                     
269                 try
270                 {
271                     ((IDirection)wrapper).SetDirection(dir);
272                 }
273                 catch (Exception e)
274                 {
275                     Eina.Log.Warning($"Callback error: {e.ToString()}");
276                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
277                 }
278
279                         
280             }
281             else
282             {
283                 efl_ui_direction_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), dir);
284             }
285         }
286
287         private static efl_ui_direction_set_delegate efl_ui_direction_set_static_delegate;
288
289         #pragma warning restore CA1707, SA1300, SA1600
290
291 }
292 }
293 }
294
295 }
296
297 namespace Efl {
298
299 namespace Ui {
300
301 /// <summary>Direction for UI objects and layouts.
302 /// Not to be confused with <see cref="Efl.Orient"/> which is for images and canvases. This enum is used to define how widgets should expand and orient themselves, not to rotate images.
303 /// 
304 /// See also <see cref="Efl.Ui.IDirection"/>.</summary>
305 public enum Dir
306 {
307 /// <summary>Default direction. Each widget may have a different default.</summary>
308 Default = 0,
309 /// <summary>Horizontal direction, along the X axis. Usually left-to-right, but may be inverted to right-to-left if mirroring is on.</summary>
310 Horizontal = 1,
311 /// <summary>Vertical direction, along the Y axis. Usually downwards.</summary>
312 Vertical = 2,
313 /// <summary>Horizontal, left-to-right direction.</summary>
314 Ltr = 3,
315 /// <summary>Horizontal, right-to-left direction.</summary>
316 Rtl = 4,
317 /// <summary>Vertical, top-to-bottom direction.</summary>
318 Down = 5,
319 /// <summary>Vertical, bottom-to-top direction.</summary>
320 Up = 6,
321 /// <summary>Right is an alias for LTR.</summary>
322 Right = 3,
323 /// <summary>Left is an alias for RTL.</summary>
324 Left = 4,
325 }
326
327 }
328
329 }
330