FileSelector.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // FileSelector.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. /// %File selector dialog.
  21. /// </summary>
  22. public unsafe partial class FileSelector : UrhoObject
  23. {
  24. unsafe partial void OnFileSelectorCreated ();
  25. [Preserve]
  26. public FileSelector (IntPtr handle) : base (handle)
  27. {
  28. OnFileSelectorCreated ();
  29. }
  30. [Preserve]
  31. protected FileSelector (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnFileSelectorCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int FileSelector_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (FileSelector_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr FileSelector_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (FileSelector_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int FileSelector_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(FileSelector));
  54. return new StringHash (FileSelector_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr FileSelector_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(FileSelector));
  61. return Marshal.PtrToStringAnsi (FileSelector_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public FileSelector () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr FileSelector_FileSelector (IntPtr context);
  69. [Preserve]
  70. public FileSelector (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(FileSelector));
  73. handle = FileSelector_FileSelector ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnFileSelectorCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void FileSelector_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(FileSelector));
  85. FileSelector_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void FileSelector_SetDefaultStyle (IntPtr handle, IntPtr style);
  89. /// <summary>
  90. /// Set fileselector UI style.
  91. /// </summary>
  92. private void SetDefaultStyle (Urho.Resources.XmlFile style)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. FileSelector_SetDefaultStyle (handle, (object)style == null ? IntPtr.Zero : style.Handle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void FileSelector_SetTitle (IntPtr handle, string text);
  99. /// <summary>
  100. /// Set title text.
  101. /// </summary>
  102. private void SetTitle (string text)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. FileSelector_SetTitle (handle, text);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void FileSelector_SetButtonTexts (IntPtr handle, string okText, string cancelText);
  109. /// <summary>
  110. /// Set button texts.
  111. /// </summary>
  112. public void SetButtonTexts (string okText, string cancelText)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. FileSelector_SetButtonTexts (handle, okText, cancelText);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void FileSelector_SetPath (IntPtr handle, string path);
  119. /// <summary>
  120. /// Set current path.
  121. /// </summary>
  122. private void SetPath (string path)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. FileSelector_SetPath (handle, path);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern void FileSelector_SetFileName (IntPtr handle, string fileName);
  129. /// <summary>
  130. /// Set current filename.
  131. /// </summary>
  132. private void SetFileName (string fileName)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. FileSelector_SetFileName (handle, fileName);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void FileSelector_SetDirectoryMode (IntPtr handle, bool enable);
  139. /// <summary>
  140. /// Set directory selection mode. Default false.
  141. /// </summary>
  142. private void SetDirectoryMode (bool enable)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. FileSelector_SetDirectoryMode (handle, enable);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void FileSelector_UpdateElements (IntPtr handle);
  149. /// <summary>
  150. /// Update elements to layout properly. Call this after manually adjusting the sub-elements.
  151. /// </summary>
  152. public void UpdateElements ()
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. FileSelector_UpdateElements (handle);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern IntPtr FileSelector_GetDefaultStyle (IntPtr handle);
  159. /// <summary>
  160. /// Return the UI style file.
  161. /// </summary>
  162. private Urho.Resources.XmlFile GetDefaultStyle ()
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. return Runtime.LookupObject<Urho.Resources.XmlFile> (FileSelector_GetDefaultStyle (handle));
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern IntPtr FileSelector_GetWindow (IntPtr handle);
  169. /// <summary>
  170. /// Return fileselector window.
  171. /// </summary>
  172. private Window GetWindow ()
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. return Runtime.LookupObject<Window> (FileSelector_GetWindow (handle));
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern IntPtr FileSelector_GetTitleText (IntPtr handle);
  179. /// <summary>
  180. /// Return window title text element.
  181. /// </summary>
  182. private Text GetTitleText ()
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. return Runtime.LookupObject<Text> (FileSelector_GetTitleText (handle));
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern IntPtr FileSelector_GetFileList (IntPtr handle);
  189. /// <summary>
  190. /// Return file list.
  191. /// </summary>
  192. private ListView GetFileList ()
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. return Runtime.LookupObject<ListView> (FileSelector_GetFileList (handle));
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern IntPtr FileSelector_GetPathEdit (IntPtr handle);
  199. /// <summary>
  200. /// Return path editor.
  201. /// </summary>
  202. private LineEdit GetPathEdit ()
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. return Runtime.LookupObject<LineEdit> (FileSelector_GetPathEdit (handle));
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern IntPtr FileSelector_GetFileNameEdit (IntPtr handle);
  209. /// <summary>
  210. /// Return filename editor.
  211. /// </summary>
  212. private LineEdit GetFileNameEdit ()
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. return Runtime.LookupObject<LineEdit> (FileSelector_GetFileNameEdit (handle));
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern IntPtr FileSelector_GetFilterList (IntPtr handle);
  219. /// <summary>
  220. /// Return filter dropdown.
  221. /// </summary>
  222. private DropDownList GetFilterList ()
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. return Runtime.LookupObject<DropDownList> (FileSelector_GetFilterList (handle));
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern IntPtr FileSelector_GetOKButton (IntPtr handle);
  229. /// <summary>
  230. /// Return OK button.
  231. /// </summary>
  232. private Button GetOKButton ()
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. return Runtime.LookupObject<Button> (FileSelector_GetOKButton (handle));
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern IntPtr FileSelector_GetCancelButton (IntPtr handle);
  239. /// <summary>
  240. /// Return cancel button.
  241. /// </summary>
  242. private Button GetCancelButton ()
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. return Runtime.LookupObject<Button> (FileSelector_GetCancelButton (handle));
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern IntPtr FileSelector_GetCloseButton (IntPtr handle);
  249. /// <summary>
  250. /// Return close button.
  251. /// </summary>
  252. private Button GetCloseButton ()
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. return Runtime.LookupObject<Button> (FileSelector_GetCloseButton (handle));
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern IntPtr FileSelector_GetTitle (IntPtr handle);
  259. /// <summary>
  260. /// Return window title.
  261. /// </summary>
  262. private string GetTitle ()
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. return Marshal.PtrToStringAnsi (FileSelector_GetTitle (handle));
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern IntPtr FileSelector_GetPath (IntPtr handle);
  269. /// <summary>
  270. /// Return current path.
  271. /// </summary>
  272. private string GetPath ()
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. return Marshal.PtrToStringAnsi (FileSelector_GetPath (handle));
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern IntPtr FileSelector_GetFileName (IntPtr handle);
  279. /// <summary>
  280. /// Return current filename.
  281. /// </summary>
  282. private string GetFileName ()
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. return Marshal.PtrToStringAnsi (FileSelector_GetFileName (handle));
  286. }
  287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  288. internal static extern IntPtr FileSelector_GetFilter (IntPtr handle);
  289. /// <summary>
  290. /// Return current filter.
  291. /// </summary>
  292. private string GetFilter ()
  293. {
  294. Runtime.ValidateRefCounted (this);
  295. return Marshal.PtrToStringAnsi (FileSelector_GetFilter (handle));
  296. }
  297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  298. internal static extern uint FileSelector_GetFilterIndex (IntPtr handle);
  299. /// <summary>
  300. /// Return current filter index.
  301. /// </summary>
  302. private uint GetFilterIndex ()
  303. {
  304. Runtime.ValidateRefCounted (this);
  305. return FileSelector_GetFilterIndex (handle);
  306. }
  307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  308. internal static extern bool FileSelector_GetDirectoryMode (IntPtr handle);
  309. /// <summary>
  310. /// Return directory mode flag.
  311. /// </summary>
  312. private bool GetDirectoryMode ()
  313. {
  314. Runtime.ValidateRefCounted (this);
  315. return FileSelector_GetDirectoryMode (handle);
  316. }
  317. public override StringHash Type {
  318. get {
  319. return UrhoGetType ();
  320. }
  321. }
  322. public override string TypeName {
  323. get {
  324. return GetTypeName ();
  325. }
  326. }
  327. [Preserve]
  328. public static StringHash TypeStatic {
  329. get {
  330. return GetTypeStatic ();
  331. }
  332. }
  333. public static string TypeNameStatic {
  334. get {
  335. return GetTypeNameStatic ();
  336. }
  337. }
  338. /// <summary>
  339. /// Return the UI style file.
  340. /// Or
  341. /// Set fileselector UI style.
  342. /// </summary>
  343. public Urho.Resources.XmlFile DefaultStyle {
  344. get {
  345. return GetDefaultStyle ();
  346. }
  347. set {
  348. SetDefaultStyle (value);
  349. }
  350. }
  351. /// <summary>
  352. /// Return window title.
  353. /// Or
  354. /// Set title text.
  355. /// </summary>
  356. public string Title {
  357. get {
  358. return GetTitle ();
  359. }
  360. set {
  361. SetTitle (value);
  362. }
  363. }
  364. /// <summary>
  365. /// Return current path.
  366. /// Or
  367. /// Set current path.
  368. /// </summary>
  369. public string Path {
  370. get {
  371. return GetPath ();
  372. }
  373. set {
  374. SetPath (value);
  375. }
  376. }
  377. /// <summary>
  378. /// Return current filename.
  379. /// Or
  380. /// Set current filename.
  381. /// </summary>
  382. public string FileName {
  383. get {
  384. return GetFileName ();
  385. }
  386. set {
  387. SetFileName (value);
  388. }
  389. }
  390. /// <summary>
  391. /// Return directory mode flag.
  392. /// Or
  393. /// Set directory selection mode. Default false.
  394. /// </summary>
  395. public bool DirectoryMode {
  396. get {
  397. return GetDirectoryMode ();
  398. }
  399. set {
  400. SetDirectoryMode (value);
  401. }
  402. }
  403. /// <summary>
  404. /// Return fileselector window.
  405. /// </summary>
  406. public Window Window {
  407. get {
  408. return GetWindow ();
  409. }
  410. }
  411. /// <summary>
  412. /// Return window title text element.
  413. /// </summary>
  414. public Text TitleText {
  415. get {
  416. return GetTitleText ();
  417. }
  418. }
  419. /// <summary>
  420. /// Return file list.
  421. /// </summary>
  422. public ListView FileList {
  423. get {
  424. return GetFileList ();
  425. }
  426. }
  427. /// <summary>
  428. /// Return path editor.
  429. /// </summary>
  430. public LineEdit PathEdit {
  431. get {
  432. return GetPathEdit ();
  433. }
  434. }
  435. /// <summary>
  436. /// Return filename editor.
  437. /// </summary>
  438. public LineEdit FileNameEdit {
  439. get {
  440. return GetFileNameEdit ();
  441. }
  442. }
  443. /// <summary>
  444. /// Return filter dropdown.
  445. /// </summary>
  446. public DropDownList FilterList {
  447. get {
  448. return GetFilterList ();
  449. }
  450. }
  451. /// <summary>
  452. /// Return OK button.
  453. /// </summary>
  454. public Button OKButton {
  455. get {
  456. return GetOKButton ();
  457. }
  458. }
  459. /// <summary>
  460. /// Return cancel button.
  461. /// </summary>
  462. public Button CancelButton {
  463. get {
  464. return GetCancelButton ();
  465. }
  466. }
  467. /// <summary>
  468. /// Return close button.
  469. /// </summary>
  470. public Button CloseButton {
  471. get {
  472. return GetCloseButton ();
  473. }
  474. }
  475. /// <summary>
  476. /// Return current filter.
  477. /// </summary>
  478. public string Filter {
  479. get {
  480. return GetFilter ();
  481. }
  482. }
  483. /// <summary>
  484. /// Return current filter index.
  485. /// </summary>
  486. public uint FilterIndex {
  487. get {
  488. return GetFilterIndex ();
  489. }
  490. }
  491. }
  492. }