LineEdit.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // LineEdit.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. /// Single-line text editor %UI element.
  21. /// </summary>
  22. public unsafe partial class LineEdit : BorderImage
  23. {
  24. unsafe partial void OnLineEditCreated ();
  25. [Preserve]
  26. public LineEdit (IntPtr handle) : base (handle)
  27. {
  28. OnLineEditCreated ();
  29. }
  30. [Preserve]
  31. protected LineEdit (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnLineEditCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int LineEdit_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (LineEdit_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr LineEdit_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (LineEdit_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int LineEdit_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(LineEdit));
  54. return new StringHash (LineEdit_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr LineEdit_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(LineEdit));
  61. return Marshal.PtrToStringAnsi (LineEdit_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public LineEdit () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr LineEdit_LineEdit (IntPtr context);
  69. [Preserve]
  70. public LineEdit (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(LineEdit));
  73. handle = LineEdit_LineEdit ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnLineEditCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void LineEdit_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(LineEdit));
  85. LineEdit_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void LineEdit_ApplyAttributes (IntPtr handle);
  89. /// <summary>
  90. /// Apply attribute changes that can not be applied immediately.
  91. /// </summary>
  92. public override void ApplyAttributes ()
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. LineEdit_ApplyAttributes (handle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void LineEdit_Update (IntPtr handle, float timeStep);
  99. /// <summary>
  100. /// Perform UI element update.
  101. /// </summary>
  102. public override void Update (float timeStep)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. LineEdit_Update (handle, timeStep);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void LineEdit_OnClickBegin (IntPtr handle, ref Urho.IntVector2 position, ref Urho.IntVector2 screenPosition, int button, int buttons, int qualifiers, IntPtr cursor);
  109. /// <summary>
  110. /// React to mouse click begin.
  111. /// </summary>
  112. public override void OnClickBegin (Urho.IntVector2 position, Urho.IntVector2 screenPosition, int button, int buttons, int qualifiers, Cursor cursor)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. LineEdit_OnClickBegin (handle, ref position, ref screenPosition, button, buttons, qualifiers, (object)cursor == null ? IntPtr.Zero : cursor.Handle);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void LineEdit_OnDoubleClick (IntPtr handle, ref Urho.IntVector2 position, ref Urho.IntVector2 screenPosition, int button, int buttons, int qualifiers, IntPtr cursor);
  119. /// <summary>
  120. /// React to mouse doubleclick.
  121. /// </summary>
  122. public override void OnDoubleClick (Urho.IntVector2 position, Urho.IntVector2 screenPosition, int button, int buttons, int qualifiers, Cursor cursor)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. LineEdit_OnDoubleClick (handle, ref position, ref screenPosition, button, buttons, qualifiers, (object)cursor == null ? IntPtr.Zero : cursor.Handle);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern void LineEdit_OnKey (IntPtr handle, int key, int buttons, int qualifiers);
  129. /// <summary>
  130. /// React to a key press.
  131. /// </summary>
  132. public override void OnKey (int key, int buttons, int qualifiers)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. LineEdit_OnKey (handle, key, buttons, qualifiers);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void LineEdit_OnTextInput (IntPtr handle, string text);
  139. /// <summary>
  140. /// React to text input event.
  141. /// </summary>
  142. public override void OnTextInput (string text)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. LineEdit_OnTextInput (handle, text);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void LineEdit_SetText (IntPtr handle, string text);
  149. /// <summary>
  150. /// Set text.
  151. /// </summary>
  152. private void SetText (string text)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. LineEdit_SetText (handle, text);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern void LineEdit_SetCursorPosition (IntPtr handle, uint position);
  159. /// <summary>
  160. /// Set cursor position.
  161. /// </summary>
  162. private void SetCursorPosition (uint position)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. LineEdit_SetCursorPosition (handle, position);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void LineEdit_SetCursorBlinkRate (IntPtr handle, float rate);
  169. /// <summary>
  170. /// Set cursor blink rate. 0 disables blinking.
  171. /// </summary>
  172. private void SetCursorBlinkRate (float rate)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. LineEdit_SetCursorBlinkRate (handle, rate);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void LineEdit_SetMaxLength (IntPtr handle, uint length);
  179. /// <summary>
  180. /// Set maximum text length. 0 for unlimited.
  181. /// </summary>
  182. private void SetMaxLength (uint length)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. LineEdit_SetMaxLength (handle, length);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern void LineEdit_SetEchoCharacter (IntPtr handle, uint c);
  189. /// <summary>
  190. /// Set echo character for password entry and such. 0 (default) shows the actual text.
  191. /// </summary>
  192. private void SetEchoCharacter (uint c)
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. LineEdit_SetEchoCharacter (handle, c);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern void LineEdit_SetCursorMovable (IntPtr handle, bool enable);
  199. /// <summary>
  200. /// Set whether can move cursor with arrows or mouse, default true.
  201. /// </summary>
  202. private void SetCursorMovable (bool enable)
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. LineEdit_SetCursorMovable (handle, enable);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern void LineEdit_SetTextSelectable (IntPtr handle, bool enable);
  209. /// <summary>
  210. /// Set whether selections are allowed, default true.
  211. /// </summary>
  212. private void SetTextSelectable (bool enable)
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. LineEdit_SetTextSelectable (handle, enable);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern void LineEdit_SetTextCopyable (IntPtr handle, bool enable);
  219. /// <summary>
  220. /// Set whether copy-paste operations are allowed, default true.
  221. /// </summary>
  222. private void SetTextCopyable (bool enable)
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. LineEdit_SetTextCopyable (handle, enable);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern IntPtr LineEdit_GetText (IntPtr handle);
  229. /// <summary>
  230. /// Return text.
  231. /// </summary>
  232. private string GetText ()
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. return Marshal.PtrToStringAnsi (LineEdit_GetText (handle));
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern uint LineEdit_GetCursorPosition (IntPtr handle);
  239. /// <summary>
  240. /// Return cursor position.
  241. /// </summary>
  242. private uint GetCursorPosition ()
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. return LineEdit_GetCursorPosition (handle);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern float LineEdit_GetCursorBlinkRate (IntPtr handle);
  249. /// <summary>
  250. /// Return cursor blink rate.
  251. /// </summary>
  252. private float GetCursorBlinkRate ()
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. return LineEdit_GetCursorBlinkRate (handle);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern uint LineEdit_GetMaxLength (IntPtr handle);
  259. /// <summary>
  260. /// Return maximum text length.
  261. /// </summary>
  262. private uint GetMaxLength ()
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. return LineEdit_GetMaxLength (handle);
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern uint LineEdit_GetEchoCharacter (IntPtr handle);
  269. /// <summary>
  270. /// Return echo character.
  271. /// </summary>
  272. private uint GetEchoCharacter ()
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. return LineEdit_GetEchoCharacter (handle);
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern bool LineEdit_IsCursorMovable (IntPtr handle);
  279. /// <summary>
  280. /// Return whether can move cursor with arrows or mouse.
  281. /// </summary>
  282. private bool IsCursorMovable ()
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. return LineEdit_IsCursorMovable (handle);
  286. }
  287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  288. internal static extern bool LineEdit_IsTextSelectable (IntPtr handle);
  289. /// <summary>
  290. /// Return whether selections are allowed.
  291. /// </summary>
  292. private bool IsTextSelectable ()
  293. {
  294. Runtime.ValidateRefCounted (this);
  295. return LineEdit_IsTextSelectable (handle);
  296. }
  297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  298. internal static extern bool LineEdit_IsTextCopyable (IntPtr handle);
  299. /// <summary>
  300. /// Return whether copy-paste operations are allowed.
  301. /// </summary>
  302. private bool IsTextCopyable ()
  303. {
  304. Runtime.ValidateRefCounted (this);
  305. return LineEdit_IsTextCopyable (handle);
  306. }
  307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  308. internal static extern IntPtr LineEdit_GetTextElement (IntPtr handle);
  309. /// <summary>
  310. /// Return text element.
  311. /// </summary>
  312. private Text GetTextElement ()
  313. {
  314. Runtime.ValidateRefCounted (this);
  315. return Runtime.LookupObject<Text> (LineEdit_GetTextElement (handle));
  316. }
  317. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  318. internal static extern IntPtr LineEdit_GetCursor (IntPtr handle);
  319. /// <summary>
  320. /// Return cursor element.
  321. /// </summary>
  322. private BorderImage GetCursor ()
  323. {
  324. Runtime.ValidateRefCounted (this);
  325. return Runtime.LookupObject<BorderImage> (LineEdit_GetCursor (handle));
  326. }
  327. public override StringHash Type {
  328. get {
  329. return UrhoGetType ();
  330. }
  331. }
  332. public override string TypeName {
  333. get {
  334. return GetTypeName ();
  335. }
  336. }
  337. [Preserve]
  338. public new static StringHash TypeStatic {
  339. get {
  340. return GetTypeStatic ();
  341. }
  342. }
  343. public new static string TypeNameStatic {
  344. get {
  345. return GetTypeNameStatic ();
  346. }
  347. }
  348. /// <summary>
  349. /// Return text.
  350. /// Or
  351. /// Set text.
  352. /// </summary>
  353. public string Text {
  354. get {
  355. return GetText ();
  356. }
  357. set {
  358. SetText (value);
  359. }
  360. }
  361. /// <summary>
  362. /// Return cursor position.
  363. /// Or
  364. /// Set cursor position.
  365. /// </summary>
  366. public uint CursorPosition {
  367. get {
  368. return GetCursorPosition ();
  369. }
  370. set {
  371. SetCursorPosition (value);
  372. }
  373. }
  374. /// <summary>
  375. /// Return cursor blink rate.
  376. /// Or
  377. /// Set cursor blink rate. 0 disables blinking.
  378. /// </summary>
  379. public float CursorBlinkRate {
  380. get {
  381. return GetCursorBlinkRate ();
  382. }
  383. set {
  384. SetCursorBlinkRate (value);
  385. }
  386. }
  387. /// <summary>
  388. /// Return maximum text length.
  389. /// Or
  390. /// Set maximum text length. 0 for unlimited.
  391. /// </summary>
  392. public uint MaxLength {
  393. get {
  394. return GetMaxLength ();
  395. }
  396. set {
  397. SetMaxLength (value);
  398. }
  399. }
  400. /// <summary>
  401. /// Return echo character.
  402. /// Or
  403. /// Set echo character for password entry and such. 0 (default) shows the actual text.
  404. /// </summary>
  405. public uint EchoCharacter {
  406. get {
  407. return GetEchoCharacter ();
  408. }
  409. set {
  410. SetEchoCharacter (value);
  411. }
  412. }
  413. /// <summary>
  414. /// Return whether can move cursor with arrows or mouse.
  415. /// Or
  416. /// Set whether can move cursor with arrows or mouse, default true.
  417. /// </summary>
  418. public bool CursorMovable {
  419. get {
  420. return IsCursorMovable ();
  421. }
  422. set {
  423. SetCursorMovable (value);
  424. }
  425. }
  426. /// <summary>
  427. /// Return whether selections are allowed.
  428. /// Or
  429. /// Set whether selections are allowed, default true.
  430. /// </summary>
  431. public bool TextSelectable {
  432. get {
  433. return IsTextSelectable ();
  434. }
  435. set {
  436. SetTextSelectable (value);
  437. }
  438. }
  439. /// <summary>
  440. /// Return whether copy-paste operations are allowed.
  441. /// Or
  442. /// Set whether copy-paste operations are allowed, default true.
  443. /// </summary>
  444. public bool TextCopyable {
  445. get {
  446. return IsTextCopyable ();
  447. }
  448. set {
  449. SetTextCopyable (value);
  450. }
  451. }
  452. /// <summary>
  453. /// Return text element.
  454. /// </summary>
  455. public Text TextElement {
  456. get {
  457. return GetTextElement ();
  458. }
  459. }
  460. /// <summary>
  461. /// Return cursor element.
  462. /// </summary>
  463. public BorderImage Cursor {
  464. get {
  465. return GetCursor ();
  466. }
  467. }
  468. }
  469. }