CheckBox.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // CheckBox.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. /// %UI element that can be toggled between unchecked and checked state.
  21. /// </summary>
  22. public unsafe partial class CheckBox : BorderImage
  23. {
  24. unsafe partial void OnCheckBoxCreated ();
  25. [Preserve]
  26. public CheckBox (IntPtr handle) : base (handle)
  27. {
  28. OnCheckBoxCreated ();
  29. }
  30. [Preserve]
  31. protected CheckBox (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnCheckBoxCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int CheckBox_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (CheckBox_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr CheckBox_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (CheckBox_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int CheckBox_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(CheckBox));
  54. return new StringHash (CheckBox_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr CheckBox_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(CheckBox));
  61. return Marshal.PtrToStringAnsi (CheckBox_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public CheckBox () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr CheckBox_CheckBox (IntPtr context);
  69. [Preserve]
  70. public CheckBox (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(CheckBox));
  73. handle = CheckBox_CheckBox ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnCheckBoxCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void CheckBox_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(CheckBox));
  85. CheckBox_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void CheckBox_OnClickBegin (IntPtr handle, ref Urho.IntVector2 position, ref Urho.IntVector2 screenPosition, int button, int buttons, int qualifiers, IntPtr cursor);
  89. /// <summary>
  90. /// React to mouse click begin.
  91. /// </summary>
  92. public override void OnClickBegin (Urho.IntVector2 position, Urho.IntVector2 screenPosition, int button, int buttons, int qualifiers, Cursor cursor)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. CheckBox_OnClickBegin (handle, ref position, ref screenPosition, button, buttons, qualifiers, (object)cursor == null ? IntPtr.Zero : cursor.Handle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void CheckBox_OnKey (IntPtr handle, int key, int buttons, int qualifiers);
  99. /// <summary>
  100. /// React to a key press.
  101. /// </summary>
  102. public override void OnKey (int key, int buttons, int qualifiers)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. CheckBox_OnKey (handle, key, buttons, qualifiers);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void CheckBox_SetChecked (IntPtr handle, bool enable);
  109. /// <summary>
  110. /// Set checked state.
  111. /// </summary>
  112. private void SetChecked (bool enable)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. CheckBox_SetChecked (handle, enable);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void CheckBox_SetCheckedOffset (IntPtr handle, ref Urho.IntVector2 rect);
  119. /// <summary>
  120. /// Set checked image offset.
  121. /// </summary>
  122. private void SetCheckedOffset (Urho.IntVector2 rect)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. CheckBox_SetCheckedOffset (handle, ref rect);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern void CheckBox_SetCheckedOffset0 (IntPtr handle, int x, int y);
  129. /// <summary>
  130. /// Set checked image offset.
  131. /// </summary>
  132. public void SetCheckedOffset (int x, int y)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. CheckBox_SetCheckedOffset0 (handle, x, y);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern bool CheckBox_IsChecked (IntPtr handle);
  139. /// <summary>
  140. /// Return whether is checked.
  141. /// </summary>
  142. private bool IsChecked ()
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. return CheckBox_IsChecked (handle);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern Urho.IntVector2 CheckBox_GetCheckedOffset (IntPtr handle);
  149. /// <summary>
  150. /// Return checked image offset.
  151. /// </summary>
  152. private Urho.IntVector2 GetCheckedOffset ()
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. return CheckBox_GetCheckedOffset (handle);
  156. }
  157. public override StringHash Type {
  158. get {
  159. return UrhoGetType ();
  160. }
  161. }
  162. public override string TypeName {
  163. get {
  164. return GetTypeName ();
  165. }
  166. }
  167. [Preserve]
  168. public new static StringHash TypeStatic {
  169. get {
  170. return GetTypeStatic ();
  171. }
  172. }
  173. public new static string TypeNameStatic {
  174. get {
  175. return GetTypeNameStatic ();
  176. }
  177. }
  178. /// <summary>
  179. /// Return whether is checked.
  180. /// Or
  181. /// Set checked state.
  182. /// </summary>
  183. public bool Checked {
  184. get {
  185. return IsChecked ();
  186. }
  187. set {
  188. SetChecked (value);
  189. }
  190. }
  191. /// <summary>
  192. /// Return checked image offset.
  193. /// Or
  194. /// Set checked image offset.
  195. /// </summary>
  196. public Urho.IntVector2 CheckedOffset {
  197. get {
  198. return GetCheckedOffset ();
  199. }
  200. set {
  201. SetCheckedOffset (value);
  202. }
  203. }
  204. }
  205. }