FileSelector.cs 14 KB

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