4a4d73f067aed66cad91f075d2975ce5c75bd41f
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl_canvas_layout_part_swallow.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.ComponentModel;
7 namespace Efl { namespace Canvas { 
8 /// <summary>Represents a SWALLOW part of an Edje object.
9 /// Its lifetime is limited to one function call only, unless an extra reference is explicitely held.</summary>
10 [LayoutPartSwallowNativeInherit]
11 public class LayoutPartSwallow : Efl.Canvas.LayoutPart, Efl.Eo.IWrapper,Efl.Content
12 {
13    public new static System.IntPtr klass = System.IntPtr.Zero;
14    public new static Efl.Canvas.LayoutPartSwallowNativeInherit nativeInherit = new Efl.Canvas.LayoutPartSwallowNativeInherit();
15    ///<summary>Pointer to the native class description.</summary>
16    public override System.IntPtr NativeClass {
17       get {
18          if (((object)this).GetType() == typeof (LayoutPartSwallow))
19             return Efl.Canvas.LayoutPartSwallowNativeInherit.GetEflClassStatic();
20          else
21             return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
22       }
23    }
24    [System.Runtime.InteropServices.DllImport(efl.Libs.Edje)] internal static extern System.IntPtr
25       efl_canvas_layout_part_swallow_class_get();
26    ///<summary>Creates a new instance.</summary>
27    ///<param name="parent">Parent instance.</param>
28    public LayoutPartSwallow(Efl.Object parent= null
29          ) :
30       base(efl_canvas_layout_part_swallow_class_get(), typeof(LayoutPartSwallow), parent)
31    {
32       FinishInstantiation();
33    }
34    ///<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>
35    public LayoutPartSwallow(System.IntPtr raw) : base(raw)
36    {
37             register_event_proxies();
38    }
39    ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
40    protected LayoutPartSwallow(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
41    ///<summary>Casts obj into an instance of this type.</summary>
42    public new static LayoutPartSwallow static_cast(Efl.Object obj)
43    {
44       if (obj == null)
45          throw new System.ArgumentNullException("obj");
46       return new LayoutPartSwallow(obj.NativeHandle);
47    }
48    ///<summary>Verifies if the given object is equal to this one.</summary>
49    public override bool Equals(object obj)
50    {
51       var other = obj as Efl.Object;
52       if (other == null)
53          return false;
54       return this.NativeHandle == other.NativeHandle;
55    }
56    ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
57    public override int GetHashCode()
58    {
59       return this.NativeHandle.ToInt32();
60    }
61    ///<summary>Turns the native pointer into a string representation.</summary>
62    public override String ToString()
63    {
64       return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
65    }
66 private static object ContentChangedEvtKey = new object();
67    /// <summary>Sent after the content is set or unset using the current content object.</summary>
68    public event EventHandler<Efl.ContentContentChangedEvt_Args> ContentChangedEvt
69    {
70       add {
71          lock (eventLock) {
72             string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
73             if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_ContentChangedEvt_delegate)) {
74                eventHandlers.AddHandler(ContentChangedEvtKey , value);
75             } else
76                Eina.Log.Error($"Error adding proxy for event {key}");
77          }
78       }
79       remove {
80          lock (eventLock) {
81             string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
82             if (remove_cpp_event_handler(key, this.evt_ContentChangedEvt_delegate)) { 
83                eventHandlers.RemoveHandler(ContentChangedEvtKey , value);
84             } else
85                Eina.Log.Error($"Error removing proxy for event {key}");
86          }
87       }
88    }
89    ///<summary>Method to raise event ContentChangedEvt.</summary>
90    public void On_ContentChangedEvt(Efl.ContentContentChangedEvt_Args e)
91    {
92       EventHandler<Efl.ContentContentChangedEvt_Args> evt;
93       lock (eventLock) {
94       evt = (EventHandler<Efl.ContentContentChangedEvt_Args>)eventHandlers[ContentChangedEvtKey];
95       }
96       evt?.Invoke(this, e);
97    }
98    Efl.EventCb evt_ContentChangedEvt_delegate;
99    private void on_ContentChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
100    {
101       Efl.ContentContentChangedEvt_Args args = new Efl.ContentContentChangedEvt_Args();
102       args.arg = new Efl.Gfx.EntityConcrete(evt.Info);
103       try {
104          On_ContentChangedEvt(args);
105       } catch (Exception e) {
106          Eina.Log.Error(e.ToString());
107          Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
108       }
109    }
110
111    protected override void register_event_proxies()
112    {
113       base.register_event_proxies();
114       evt_ContentChangedEvt_delegate = new Efl.EventCb(on_ContentChangedEvt_NativeCallback);
115    }
116    /// <summary>Swallowed sub-object contained in this object.</summary>
117    /// <returns>The object to swallow.</returns>
118    virtual public Efl.Gfx.Entity GetContent() {
119        var _ret_var = Efl.ContentNativeInherit.efl_content_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
120       Eina.Error.RaiseIfUnhandledException();
121       return _ret_var;
122  }
123    /// <summary>Swallowed sub-object contained in this object.</summary>
124    /// <param name="content">The object to swallow.</param>
125    /// <returns><c>true</c> on success, <c>false</c> otherwise</returns>
126    virtual public bool SetContent( Efl.Gfx.Entity content) {
127                          var _ret_var = Efl.ContentNativeInherit.efl_content_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), content);
128       Eina.Error.RaiseIfUnhandledException();
129                   return _ret_var;
130  }
131    /// <summary>Unswallow the object in the current container and return it.</summary>
132    /// <returns>Unswallowed object</returns>
133    virtual public Efl.Gfx.Entity UnsetContent() {
134        var _ret_var = Efl.ContentNativeInherit.efl_content_unset_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
135       Eina.Error.RaiseIfUnhandledException();
136       return _ret_var;
137  }
138    /// <summary>Swallowed sub-object contained in this object.</summary>
139 /// <value>The object to swallow.</value>
140    public Efl.Gfx.Entity Content {
141       get { return GetContent(); }
142       set { SetContent( value); }
143    }
144    private static new  IntPtr GetEflClassStatic()
145    {
146       return Efl.Canvas.LayoutPartSwallow.efl_canvas_layout_part_swallow_class_get();
147    }
148 }
149 public class LayoutPartSwallowNativeInherit : Efl.Canvas.LayoutPartNativeInherit{
150    public new  static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Edje);
151    public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
152    {
153       var descs = new System.Collections.Generic.List<Efl_Op_Description>();
154       if (efl_content_get_static_delegate == null)
155       efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
156       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)});
157       if (efl_content_set_static_delegate == null)
158       efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
159       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)});
160       if (efl_content_unset_static_delegate == null)
161       efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
162       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)});
163       descs.AddRange(base.GetEoOps(type));
164       return descs;
165    }
166    public override IntPtr GetEflClass()
167    {
168       return Efl.Canvas.LayoutPartSwallow.efl_canvas_layout_part_swallow_class_get();
169    }
170    public static new  IntPtr GetEflClassStatic()
171    {
172       return Efl.Canvas.LayoutPartSwallow.efl_canvas_layout_part_swallow_class_get();
173    }
174
175
176    [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);
177
178
179    [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);
180     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");
181     private static Efl.Gfx.Entity content_get(System.IntPtr obj, System.IntPtr pd)
182    {
183       Eina.Log.Debug("function efl_content_get was called");
184       Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
185       if(wrapper != null) {
186                   Efl.Gfx.Entity _ret_var = default(Efl.Gfx.Entity);
187          try {
188             _ret_var = ((LayoutPartSwallow)wrapper).GetContent();
189          } catch (Exception e) {
190             Eina.Log.Warning($"Callback error: {e.ToString()}");
191             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
192          }
193       return _ret_var;
194       } else {
195          return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
196       }
197    }
198    private static efl_content_get_delegate efl_content_get_static_delegate;
199
200
201     [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);
202
203
204     [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);
205     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");
206     private static bool content_set(System.IntPtr obj, System.IntPtr pd,  Efl.Gfx.Entity content)
207    {
208       Eina.Log.Debug("function efl_content_set was called");
209       Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
210       if(wrapper != null) {
211                                     bool _ret_var = default(bool);
212          try {
213             _ret_var = ((LayoutPartSwallow)wrapper).SetContent( content);
214          } catch (Exception e) {
215             Eina.Log.Warning($"Callback error: {e.ToString()}");
216             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
217          }
218                   return _ret_var;
219       } else {
220          return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)),  content);
221       }
222    }
223    private static efl_content_set_delegate efl_content_set_static_delegate;
224
225
226    [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);
227
228
229    [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);
230     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");
231     private static Efl.Gfx.Entity content_unset(System.IntPtr obj, System.IntPtr pd)
232    {
233       Eina.Log.Debug("function efl_content_unset was called");
234       Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
235       if(wrapper != null) {
236                   Efl.Gfx.Entity _ret_var = default(Efl.Gfx.Entity);
237          try {
238             _ret_var = ((LayoutPartSwallow)wrapper).UnsetContent();
239          } catch (Exception e) {
240             Eina.Log.Warning($"Callback error: {e.ToString()}");
241             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
242          }
243       return _ret_var;
244       } else {
245          return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
246       }
247    }
248    private static efl_content_unset_delegate efl_content_unset_static_delegate;
249 }
250 } }