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>Efl UI Text Alert Popup internal part class</summary>
13 [Efl.Ui.TextAlertPopupPart.NativeMethods]
14 public class TextAlertPopupPart : Efl.Ui.LayoutPart, Efl.Eo.IWrapper,Efl.IContent,Efl.IText
16 ///<summary>Pointer to the native class description.</summary>
17 public override System.IntPtr NativeClass
21 if (((object)this).GetType() == typeof(TextAlertPopupPart))
23 return GetEflClassStatic();
27 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
32 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
33 efl_ui_text_alert_popup_part_class_get();
34 /// <summary>Initializes a new instance of the <see cref="TextAlertPopupPart"/> class.</summary>
35 /// <param name="parent">Parent instance.</param>
36 public TextAlertPopupPart(Efl.Object parent= null
37 ) : base(efl_ui_text_alert_popup_part_class_get(), typeof(TextAlertPopupPart), parent)
39 FinishInstantiation();
42 /// <summary>Initializes a new instance of the <see cref="TextAlertPopupPart"/> class.
43 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
44 /// <param name="raw">The native pointer to be wrapped.</param>
45 protected TextAlertPopupPart(System.IntPtr raw) : base(raw)
49 /// <summary>Initializes a new instance of the <see cref="TextAlertPopupPart"/> class.
50 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
51 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
52 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
53 /// <param name="parent">The Efl.Object parent of this instance.</param>
54 protected TextAlertPopupPart(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
58 /// <summary>Verifies if the given object is equal to this one.</summary>
59 /// <param name="instance">The object to compare to.</param>
60 /// <returns>True if both objects point to the same native object.</returns>
61 public override bool Equals(object instance)
63 var other = instance as Efl.Object;
68 return this.NativeHandle == other.NativeHandle;
71 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
72 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
73 public override int GetHashCode()
75 return this.NativeHandle.ToInt32();
78 /// <summary>Turns the native pointer into a string representation.</summary>
79 /// <returns>A string with the type and the native pointer for this object.</returns>
80 public override String ToString()
82 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
85 /// <summary>Sent after the content is set or unset using the current content object.
86 /// (Since EFL 1.22)</summary>
87 public event EventHandler<Efl.IContentContentChangedEvt_Args> ContentChangedEvt
93 var wRef = new WeakReference(this);
94 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
96 var obj = wRef.Target as Efl.Eo.IWrapper;
99 Efl.IContentContentChangedEvt_Args args = new Efl.IContentContentChangedEvt_Args();
100 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
103 value?.Invoke(obj, args);
107 Eina.Log.Error(e.ToString());
108 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
113 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
114 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
122 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
123 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
127 ///<summary>Method to raise event ContentChangedEvt.</summary>
128 public void OnContentChangedEvt(Efl.IContentContentChangedEvt_Args e)
130 var key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
131 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
132 if (desc == IntPtr.Zero)
134 Eina.Log.Error($"Failed to get native event {key}");
138 IntPtr info = e.arg.NativeHandle;
139 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
141 /// <summary>Sub-object currently set as this object's single content.
142 /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
143 /// (Since EFL 1.22)</summary>
144 /// <returns>The sub-object.</returns>
145 virtual public Efl.Gfx.IEntity GetContent() {
146 var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
147 Eina.Error.RaiseIfUnhandledException();
150 /// <summary>Sub-object currently set as this object's single content.
151 /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
152 /// (Since EFL 1.22)</summary>
153 /// <param name="content">The sub-object.</param>
154 /// <returns><c>true</c> if <c>content</c> was successfully swallowed.</returns>
155 virtual public bool SetContent(Efl.Gfx.IEntity content) {
156 var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),content);
157 Eina.Error.RaiseIfUnhandledException();
160 /// <summary>Remove the sub-object currently set as content of this object and return it. This object becomes empty.
161 /// (Since EFL 1.22)</summary>
162 /// <returns>Unswallowed object</returns>
163 virtual public Efl.Gfx.IEntity UnsetContent() {
164 var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_unset_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
165 Eina.Error.RaiseIfUnhandledException();
168 /// <summary>Retrieves the text string currently being displayed by the given text object.
169 /// Do not free() the return value.
171 /// See also <see cref="Efl.IText.GetText"/>.
172 /// (Since EFL 1.22)</summary>
173 /// <returns>Text string to display on it.</returns>
174 virtual public System.String GetText() {
175 var _ret_var = Efl.ITextConcrete.NativeMethods.efl_text_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
176 Eina.Error.RaiseIfUnhandledException();
179 /// <summary>Sets the text string to be displayed by the given text object.
180 /// See also <see cref="Efl.IText.GetText"/>.
181 /// (Since EFL 1.22)</summary>
182 /// <param name="text">Text string to display on it.</param>
183 virtual public void SetText(System.String text) {
184 Efl.ITextConcrete.NativeMethods.efl_text_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),text);
185 Eina.Error.RaiseIfUnhandledException();
187 /// <summary>Sub-object currently set as this object's single content.
188 /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
189 /// (Since EFL 1.22)</summary>
190 /// <value>The sub-object.</value>
191 public Efl.Gfx.IEntity Content {
192 get { return GetContent(); }
193 set { SetContent(value); }
195 private static IntPtr GetEflClassStatic()
197 return Efl.Ui.TextAlertPopupPart.efl_ui_text_alert_popup_part_class_get();
199 /// <summary>Wrapper for native methods and virtual method delegates.
200 /// For internal use by generated code only.</summary>
201 public new class NativeMethods : Efl.Ui.LayoutPart.NativeMethods
203 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
204 /// <summary>Gets the list of Eo operations to override.</summary>
205 /// <returns>The list of Eo operations to be overload.</returns>
206 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
208 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
209 var methods = Efl.Eo.Globals.GetUserMethods(type);
211 if (efl_content_get_static_delegate == null)
213 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
216 if (methods.FirstOrDefault(m => m.Name == "GetContent") != null)
218 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)
223 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
226 if (methods.FirstOrDefault(m => m.Name == "SetContent") != null)
228 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) });
231 if (efl_content_unset_static_delegate == null)
233 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
236 if (methods.FirstOrDefault(m => m.Name == "UnsetContent") != null)
238 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) });
241 if (efl_text_get_static_delegate == null)
243 efl_text_get_static_delegate = new efl_text_get_delegate(text_get);
246 if (methods.FirstOrDefault(m => m.Name == "GetText") != null)
248 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) });
251 if (efl_text_set_static_delegate == null)
253 efl_text_set_static_delegate = new efl_text_set_delegate(text_set);
256 if (methods.FirstOrDefault(m => m.Name == "SetText") != null)
258 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) });
261 descs.AddRange(base.GetEoOps(type));
264 /// <summary>Returns the Eo class for the native methods of this class.</summary>
265 /// <returns>The native class pointer.</returns>
266 public override IntPtr GetEflClass()
268 return Efl.Ui.TextAlertPopupPart.efl_ui_text_alert_popup_part_class_get();
271 #pragma warning disable CA1707, SA1300, SA1600
273 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
274 private delegate Efl.Gfx.IEntity efl_content_get_delegate(System.IntPtr obj, System.IntPtr pd);
276 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
277 public delegate Efl.Gfx.IEntity efl_content_get_api_delegate(System.IntPtr obj);
279 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");
281 private static Efl.Gfx.IEntity content_get(System.IntPtr obj, System.IntPtr pd)
283 Eina.Log.Debug("function efl_content_get was called");
284 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
287 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
290 _ret_var = ((TextAlertPopupPart)wrapper).GetContent();
294 Eina.Log.Warning($"Callback error: {e.ToString()}");
295 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
303 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
307 private static efl_content_get_delegate efl_content_get_static_delegate;
309 [return: MarshalAs(UnmanagedType.U1)]
310 private delegate bool efl_content_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity content);
312 [return: MarshalAs(UnmanagedType.U1)]
313 public delegate bool efl_content_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity content);
315 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");
317 private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity content)
319 Eina.Log.Debug("function efl_content_set was called");
320 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
323 bool _ret_var = default(bool);
326 _ret_var = ((TextAlertPopupPart)wrapper).SetContent(content);
330 Eina.Log.Warning($"Callback error: {e.ToString()}");
331 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
339 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
343 private static efl_content_set_delegate efl_content_set_static_delegate;
345 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
346 private delegate Efl.Gfx.IEntity efl_content_unset_delegate(System.IntPtr obj, System.IntPtr pd);
348 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
349 public delegate Efl.Gfx.IEntity efl_content_unset_api_delegate(System.IntPtr obj);
351 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");
353 private static Efl.Gfx.IEntity content_unset(System.IntPtr obj, System.IntPtr pd)
355 Eina.Log.Debug("function efl_content_unset was called");
356 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
359 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
362 _ret_var = ((TextAlertPopupPart)wrapper).UnsetContent();
366 Eina.Log.Warning($"Callback error: {e.ToString()}");
367 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
375 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
379 private static efl_content_unset_delegate efl_content_unset_static_delegate;
381 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
382 private delegate System.String efl_text_get_delegate(System.IntPtr obj, System.IntPtr pd);
384 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
385 public delegate System.String efl_text_get_api_delegate(System.IntPtr obj);
387 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");
389 private static System.String text_get(System.IntPtr obj, System.IntPtr pd)
391 Eina.Log.Debug("function efl_text_get was called");
392 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
395 System.String _ret_var = default(System.String);
398 _ret_var = ((TextAlertPopupPart)wrapper).GetText();
402 Eina.Log.Warning($"Callback error: {e.ToString()}");
403 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
411 return efl_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
415 private static efl_text_get_delegate efl_text_get_static_delegate;
418 private delegate void efl_text_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
421 public delegate void efl_text_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
423 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");
425 private static void text_set(System.IntPtr obj, System.IntPtr pd, System.String text)
427 Eina.Log.Debug("function efl_text_set was called");
428 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
434 ((TextAlertPopupPart)wrapper).SetText(text);
438 Eina.Log.Warning($"Callback error: {e.ToString()}");
439 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
446 efl_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text);
450 private static efl_text_set_delegate efl_text_set_static_delegate;
452 #pragma warning restore CA1707, SA1300, SA1600