MessageBox.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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. unsafe partial void OnMessageBoxCreated ();
  25. [Preserve]
  26. public MessageBox (IntPtr handle) : base (handle)
  27. {
  28. OnMessageBoxCreated ();
  29. }
  30. [Preserve]
  31. protected MessageBox (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnMessageBoxCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int MessageBox_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (MessageBox_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr MessageBox_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (MessageBox_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int MessageBox_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(MessageBox));
  54. return new StringHash (MessageBox_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr MessageBox_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(MessageBox));
  61. return Marshal.PtrToStringAnsi (MessageBox_GetTypeNameStatic ());
  62. }
  63. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  64. internal static extern IntPtr MessageBox_MessageBox (IntPtr context, string messageString, string titleString, IntPtr layoutFile, IntPtr styleFile);
  65. [Preserve]
  66. public MessageBox (Context context, string messageString = "", string titleString = "", Urho.Resources.XmlFile layoutFile = null, Urho.Resources.XmlFile styleFile = null) : base (UrhoObjectFlag.Empty)
  67. {
  68. Runtime.Validate (typeof(MessageBox));
  69. 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);
  70. Runtime.RegisterObject (this);
  71. OnMessageBoxCreated ();
  72. }
  73. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  74. internal static extern void MessageBox_RegisterObject (IntPtr context);
  75. /// <summary>
  76. /// Register object factory.
  77. /// </summary>
  78. public static void RegisterObject (Context context)
  79. {
  80. Runtime.Validate (typeof(MessageBox));
  81. MessageBox_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  82. }
  83. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  84. internal static extern void MessageBox_SetTitle (IntPtr handle, string text);
  85. /// <summary>
  86. /// Set title text. No-ops if there is no title text element.
  87. /// </summary>
  88. private void SetTitle (string text)
  89. {
  90. Runtime.ValidateRefCounted (this);
  91. MessageBox_SetTitle (handle, text);
  92. }
  93. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  94. internal static extern void MessageBox_SetMessage (IntPtr handle, string text);
  95. /// <summary>
  96. /// Set message text. No-ops if there is no message text element.
  97. /// </summary>
  98. private void SetMessage (string text)
  99. {
  100. Runtime.ValidateRefCounted (this);
  101. MessageBox_SetMessage (handle, text);
  102. }
  103. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  104. internal static extern IntPtr MessageBox_GetTitle (IntPtr handle);
  105. /// <summary>
  106. /// Return title text. Return empty string if there is no title text element.
  107. /// </summary>
  108. private string GetTitle ()
  109. {
  110. Runtime.ValidateRefCounted (this);
  111. return Marshal.PtrToStringAnsi (MessageBox_GetTitle (handle));
  112. }
  113. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  114. internal static extern IntPtr MessageBox_GetMessage (IntPtr handle);
  115. /// <summary>
  116. /// Return message text. Return empty string if there is no message text element.
  117. /// </summary>
  118. private string GetMessage ()
  119. {
  120. Runtime.ValidateRefCounted (this);
  121. return Marshal.PtrToStringAnsi (MessageBox_GetMessage (handle));
  122. }
  123. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  124. internal static extern IntPtr MessageBox_GetWindow (IntPtr handle);
  125. /// <summary>
  126. /// Return dialog window.
  127. /// </summary>
  128. private UIElement GetWindow ()
  129. {
  130. Runtime.ValidateRefCounted (this);
  131. return Runtime.LookupObject<UIElement> (MessageBox_GetWindow (handle));
  132. }
  133. public override StringHash Type {
  134. get {
  135. return UrhoGetType ();
  136. }
  137. }
  138. public override string TypeName {
  139. get {
  140. return GetTypeName ();
  141. }
  142. }
  143. [Preserve]
  144. public static StringHash TypeStatic {
  145. get {
  146. return GetTypeStatic ();
  147. }
  148. }
  149. public static string TypeNameStatic {
  150. get {
  151. return GetTypeNameStatic ();
  152. }
  153. }
  154. /// <summary>
  155. /// Return title text. Return empty string if there is no title text element.
  156. /// Or
  157. /// Set title text. No-ops if there is no title text element.
  158. /// </summary>
  159. public string Title {
  160. get {
  161. return GetTitle ();
  162. }
  163. set {
  164. SetTitle (value);
  165. }
  166. }
  167. /// <summary>
  168. /// Return message text. Return empty string if there is no message text element.
  169. /// Or
  170. /// Set message text. No-ops if there is no message text element.
  171. /// </summary>
  172. public string Message {
  173. get {
  174. return GetMessage ();
  175. }
  176. set {
  177. SetMessage (value);
  178. }
  179. }
  180. /// <summary>
  181. /// Return dialog window.
  182. /// </summary>
  183. public UIElement Window {
  184. get {
  185. return GetWindow ();
  186. }
  187. }
  188. }
  189. }