MessageBox.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // MessageBox.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Gui
  18. {
  19. /// <summary>
  20. /// Message box dialog. Manages its lifetime automatically, so the application does not need to hold a reference to it, and shouldn't attempt to destroy it manually.
  21. /// </summary>
  22. public unsafe partial class MessageBox : UrhoObject
  23. {
  24. public MessageBox (IntPtr handle) : base (handle)
  25. {
  26. }
  27. protected MessageBox (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  28. {
  29. }
  30. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  31. internal static extern int MessageBox_GetType (IntPtr handle);
  32. private StringHash UrhoGetType ()
  33. {
  34. Runtime.ValidateRefCounted (this);
  35. return new StringHash (MessageBox_GetType (handle));
  36. }
  37. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  38. internal static extern IntPtr MessageBox_GetTypeName (IntPtr handle);
  39. private string GetTypeName ()
  40. {
  41. Runtime.ValidateRefCounted (this);
  42. return Marshal.PtrToStringAnsi (MessageBox_GetTypeName (handle));
  43. }
  44. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  45. internal static extern int MessageBox_GetTypeStatic ();
  46. private static StringHash GetTypeStatic ()
  47. {
  48. Runtime.Validate (typeof(MessageBox));
  49. return new StringHash (MessageBox_GetTypeStatic ());
  50. }
  51. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  52. internal static extern IntPtr MessageBox_GetTypeNameStatic ();
  53. private static string GetTypeNameStatic ()
  54. {
  55. Runtime.Validate (typeof(MessageBox));
  56. return Marshal.PtrToStringAnsi (MessageBox_GetTypeNameStatic ());
  57. }
  58. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  59. internal static extern IntPtr MessageBox_MessageBox (IntPtr context, string messageString, string titleString, IntPtr layoutFile, IntPtr styleFile);
  60. public MessageBox (Context context, string messageString, string titleString, Urho.Resources.XmlFile layoutFile, Urho.Resources.XmlFile styleFile) : base (UrhoObjectFlag.Empty)
  61. {
  62. Runtime.Validate (typeof(MessageBox));
  63. handle = MessageBox_MessageBox ((object)context == null ? IntPtr.Zero : context.Handle, messageString, titleString, (object)layoutFile == null ? IntPtr.Zero : layoutFile.Handle, (object)styleFile == null ? IntPtr.Zero : styleFile.Handle);
  64. Runtime.RegisterObject (this);
  65. }
  66. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  67. internal static extern void MessageBox_RegisterObject (IntPtr context);
  68. /// <summary>
  69. /// Register object factory.
  70. /// </summary>
  71. public static void RegisterObject (Context context)
  72. {
  73. Runtime.Validate (typeof(MessageBox));
  74. MessageBox_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  75. }
  76. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  77. internal static extern void MessageBox_SetTitle (IntPtr handle, string text);
  78. /// <summary>
  79. /// Set title text. No-ops if there is no title text element.
  80. /// </summary>
  81. private void SetTitle (string text)
  82. {
  83. Runtime.ValidateRefCounted (this);
  84. MessageBox_SetTitle (handle, text);
  85. }
  86. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  87. internal static extern void MessageBox_SetMessage (IntPtr handle, string text);
  88. /// <summary>
  89. /// Set message text. No-ops if there is no message text element.
  90. /// </summary>
  91. private void SetMessage (string text)
  92. {
  93. Runtime.ValidateRefCounted (this);
  94. MessageBox_SetMessage (handle, text);
  95. }
  96. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  97. internal static extern IntPtr MessageBox_GetTitle (IntPtr handle);
  98. /// <summary>
  99. /// Return title text. Return empty string if there is no title text element.
  100. /// </summary>
  101. private string GetTitle ()
  102. {
  103. Runtime.ValidateRefCounted (this);
  104. return Marshal.PtrToStringAnsi (MessageBox_GetTitle (handle));
  105. }
  106. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  107. internal static extern IntPtr MessageBox_GetMessage (IntPtr handle);
  108. /// <summary>
  109. /// Return message text. Return empty string if there is no message text element.
  110. /// </summary>
  111. private string GetMessage ()
  112. {
  113. Runtime.ValidateRefCounted (this);
  114. return Marshal.PtrToStringAnsi (MessageBox_GetMessage (handle));
  115. }
  116. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  117. internal static extern IntPtr MessageBox_GetWindow (IntPtr handle);
  118. /// <summary>
  119. /// Return dialog window.
  120. /// </summary>
  121. private UIElement GetWindow ()
  122. {
  123. Runtime.ValidateRefCounted (this);
  124. return Runtime.LookupObject<UIElement> (MessageBox_GetWindow (handle));
  125. }
  126. public override StringHash Type {
  127. get {
  128. return UrhoGetType ();
  129. }
  130. }
  131. public override string TypeName {
  132. get {
  133. return GetTypeName ();
  134. }
  135. }
  136. public static StringHash TypeStatic {
  137. get {
  138. return GetTypeStatic ();
  139. }
  140. }
  141. public static string TypeNameStatic {
  142. get {
  143. return GetTypeNameStatic ();
  144. }
  145. }
  146. /// <summary>
  147. /// Return title text. Return empty string if there is no title text element.
  148. /// Or
  149. /// Set title text. No-ops if there is no title text element.
  150. /// </summary>
  151. public string Title {
  152. get {
  153. return GetTitle ();
  154. }
  155. set {
  156. SetTitle (value);
  157. }
  158. }
  159. /// <summary>
  160. /// Return message text. Return empty string if there is no message text element.
  161. /// Or
  162. /// Set message text. No-ops if there is no message text element.
  163. /// </summary>
  164. public string Message {
  165. get {
  166. return GetMessage ();
  167. }
  168. set {
  169. SetMessage (value);
  170. }
  171. }
  172. /// <summary>
  173. /// Return dialog window.
  174. /// </summary>
  175. public UIElement Window {
  176. get {
  177. return GetWindow ();
  178. }
  179. }
  180. }
  181. }