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>Navigation_Bar widget.
9 /// Navigation_Bar widget provides a bar form useful for navigation. Navigation_Bar has a back button which is used to navigate to the previous content in the stack.</summary>
10 [NavigationBarNativeInherit]
11 public class NavigationBar : Efl.Ui.LayoutBase, Efl.Eo.IWrapper,Efl.IContent,Efl.IText
13 ///<summary>Pointer to the native class description.</summary>
14 public override System.IntPtr NativeClass {
16 if (((object)this).GetType() == typeof (NavigationBar))
17 return Efl.Ui.NavigationBarNativeInherit.GetEflClassStatic();
19 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
22 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
23 efl_ui_navigation_bar_class_get();
24 ///<summary>Creates a new instance.</summary>
25 ///<param name="parent">Parent instance.</param>
26 ///<param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle"/></param>
27 public NavigationBar(Efl.Object parent
28 , System.String style = null) :
29 base(efl_ui_navigation_bar_class_get(), typeof(NavigationBar), parent)
31 if (Efl.Eo.Globals.ParamHelperCheck(style))
32 SetStyle(Efl.Eo.Globals.GetParamHelper(style));
33 FinishInstantiation();
35 ///<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>
36 protected NavigationBar(System.IntPtr raw) : base(raw)
38 RegisterEventProxies();
40 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
41 protected NavigationBar(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
42 ///<summary>Verifies if the given object is equal to this one.</summary>
43 public override bool Equals(object obj)
45 var other = obj as Efl.Object;
48 return this.NativeHandle == other.NativeHandle;
50 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
51 public override int GetHashCode()
53 return this.NativeHandle.ToInt32();
55 ///<summary>Turns the native pointer into a string representation.</summary>
56 public override String ToString()
58 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
60 private static object ContentChangedEvtKey = new object();
61 /// <summary>Sent after the content is set or unset using the current content object.
62 /// (Since EFL 1.22)</summary>
63 public event EventHandler<Efl.IContentContentChangedEvt_Args> ContentChangedEvt
67 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
68 if (AddNativeEventHandler(efl.Libs.Efl, key, this.evt_ContentChangedEvt_delegate)) {
69 eventHandlers.AddHandler(ContentChangedEvtKey , value);
71 Eina.Log.Error($"Error adding proxy for event {key}");
76 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
77 if (RemoveNativeEventHandler(key, this.evt_ContentChangedEvt_delegate)) {
78 eventHandlers.RemoveHandler(ContentChangedEvtKey , value);
80 Eina.Log.Error($"Error removing proxy for event {key}");
84 ///<summary>Method to raise event ContentChangedEvt.</summary>
85 public void On_ContentChangedEvt(Efl.IContentContentChangedEvt_Args e)
87 EventHandler<Efl.IContentContentChangedEvt_Args> evt;
89 evt = (EventHandler<Efl.IContentContentChangedEvt_Args>)eventHandlers[ContentChangedEvtKey];
93 Efl.EventCb evt_ContentChangedEvt_delegate;
94 private void on_ContentChangedEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
96 Efl.IContentContentChangedEvt_Args args = new Efl.IContentContentChangedEvt_Args();
97 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
99 On_ContentChangedEvt(args);
100 } catch (Exception e) {
101 Eina.Log.Error(e.ToString());
102 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
106 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
107 protected override void RegisterEventProxies()
109 base.RegisterEventProxies();
110 evt_ContentChangedEvt_delegate = new Efl.EventCb(on_ContentChangedEvt_NativeCallback);
112 /// <summary>Back button to navigate to the previous content in the stack.
113 /// The back button works only if the Navigation_Bar widget is contained in the Stack widget(Efl.Ui.Stack class). e.g. The Navigation_Bar widget is set in the Navigation_Layout widget and the Navigation_Layout widget is pushed to the Stack widget.
115 /// The back button is hidden by default and it can be visible. e.g. efl_gfx_entity_visible_set(efl_part(navigation_bar, "back_button"), EINA_TRUE);</summary>
116 public Efl.Ui.NavigationBarPartBackButton BackButton
120 return Efl.IPartNativeInherit.efl_part_get_ptr.Value.Delegate(NativeHandle, "back_button") as Efl.Ui.NavigationBarPartBackButton;
123 /// <summary>Swallowed sub-object contained in this object.
124 /// (Since EFL 1.22)</summary>
125 /// <returns>The object to swallow.</returns>
126 virtual public Efl.Gfx.IEntity GetContent() {
127 var _ret_var = Efl.IContentNativeInherit.efl_content_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
128 Eina.Error.RaiseIfUnhandledException();
131 /// <summary>Swallowed sub-object contained in this object.
132 /// (Since EFL 1.22)</summary>
133 /// <param name="content">The object to swallow.</param>
134 /// <returns><c>true</c> on success, <c>false</c> otherwise</returns>
135 virtual public bool SetContent( Efl.Gfx.IEntity content) {
136 var _ret_var = Efl.IContentNativeInherit.efl_content_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), content);
137 Eina.Error.RaiseIfUnhandledException();
140 /// <summary>Unswallow the object in the current container and return it.
141 /// (Since EFL 1.22)</summary>
142 /// <returns>Unswallowed object</returns>
143 virtual public Efl.Gfx.IEntity UnsetContent() {
144 var _ret_var = Efl.IContentNativeInherit.efl_content_unset_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
145 Eina.Error.RaiseIfUnhandledException();
148 /// <summary>Retrieves the text string currently being displayed by the given text object.
149 /// Do not free() the return value.
151 /// See also <see cref="Efl.IText.GetText"/>.
152 /// (Since EFL 1.22)</summary>
153 /// <returns>Text string to display on it.</returns>
154 virtual public System.String GetText() {
155 var _ret_var = Efl.ITextNativeInherit.efl_text_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
156 Eina.Error.RaiseIfUnhandledException();
159 /// <summary>Sets the text string to be displayed by the given text object.
160 /// See also <see cref="Efl.IText.GetText"/>.
161 /// (Since EFL 1.22)</summary>
162 /// <param name="text">Text string to display on it.</param>
163 /// <returns></returns>
164 virtual public void SetText( System.String text) {
165 Efl.ITextNativeInherit.efl_text_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), text);
166 Eina.Error.RaiseIfUnhandledException();
168 /// <summary>Swallowed sub-object contained in this object.
169 /// (Since EFL 1.22)</summary>
170 /// <value>The object to swallow.</value>
171 public Efl.Gfx.IEntity Content {
172 get { return GetContent(); }
173 set { SetContent( value); }
175 private static IntPtr GetEflClassStatic()
177 return Efl.Ui.NavigationBar.efl_ui_navigation_bar_class_get();
180 public class NavigationBarNativeInherit : Efl.Ui.LayoutBaseNativeInherit{
181 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
182 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
184 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
185 var methods = Efl.Eo.Globals.GetUserMethods(type);
186 if (efl_content_get_static_delegate == null)
187 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
188 if (methods.FirstOrDefault(m => m.Name == "GetContent") != null)
189 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)});
190 if (efl_content_set_static_delegate == null)
191 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
192 if (methods.FirstOrDefault(m => m.Name == "SetContent") != null)
193 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)});
194 if (efl_content_unset_static_delegate == null)
195 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
196 if (methods.FirstOrDefault(m => m.Name == "UnsetContent") != null)
197 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)});
198 if (efl_text_get_static_delegate == null)
199 efl_text_get_static_delegate = new efl_text_get_delegate(text_get);
200 if (methods.FirstOrDefault(m => m.Name == "GetText") != null)
201 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)});
202 if (efl_text_set_static_delegate == null)
203 efl_text_set_static_delegate = new efl_text_set_delegate(text_set);
204 if (methods.FirstOrDefault(m => m.Name == "SetText") != null)
205 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)});
206 descs.AddRange(base.GetEoOps(type));
209 public override IntPtr GetEflClass()
211 return Efl.Ui.NavigationBar.efl_ui_navigation_bar_class_get();
213 public static new IntPtr GetEflClassStatic()
215 return Efl.Ui.NavigationBar.efl_ui_navigation_bar_class_get();
219 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))] private delegate Efl.Gfx.IEntity efl_content_get_delegate(System.IntPtr obj, System.IntPtr pd);
222 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))] public delegate Efl.Gfx.IEntity efl_content_get_api_delegate(System.IntPtr obj);
223 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");
224 private static Efl.Gfx.IEntity content_get(System.IntPtr obj, System.IntPtr pd)
226 Eina.Log.Debug("function efl_content_get was called");
227 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
228 if(wrapper != null) {
229 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
231 _ret_var = ((NavigationBar)wrapper).GetContent();
232 } catch (Exception e) {
233 Eina.Log.Warning($"Callback error: {e.ToString()}");
234 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
238 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
241 private static efl_content_get_delegate efl_content_get_static_delegate;
244 [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.IEntityConcrete, Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity content);
247 [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.IEntityConcrete, Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity content);
248 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");
249 private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity content)
251 Eina.Log.Debug("function efl_content_set was called");
252 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
253 if(wrapper != null) {
254 bool _ret_var = default(bool);
256 _ret_var = ((NavigationBar)wrapper).SetContent( content);
257 } catch (Exception e) {
258 Eina.Log.Warning($"Callback error: {e.ToString()}");
259 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
263 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
266 private static efl_content_set_delegate efl_content_set_static_delegate;
269 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))] private delegate Efl.Gfx.IEntity efl_content_unset_delegate(System.IntPtr obj, System.IntPtr pd);
272 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Gfx.IEntityConcrete, Efl.Eo.NonOwnTag>))] public delegate Efl.Gfx.IEntity efl_content_unset_api_delegate(System.IntPtr obj);
273 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");
274 private static Efl.Gfx.IEntity content_unset(System.IntPtr obj, System.IntPtr pd)
276 Eina.Log.Debug("function efl_content_unset was called");
277 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
278 if(wrapper != null) {
279 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
281 _ret_var = ((NavigationBar)wrapper).UnsetContent();
282 } catch (Exception e) {
283 Eina.Log.Warning($"Callback error: {e.ToString()}");
284 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
288 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
291 private static efl_content_unset_delegate efl_content_unset_static_delegate;
294 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] private delegate System.String efl_text_get_delegate(System.IntPtr obj, System.IntPtr pd);
297 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] public delegate System.String efl_text_get_api_delegate(System.IntPtr obj);
298 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");
299 private static System.String text_get(System.IntPtr obj, System.IntPtr pd)
301 Eina.Log.Debug("function efl_text_get was called");
302 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
303 if(wrapper != null) {
304 System.String _ret_var = default(System.String);
306 _ret_var = ((NavigationBar)wrapper).GetText();
307 } catch (Exception e) {
308 Eina.Log.Warning($"Callback error: {e.ToString()}");
309 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
313 return efl_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
316 private static efl_text_get_delegate efl_text_get_static_delegate;
319 private delegate void efl_text_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
322 public delegate void efl_text_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
323 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");
324 private static void text_set(System.IntPtr obj, System.IntPtr pd, System.String text)
326 Eina.Log.Debug("function efl_text_set was called");
327 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
328 if(wrapper != null) {
331 ((NavigationBar)wrapper).SetText( text);
332 } catch (Exception e) {
333 Eina.Log.Warning($"Callback error: {e.ToString()}");
334 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
337 efl_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text);
340 private static efl_text_set_delegate efl_text_set_static_delegate;