ScrollView.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // ScrollView.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. /// Scrollable %UI element for showing a (possibly large) child element.
  21. /// </summary>
  22. public unsafe partial class ScrollView : UIElement
  23. {
  24. unsafe partial void OnScrollViewCreated ();
  25. [Preserve]
  26. public ScrollView (IntPtr handle) : base (handle)
  27. {
  28. OnScrollViewCreated ();
  29. }
  30. [Preserve]
  31. protected ScrollView (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnScrollViewCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int ScrollView_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (ScrollView_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr ScrollView_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (ScrollView_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int ScrollView_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(ScrollView));
  54. return new StringHash (ScrollView_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr ScrollView_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(ScrollView));
  61. return Marshal.PtrToStringAnsi (ScrollView_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public ScrollView () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr ScrollView_ScrollView (IntPtr context);
  69. [Preserve]
  70. public ScrollView (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(ScrollView));
  73. handle = ScrollView_ScrollView ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnScrollViewCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void ScrollView_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(ScrollView));
  85. ScrollView_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void ScrollView_Update (IntPtr handle, float timeStep);
  89. /// <summary>
  90. /// Perform UI element update.
  91. /// </summary>
  92. public override void Update (float timeStep)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. ScrollView_Update (handle, timeStep);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void ScrollView_ApplyAttributes (IntPtr handle);
  99. /// <summary>
  100. /// Apply attribute changes that can not be applied immediately.
  101. /// </summary>
  102. public override void ApplyAttributes ()
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. ScrollView_ApplyAttributes (handle);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void ScrollView_OnWheel (IntPtr handle, int delta, int buttons, int qualifiers);
  109. /// <summary>
  110. /// React to mouse wheel.
  111. /// </summary>
  112. public override void OnWheel (int delta, int buttons, int qualifiers)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. ScrollView_OnWheel (handle, delta, buttons, qualifiers);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void ScrollView_OnKey (IntPtr handle, int key, int buttons, int qualifiers);
  119. /// <summary>
  120. /// React to a key press.
  121. /// </summary>
  122. public override void OnKey (int key, int buttons, int qualifiers)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. ScrollView_OnKey (handle, key, buttons, qualifiers);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern void ScrollView_OnResize (IntPtr handle, ref Urho.IntVector2 newSize, ref Urho.IntVector2 delta);
  129. /// <summary>
  130. /// React to resize.
  131. /// </summary>
  132. public override void OnResize (Urho.IntVector2 newSize, Urho.IntVector2 delta)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. ScrollView_OnResize (handle, ref newSize, ref delta);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void ScrollView_SetContentElement (IntPtr handle, IntPtr element);
  139. /// <summary>
  140. /// Set content element.
  141. /// </summary>
  142. private void SetContentElement (UIElement element)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. ScrollView_SetContentElement (handle, (object)element == null ? IntPtr.Zero : element.Handle);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void ScrollView_SetViewPosition (IntPtr handle, ref Urho.IntVector2 position);
  149. /// <summary>
  150. /// Set view offset from the top-left corner.
  151. /// </summary>
  152. private void SetViewPosition (Urho.IntVector2 position)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. ScrollView_SetViewPosition (handle, ref position);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern void ScrollView_SetViewPosition0 (IntPtr handle, int x, int y);
  159. /// <summary>
  160. /// Set view offset from the top-left corner.
  161. /// </summary>
  162. public void SetViewPosition (int x, int y)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. ScrollView_SetViewPosition0 (handle, x, y);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void ScrollView_SetScrollBarsVisible (IntPtr handle, bool horizontal, bool vertical);
  169. /// <summary>
  170. /// Set scrollbars' visibility manually. Disables scrollbar autoshow/hide.
  171. /// </summary>
  172. public void SetScrollBarsVisible (bool horizontal, bool vertical)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. ScrollView_SetScrollBarsVisible (handle, horizontal, vertical);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void ScrollView_SetScrollBarsAutoVisible (IntPtr handle, bool enable);
  179. /// <summary>
  180. /// Set whether to automatically show/hide scrollbars. Default true.
  181. /// </summary>
  182. private void SetScrollBarsAutoVisible (bool enable)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. ScrollView_SetScrollBarsAutoVisible (handle, enable);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern void ScrollView_SetScrollStep (IntPtr handle, float step);
  189. /// <summary>
  190. /// Set arrow key scroll step. Also sets it on the scrollbars.
  191. /// </summary>
  192. private void SetScrollStep (float step)
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. ScrollView_SetScrollStep (handle, step);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern void ScrollView_SetPageStep (IntPtr handle, float step);
  199. /// <summary>
  200. /// Set arrow key page step.
  201. /// </summary>
  202. private void SetPageStep (float step)
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. ScrollView_SetPageStep (handle, step);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern void ScrollView_SetScrollDeceleration (IntPtr handle, float deceleration);
  209. /// <summary>
  210. /// Set scroll deceleration.
  211. /// </summary>
  212. private void SetScrollDeceleration (float deceleration)
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. ScrollView_SetScrollDeceleration (handle, deceleration);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern void ScrollView_SetScrollSnapEpsilon (IntPtr handle, float snap);
  219. /// <summary>
  220. /// Set scroll snap epsilon
  221. /// </summary>
  222. private void SetScrollSnapEpsilon (float snap)
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. ScrollView_SetScrollSnapEpsilon (handle, snap);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern void ScrollView_SetAutoDisableChildren (IntPtr handle, bool disable);
  229. /// <summary>
  230. /// Set whether child elements should be disabled while touch scrolling.
  231. /// </summary>
  232. private void SetAutoDisableChildren (bool disable)
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. ScrollView_SetAutoDisableChildren (handle, disable);
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern void ScrollView_SetAutoDisableThreshold (IntPtr handle, float amount);
  239. /// <summary>
  240. /// Set how much touch movement is needed to trigger child element disabling.
  241. /// </summary>
  242. private void SetAutoDisableThreshold (float amount)
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. ScrollView_SetAutoDisableThreshold (handle, amount);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern Urho.IntVector2 ScrollView_GetViewPosition (IntPtr handle);
  249. /// <summary>
  250. /// Return view offset from the top-left corner.
  251. /// </summary>
  252. private Urho.IntVector2 GetViewPosition ()
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. return ScrollView_GetViewPosition (handle);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern IntPtr ScrollView_GetContentElement (IntPtr handle);
  259. /// <summary>
  260. /// Return content element.
  261. /// </summary>
  262. private UIElement GetContentElement ()
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. return Runtime.LookupObject<UIElement> (ScrollView_GetContentElement (handle));
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern IntPtr ScrollView_GetHorizontalScrollBar (IntPtr handle);
  269. /// <summary>
  270. /// Return horizontal scroll bar.
  271. /// </summary>
  272. private ScrollBar GetHorizontalScrollBar ()
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. return Runtime.LookupObject<ScrollBar> (ScrollView_GetHorizontalScrollBar (handle));
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern IntPtr ScrollView_GetVerticalScrollBar (IntPtr handle);
  279. /// <summary>
  280. /// Return vertical scroll bar.
  281. /// </summary>
  282. private ScrollBar GetVerticalScrollBar ()
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. return Runtime.LookupObject<ScrollBar> (ScrollView_GetVerticalScrollBar (handle));
  286. }
  287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  288. internal static extern IntPtr ScrollView_GetScrollPanel (IntPtr handle);
  289. /// <summary>
  290. /// Return scroll panel.
  291. /// </summary>
  292. private BorderImage GetScrollPanel ()
  293. {
  294. Runtime.ValidateRefCounted (this);
  295. return Runtime.LookupObject<BorderImage> (ScrollView_GetScrollPanel (handle));
  296. }
  297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  298. internal static extern bool ScrollView_GetScrollBarsAutoVisible (IntPtr handle);
  299. /// <summary>
  300. /// Return whether scrollbars are automatically shown/hidden.
  301. /// </summary>
  302. private bool GetScrollBarsAutoVisible ()
  303. {
  304. Runtime.ValidateRefCounted (this);
  305. return ScrollView_GetScrollBarsAutoVisible (handle);
  306. }
  307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  308. internal static extern float ScrollView_GetScrollStep (IntPtr handle);
  309. /// <summary>
  310. /// Return arrow key scroll step.
  311. /// </summary>
  312. private float GetScrollStep ()
  313. {
  314. Runtime.ValidateRefCounted (this);
  315. return ScrollView_GetScrollStep (handle);
  316. }
  317. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  318. internal static extern float ScrollView_GetPageStep (IntPtr handle);
  319. /// <summary>
  320. /// Return arrow key page step.
  321. /// </summary>
  322. private float GetPageStep ()
  323. {
  324. Runtime.ValidateRefCounted (this);
  325. return ScrollView_GetPageStep (handle);
  326. }
  327. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  328. internal static extern float ScrollView_GetScrollDeceleration (IntPtr handle);
  329. /// <summary>
  330. /// Return scroll deceleration.
  331. /// </summary>
  332. private float GetScrollDeceleration ()
  333. {
  334. Runtime.ValidateRefCounted (this);
  335. return ScrollView_GetScrollDeceleration (handle);
  336. }
  337. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  338. internal static extern float ScrollView_GetScrollSnapEpsilon (IntPtr handle);
  339. /// <summary>
  340. /// Return scroll snap epsilon
  341. /// </summary>
  342. private float GetScrollSnapEpsilon ()
  343. {
  344. Runtime.ValidateRefCounted (this);
  345. return ScrollView_GetScrollSnapEpsilon (handle);
  346. }
  347. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  348. internal static extern bool ScrollView_GetAutoDisableChildren (IntPtr handle);
  349. /// <summary>
  350. /// Return whether child element will be disabled while touch scrolling.
  351. /// </summary>
  352. private bool GetAutoDisableChildren ()
  353. {
  354. Runtime.ValidateRefCounted (this);
  355. return ScrollView_GetAutoDisableChildren (handle);
  356. }
  357. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  358. internal static extern float ScrollView_GetAutoDisableThreshold (IntPtr handle);
  359. /// <summary>
  360. /// Return how much touch movement is needed to trigger child element disabling.
  361. /// </summary>
  362. private float GetAutoDisableThreshold ()
  363. {
  364. Runtime.ValidateRefCounted (this);
  365. return ScrollView_GetAutoDisableThreshold (handle);
  366. }
  367. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  368. internal static extern void ScrollView_SetViewPositionAttr (IntPtr handle, ref Urho.IntVector2 value);
  369. /// <summary>
  370. /// Set view position attribute.
  371. /// </summary>
  372. public void SetViewPositionAttr (Urho.IntVector2 value)
  373. {
  374. Runtime.ValidateRefCounted (this);
  375. ScrollView_SetViewPositionAttr (handle, ref value);
  376. }
  377. public override StringHash Type {
  378. get {
  379. return UrhoGetType ();
  380. }
  381. }
  382. public override string TypeName {
  383. get {
  384. return GetTypeName ();
  385. }
  386. }
  387. [Preserve]
  388. public new static StringHash TypeStatic {
  389. get {
  390. return GetTypeStatic ();
  391. }
  392. }
  393. public new static string TypeNameStatic {
  394. get {
  395. return GetTypeNameStatic ();
  396. }
  397. }
  398. /// <summary>
  399. /// Return content element.
  400. /// Or
  401. /// Set content element.
  402. /// </summary>
  403. public UIElement ContentElement {
  404. get {
  405. return GetContentElement ();
  406. }
  407. set {
  408. SetContentElement (value);
  409. }
  410. }
  411. /// <summary>
  412. /// Return view offset from the top-left corner.
  413. /// Or
  414. /// Set view offset from the top-left corner.
  415. /// </summary>
  416. public Urho.IntVector2 ViewPosition {
  417. get {
  418. return GetViewPosition ();
  419. }
  420. set {
  421. SetViewPosition (value);
  422. }
  423. }
  424. /// <summary>
  425. /// Return whether scrollbars are automatically shown/hidden.
  426. /// Or
  427. /// Set whether to automatically show/hide scrollbars. Default true.
  428. /// </summary>
  429. public bool ScrollBarsAutoVisible {
  430. get {
  431. return GetScrollBarsAutoVisible ();
  432. }
  433. set {
  434. SetScrollBarsAutoVisible (value);
  435. }
  436. }
  437. /// <summary>
  438. /// Return arrow key scroll step.
  439. /// Or
  440. /// Set arrow key scroll step. Also sets it on the scrollbars.
  441. /// </summary>
  442. public float ScrollStep {
  443. get {
  444. return GetScrollStep ();
  445. }
  446. set {
  447. SetScrollStep (value);
  448. }
  449. }
  450. /// <summary>
  451. /// Return arrow key page step.
  452. /// Or
  453. /// Set arrow key page step.
  454. /// </summary>
  455. public float PageStep {
  456. get {
  457. return GetPageStep ();
  458. }
  459. set {
  460. SetPageStep (value);
  461. }
  462. }
  463. /// <summary>
  464. /// Return scroll deceleration.
  465. /// Or
  466. /// Set scroll deceleration.
  467. /// </summary>
  468. public float ScrollDeceleration {
  469. get {
  470. return GetScrollDeceleration ();
  471. }
  472. set {
  473. SetScrollDeceleration (value);
  474. }
  475. }
  476. /// <summary>
  477. /// Return scroll snap epsilon
  478. /// Or
  479. /// Set scroll snap epsilon
  480. /// </summary>
  481. public float ScrollSnapEpsilon {
  482. get {
  483. return GetScrollSnapEpsilon ();
  484. }
  485. set {
  486. SetScrollSnapEpsilon (value);
  487. }
  488. }
  489. /// <summary>
  490. /// Return whether child element will be disabled while touch scrolling.
  491. /// Or
  492. /// Set whether child elements should be disabled while touch scrolling.
  493. /// </summary>
  494. public bool AutoDisableChildren {
  495. get {
  496. return GetAutoDisableChildren ();
  497. }
  498. set {
  499. SetAutoDisableChildren (value);
  500. }
  501. }
  502. /// <summary>
  503. /// Return how much touch movement is needed to trigger child element disabling.
  504. /// Or
  505. /// Set how much touch movement is needed to trigger child element disabling.
  506. /// </summary>
  507. public float AutoDisableThreshold {
  508. get {
  509. return GetAutoDisableThreshold ();
  510. }
  511. set {
  512. SetAutoDisableThreshold (value);
  513. }
  514. }
  515. /// <summary>
  516. /// Return horizontal scroll bar.
  517. /// </summary>
  518. public ScrollBar HorizontalScrollBar {
  519. get {
  520. return GetHorizontalScrollBar ();
  521. }
  522. }
  523. /// <summary>
  524. /// Return vertical scroll bar.
  525. /// </summary>
  526. public ScrollBar VerticalScrollBar {
  527. get {
  528. return GetVerticalScrollBar ();
  529. }
  530. }
  531. /// <summary>
  532. /// Return scroll panel.
  533. /// </summary>
  534. public BorderImage ScrollPanel {
  535. get {
  536. return GetScrollPanel ();
  537. }
  538. }
  539. }
  540. }