1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  Gtk.File_Chooser.Gtk_File_Chooser is an interface that can be implemented 
  26. --  by file selection widgets. In GTK+, the main objects that implement this 
  27. --  interface are Gtk.File_Chooser_Widget.Gtk_File_Chooser_Widget, 
  28. --  Gtk.File_Chooser_Dialog.Gtk_File_Chooser_Dialog, and 
  29. --  Gtk.File_Chooser_Button.Gtk_File_Chooser_Button. You do not need to write 
  30. --  an object that implements the Gtk.File_Chooser.Gtk_File_Chooser interface 
  31. --  unless you are trying to adapt an existing file selector to expose a 
  32. --  standard programming interface. 
  33. -- 
  34. --  Gtk.File_Chooser.Gtk_File_Chooser allows for shortcuts to various places 
  35. --  in the filesystem. In the default implementation these are displayed in the 
  36. --  left pane. It may be a bit confusing at first that these shortcuts come 
  37. --  from various sources and in various flavours, so lets explain the 
  38. --  terminology here: 
  39. -- 
  40. --  'Bookmarks' 
  41. -- 
  42. --     * are created by the user, by dragging folders from the right pane to 
  43. --  the left pane, or by using the "Add". Bookmarks can be renamed and deleted 
  44. --  by the user. 'Shortcuts' 
  45. -- 
  46. --     * can be provided by the application or by the underlying filesystem 
  47. --  abstraction (e.g. both the gnome-vfs and the Windows filesystems provide 
  48. --  "Desktop" shortcuts). Shortcuts cannot be modified by the user. 'Volumes' 
  49. -- 
  50. --     * are provided by the underlying filesystem abstraction. They are the 
  51. --  "roots" of the filesystem. 
  52. -- 
  53. --  == File Names and Encodings == 
  54. -- 
  55. --  When the user is finished selecting files in a 
  56. --  Gtk.File_Chooser.Gtk_File_Chooser, your program can get the selected names 
  57. --  either as filenames or as URIs. For URIs, the normal escaping rules are 
  58. --  applied if the URI contains non-ASCII characters. However, filenames are 
  59. --  *always* returned in the character set specified by the 
  60. --  <envar>G_FILENAME_ENCODING</envar> environment variable. Please see the 
  61. --  GLib documentation for more details about this variable. 
  62. -- 
  63. --  Note: This means that while you can pass the result of 
  64. --  Gtk.File_Chooser.Get_Filename to <function>open(2)</function> or 
  65. --  <function>fopen(3)</function>, you may not be able to directly set it as 
  66. --  the text of a Gtk.Label.Gtk_Label widget unless you convert it first to 
  67. --  UTF-8, which all GTK+ widgets expect. You should use g_filename_to_utf8 to 
  68. --  convert filenames into strings that can be passed to GTK+ widgets. 
  69. -- 
  70. --  == Adding a Preview Widget == 
  71. -- 
  72. --  You can add a custom preview widget to a file chooser and then get 
  73. --  notification about when the preview needs to be updated. To install a 
  74. --  preview widget, use Gtk.File_Chooser.Set_Preview_Widget. Then, connect to 
  75. --  the Gtk.File_Chooser.Gtk_File_Chooser::update-preview signal to get 
  76. --  notified when you need to update the contents of the preview. 
  77. -- 
  78. --  Your callback should use Gtk.File_Chooser.Get_Preview_Filename to see what 
  79. --  needs previewing. Once you have generated the preview for the corresponding 
  80. --  file, you must call Gtk.File_Chooser.Set_Preview_Widget_Active with a 
  81. --  boolean flag that indicates whether your callback could successfully 
  82. --  generate a preview. 
  83. -- 
  84. --  <example id="example-gtkfilechooser-preview"> 
  85. --  == Sample Usage == 
  86. -- 
  87. --    { 
  88. --       GtkImage *preview; 
  89. --       ... 
  90. --       preview = gtk_image_new (<!-- -->); 
  91. --          gtk_file_chooser_set_preview_widget (my_file_chooser, preview); 
  92. --             g_signal_connect (my_file_chooser, "update-preview", 
  93. --             G_CALLBACK (update_preview_cb), preview); 
  94. --       } 
  95. --       static void 
  96. --       update_preview_cb (GtkFileChooser *file_chooser, gpointer data) 
  97. --       { 
  98. --          GtkWidget *preview; 
  99. --          char *filename; 
  100. --          GdkPixbuf *pixbuf; 
  101. --          gboolean have_preview; 
  102. --          preview = GTK_WIDGET (data); 
  103. --          filename = gtk_file_chooser_get_preview_filename (file_chooser); 
  104. --          pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL); 
  105. --          have_preview = (pixbuf != NULL); 
  106. --          g_free (filename); 
  107. --          gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf); 
  108. --          if (pixbuf) 
  109. --          g_object_unref (pixbuf); 
  110. --          gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview); 
  111. --       } 
  112. -- 
  113. --  == Adding Extra Widgets == 
  114. -- 
  115. --  You can add extra widgets to a file chooser to provide options that are 
  116. --  not present in the default design. For example, you can add a toggle button 
  117. --  to give the user the option to open a file in read-only mode. You can use 
  118. --  Gtk.File_Chooser.Set_Extra_Widget to insert additional widgets in a file 
  119. --  chooser. 
  120. -- 
  121. --  <example id="example-gtkfilechooser-extra"> 
  122. --  == Sample Usage == 
  123. -- 
  124. --    GtkWidget *toggle; 
  125. --    ... 
  126. --    toggle = gtk_check_button_new_with_label ("Open file read-only"); 
  127. --    gtk_widget_show (toggle); 
  128. --    gtk_file_chooser_set_extra_widget (my_file_chooser, toggle); 
  129. -- } 
  130. -- 
  131. --  Note: If you want to set more than one extra widget in the file chooser, 
  132. --  you can a container such as a Gtk.Box.Gtk_Box or a Gtk.Grid.Gtk_Grid and 
  133. --  include your widgets in it. Then, set the container as the whole extra 
  134. --  widget. 
  135. -- 
  136. --  == Key Bindings == 
  137. -- 
  138. --  Internally, GTK+ implements a file chooser's graphical user interface with 
  139. --  the private <classname>GtkFileChooserDefaultClass</classname>. This widget 
  140. --  has several <link linkend="gtk-Bindings">key bindings</link> and their 
  141. --  associated signals. This section describes the available key binding 
  142. --  signals. 
  143. -- 
  144. --  <example id="gtkfilechooser-key-binding-example"> 
  145. --  == GtkFileChooser key binding example == 
  146. -- 
  147. --  The default keys that activate the key-binding signals in 
  148. --  <classname>GtkFileChooserDefaultClass</classname> are as follows: 
  149. -- 
  150. --  
  151. -- 
  152. --  Signal name 
  153. -- 
  154. --  Default key combinations 
  155. -- 
  156. --  location-popup 
  157. -- 
  158. --  ['Control''L'] (empty path); '/' (path of "/") [ Both the individual '/' 
  159. --  key and the numeric keypad's "divide" key are supported. ]; '~' (path of 
  160. --  "~") 
  161. -- 
  162. --  up-folder 
  163. -- 
  164. --  ['Alt''Up']; ['Alt''Shift''Up'] [ Both the individual Up key and the 
  165. --  numeric keypad's Up key are supported. ]; 'Backspace' 
  166. -- 
  167. --  down-folder 
  168. -- 
  169. --  ['Alt''Down']; ['Alt''Shift''Down'] [ Both the individual Down key and the 
  170. --  numeric keypad's Down key are supported. ] 
  171. -- 
  172. --  home-folder 
  173. -- 
  174. --  ['Alt''Home'] 
  175. -- 
  176. --  desktop-folder 
  177. -- 
  178. --  ['Alt''D'] 
  179. -- 
  180. --  quick-bookmark 
  181. -- 
  182. --  ['Alt''1'] through ['Alt''0'] 
  183. -- 
  184. --  You can change these defaults to something else. For example, to add a 
  185. --  'Shift' modifier to a few of the default bindings, you can include the 
  186. --  following fragment in your '.config/gtk-3.0/gtk.css' file: 
  187. -- 
  188. --    Binding-set MyOwnFilechooserBindings 
  189. --    { 
  190. --       bind "<Alt><Shift>Up" { "up-folder" () } 
  191. --       bind "<Alt><Shift>Down" { "down-folder" () } 
  192. --       bind "<Alt><Shift>Home" { "home-folder" () } 
  193. --    } 
  194. --    GtkFileChooserDefault 
  195. --    { 
  196. --       gtk-key-bindings: MyOwnFilechooserBindings 
  197. --    } 
  198. -- 
  199. --  == The &quot;GtkFileChooserDefault::location-popup&quot; signal == 
  200. -- 
  201. --    void user_function (GtkFileChooserDefault *chooser, 
  202. --       const char            *path, 
  203. --       <link linkend="gpointer">gpointer</link>      user_data); 
  204. -- 
  205. --  This is used to make the file chooser show a "Location" dialog which the 
  206. --  user can use to manually type the name of the file he wishes to select. The 
  207. --  'path' argument is a string that gets put in the text entry for the file 
  208. --  name. By default this is bound to ['Control''L'] with a 'path' string of "" 
  209. --  (the empty string). It is also bound to '/' with a 'path' string of "'/'" 
  210. --  (a slash): this lets you type '/' and immediately type a path name. On Unix 
  211. --  systems, this is bound to '~' (tilde) with a 'path' string of "~" itself 
  212. --  for access to home directories. 
  213. -- 
  214. --  ''chooser' :' 
  215. -- 
  216. --     * the object which received the signal. ''path' :' 
  217. -- 
  218. --     * default contents for the text entry for the file name ''user_data' :' 
  219. -- 
  220. --     * user data set when the signal handler was connected. 
  221. -- 
  222. --  Note: You can create your own bindings for the 
  223. --  Gtk_File_Chooser_Default::location-popup signal with custom 'path' strings, 
  224. --  and have a crude form of easily-to-type bookmarks. For example, say you 
  225. --  access the path '/home/username/misc' very frequently. You could then 
  226. --  create an [ 'Alt' 'M' ] shortcut by including the following in your 
  227. --  '.config/gtk-3.0/gtk.css': 
  228. -- 
  229. --    Binding-set MiscShortcut 
  230. --    { 
  231. --       bind "<Alt>M" { "location-popup" ("/home/username/misc") } 
  232. --    } 
  233. --    GtkFileChooserDefault 
  234. --    { 
  235. --       gtk-key-bindings: MiscShortcut 
  236. --    } 
  237. -- 
  238. --  == The &quot;GtkFileChooserDefault::up-folder&quot; signal == 
  239. -- 
  240. --    void user_function (GtkFileChooserDefault *chooser, 
  241. --       <link linkend="gpointer">gpointer</link> user_data); 
  242. -- 
  243. --  This is used to make the file chooser go to the parent of the current 
  244. --  folder in the file hierarchy. By default this is bound to 'Backspace' and 
  245. --  ['Alt''Up'] (the Up key in the numeric keypad also works). 
  246. -- 
  247. --  ''chooser' :' 
  248. -- 
  249. --     * the object which received the signal. ''user_data' :' 
  250. -- 
  251. --     * user data set when the signal handler was connected. 
  252. -- 
  253. --  == The &quot;GtkFileChooserDefault::down-folder&quot; signal == 
  254. -- 
  255. --    void user_function (GtkFileChooserDefault *chooser, 
  256. --       <link linkend="gpointer">gpointer</link> user_data); 
  257. -- 
  258. --  This is used to make the file chooser go to a child of the current folder 
  259. --  in the file hierarchy. The subfolder that will be used is displayed in the 
  260. --  path bar widget of the file chooser. For example, if the path bar is 
  261. --  showing "/foo/*bar/*baz", then this will cause the file chooser to switch 
  262. --  to the "baz" subfolder. By default this is bound to ['Alt''Down'] (the Down 
  263. --  key in the numeric keypad also works). 
  264. -- 
  265. --  ''chooser' :' 
  266. -- 
  267. --     * the object which received the signal. ''user_data' :' 
  268. -- 
  269. --     * user data set when the signal handler was connected. 
  270. -- 
  271. --  == The &quot;GtkFileChooserDefault::home-folder&quot; signal == 
  272. -- 
  273. --    void user_function (GtkFileChooserDefault *chooser, 
  274. --       <link linkend="gpointer">gpointer</link> user_data); 
  275. -- 
  276. --  This is used to make the file chooser show the user's home folder in the 
  277. --  file list. By default this is bound to ['Alt''Home'] (the Home key in the 
  278. --  numeric keypad also works). 
  279. -- 
  280. --  ''chooser' :' 
  281. -- 
  282. --     * the object which received the signal. ''user_data' :' 
  283. -- 
  284. --     * user data set when the signal handler was connected. 
  285. -- 
  286. --  == The &quot;GtkFileChooserDefault::desktop-folder&quot; signal == 
  287. -- 
  288. --    void user_function (GtkFileChooserDefault *chooser, 
  289. --       <link linkend="gpointer">gpointer</link> user_data); 
  290. -- 
  291. --  This is used to make the file chooser show the user's Desktop folder in 
  292. --  the file list. By default this is bound to ['Alt''D']. 
  293. -- 
  294. --  ''chooser' :' 
  295. -- 
  296. --     * the object which received the signal. ''user_data' :' 
  297. -- 
  298. --     * user data set when the signal handler was connected. 
  299. -- 
  300. --  == The &quot;GtkFileChooserDefault::quick-bookmark&quot; signal == 
  301. -- 
  302. --    void user_function (GtkFileChooserDefault *chooser, 
  303. --       gint bookmark_index, 
  304. --       <link linkend="gpointer">gpointer</link> user_data); 
  305. -- 
  306. --  This is used to make the file chooser switch to the bookmark specified in 
  307. --  the 'bookmark_index' parameter. For example, if you have three bookmarks, 
  308. --  you can pass 0, 1, 2 to this signal to switch to each of them, 
  309. --  respectively. By default this is bound to ['Alt''1'], ['Alt''2'], etc. 
  310. --  until ['Alt''0']. Note that in the default binding, that ['Alt''1'] is 
  311. --  actually defined to switch to the bookmark at index 0, and so on 
  312. --  successively; ['Alt''0'] is defined to switch to the bookmark at index 10. 
  313. -- 
  314. --  ''chooser' :' 
  315. -- 
  316. --     * the object which received the signal. ''bookmark_indes' :' 
  317. -- 
  318. --     * index of the bookmark to switch to; the indices start at 0. 
  319. --  ''user_data' :' 
  320. -- 
  321. --     * user data set when the signal handler was connected. 
  322. -- 
  323. -- 
  324. --  </description> 
  325. --  <group></group> 
  326. pragma Ada_2005; 
  327.  
  328. pragma Warnings (Off, "*is already use-visible*"); 
  329. with Glib;                    use Glib; 
  330. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  331. with Glib.Object;             use Glib.Object; 
  332. with Glib.Properties;         use Glib.Properties; 
  333. with Glib.Types;              use Glib.Types; 
  334. with Gtk.Enums;               use Gtk.Enums; 
  335. with Gtk.File_Filter;         use Gtk.File_Filter; 
  336. with Gtk.Widget;              use Gtk.Widget; 
  337.  
  338. package Gtk.File_Chooser is 
  339.  
  340.    type Gtk_File_Chooser is new Glib.Types.GType_Interface; 
  341.    Null_Gtk_File_Chooser : constant Gtk_File_Chooser; 
  342.  
  343.    type Gtk_File_Chooser_Action is ( 
  344.       Action_Open, 
  345.       Action_Save, 
  346.       Action_Select_Folder, 
  347.       Action_Create_Folder); 
  348.    pragma Convention (C, Gtk_File_Chooser_Action); 
  349.    --  Describes whether a Gtk.File_Chooser.Gtk_File_Chooser is being used to 
  350.    --  open existing files or to save to a possibly new file. 
  351.  
  352.    type Gtk_File_Chooser_Confirmation is ( 
  353.       Confirmation_Confirm, 
  354.       Confirmation_Accept_Filename, 
  355.       Confirmation_Select_Again); 
  356.    pragma Convention (C, Gtk_File_Chooser_Confirmation); 
  357.    --  Used as a return value of handlers for the 
  358.    --  Gtk.File_Chooser.Gtk_File_Chooser::confirm-overwrite signal of a 
  359.    --  Gtk.File_Chooser.Gtk_File_Chooser. This value determines whether the 
  360.    --  file chooser will present the stock confirmation dialog, accept the 
  361.    --  user's choice of a filename, or let the user choose another filename. 
  362.  
  363.    type Gtk_File_Chooser_Error is ( 
  364.       Error_Nonexistent, 
  365.       Error_Bad_Filename, 
  366.       Error_Already_Exists, 
  367.       Error_Incomplete_Hostname); 
  368.    pragma Convention (C, Gtk_File_Chooser_Error); 
  369.    --  These identify the various errors that can occur while calling 
  370.    --  Gtk.File_Chooser.Gtk_File_Chooser functions. 
  371.  
  372.    ---------------------------- 
  373.    -- Enumeration Properties -- 
  374.    ---------------------------- 
  375.  
  376.    package Gtk_File_Chooser_Action_Properties is 
  377.       new Generic_Internal_Discrete_Property (Gtk_File_Chooser_Action); 
  378.    type Property_Gtk_File_Chooser_Action is new Gtk_File_Chooser_Action_Properties.Property; 
  379.  
  380.    package Gtk_File_Chooser_Confirmation_Properties is 
  381.       new Generic_Internal_Discrete_Property (Gtk_File_Chooser_Confirmation); 
  382.    type Property_Gtk_File_Chooser_Confirmation is new Gtk_File_Chooser_Confirmation_Properties.Property; 
  383.  
  384.    package Gtk_File_Chooser_Error_Properties is 
  385.       new Generic_Internal_Discrete_Property (Gtk_File_Chooser_Error); 
  386.    type Property_Gtk_File_Chooser_Error is new Gtk_File_Chooser_Error_Properties.Property; 
  387.  
  388.    ------------------ 
  389.    -- Constructors -- 
  390.    ------------------ 
  391.  
  392.    function Get_Type return Glib.GType; 
  393.    pragma Import (C, Get_Type, "gtk_file_chooser_get_type"); 
  394.  
  395.    ------------- 
  396.    -- Methods -- 
  397.    ------------- 
  398.  
  399.    procedure Add_Filter 
  400.       (Chooser : Gtk_File_Chooser; 
  401.        Filter  : not null access Gtk.File_Filter.Gtk_File_Filter_Record'Class); 
  402.    --  Adds Filter to the list of filters that the user can select between. 
  403.    --  When a filter is selected, only files that are passed by that filter are 
  404.    --  displayed. 
  405.    --  Note that the Chooser takes ownership of the filter, so you have to ref 
  406.    --  and sink it if you want to keep a reference. 
  407.    --  Since: gtk+ 2.4 
  408.    --  "filter": a Gtk.File_Filter.Gtk_File_Filter 
  409.  
  410.    function Add_Shortcut_Folder 
  411.       (Chooser : Gtk_File_Chooser; 
  412.        Folder  : UTF8_String) return Boolean; 
  413.    --  Adds a folder to be displayed with the shortcut folders in a file 
  414.    --  chooser. Note that shortcut folders do not get saved, as they are 
  415.    --  provided by the application. For example, you can use this to add a 
  416.    --  "/usr/share/mydrawprogram/Clipart" folder to the volume list. 
  417.    --  Since: gtk+ 2.4 
  418.    --  "folder": filename of the folder to add 
  419.  
  420.    function Add_Shortcut_Folder_Uri 
  421.       (Chooser : Gtk_File_Chooser; 
  422.        URI     : UTF8_String) return Boolean; 
  423.    --  Adds a folder URI to be displayed with the shortcut folders in a file 
  424.    --  chooser. Note that shortcut folders do not get saved, as they are 
  425.    --  provided by the application. For example, you can use this to add a 
  426.    --  "file:///usr/share/mydrawprogram/Clipart" folder to the volume list. 
  427.    --  Since: gtk+ 2.4 
  428.    --  "uri": URI of the folder to add 
  429.  
  430.    function Get_Action 
  431.       (Chooser : Gtk_File_Chooser) return Gtk_File_Chooser_Action; 
  432.    pragma Import (C, Get_Action, "gtk_file_chooser_get_action"); 
  433.    --  Gets the type of operation that the file chooser is performing; see 
  434.    --  Gtk.File_Chooser.Set_Action. 
  435.    --  Since: gtk+ 2.4 
  436.  
  437.    procedure Set_Action 
  438.       (Chooser : Gtk_File_Chooser; 
  439.        Action  : Gtk_File_Chooser_Action); 
  440.    pragma Import (C, Set_Action, "gtk_file_chooser_set_action"); 
  441.    --  Sets the type of operation that the chooser is performing; the user 
  442.    --  interface is adapted to suit the selected action. For example, an option 
  443.    --  to create a new folder might be shown if the action is 
  444.    --  Gtk.File_Chooser.Action_Save but not if the action is 
  445.    --  Gtk.File_Chooser.Action_Open. 
  446.    --  Since: gtk+ 2.4 
  447.    --  "action": the action that the file selector is performing 
  448.  
  449.    function Get_Create_Folders (Chooser : Gtk_File_Chooser) return Boolean; 
  450.    --  Gets whether file choser will offer to create new folders. See 
  451.    --  Gtk.File_Chooser.Set_Create_Folders. 
  452.    --  Since: gtk+ 2.18 
  453.  
  454.    procedure Set_Create_Folders 
  455.       (Chooser        : Gtk_File_Chooser; 
  456.        Create_Folders : Boolean); 
  457.    --  Sets whether file choser will offer to create new folders. This is only 
  458.    --  relevant if the action is not set to be Gtk.File_Chooser.Action_Open. 
  459.    --  Since: gtk+ 2.18 
  460.    --  "create_folders": True if the New Folder button should be displayed 
  461.  
  462.    function Get_Current_Folder 
  463.       (Chooser : Gtk_File_Chooser) return UTF8_String; 
  464.    --  Gets the current folder of Chooser as a local filename. See 
  465.    --  Gtk.File_Chooser.Set_Current_Folder. 
  466.    --  Note that this is the folder that the file chooser is currently 
  467.    --  displaying (e.g. "/home/username/Documents"), which is *not the same* as 
  468.    --  the currently-selected folder if the chooser is in 
  469.    --  Gtk.File_Chooser.Action_Select_Folder mode (e.g. 
  470.    --  "/home/username/Documents/selected-folder/". To get the 
  471.    --  currently-selected folder in that mode, use Gtk.File_Chooser.Get_Uri as 
  472.    --  the usual way to get the selection. 
  473.    --  Since: gtk+ 2.4 
  474.  
  475.    function Set_Current_Folder 
  476.       (Chooser  : Gtk_File_Chooser; 
  477.        Filename : UTF8_String) return Boolean; 
  478.    --  Sets the current folder for Chooser from a local filename. The user 
  479.    --  will be shown the full contents of the current folder, plus user 
  480.    --  interface elements for navigating to other folders. 
  481.    --  In general, you should not use this function. See the <link 
  482.    --  linkend="gtkfilechooserdialog-setting-up">section on setting up a file 
  483.    --  chooser dialog</link> for the rationale behind this. 
  484.    --  Since: gtk+ 2.4 
  485.    --  "filename": the full path of the new current folder 
  486.  
  487.    function Get_Current_Folder_Uri 
  488.       (Chooser : Gtk_File_Chooser) return UTF8_String; 
  489.    --  Gets the current folder of Chooser as an URI. See 
  490.    --  Gtk.File_Chooser.Set_Current_Folder_Uri. 
  491.    --  Note that this is the folder that the file chooser is currently 
  492.    --  displaying (e.g. "file:///home/username/Documents"), which is *not the 
  493.    --  same* as the currently-selected folder if the chooser is in 
  494.    --  Gtk.File_Chooser.Action_Select_Folder mode (e.g. 
  495.    --  "file:///home/username/Documents/selected-folder/". To get the 
  496.    --  currently-selected folder in that mode, use Gtk.File_Chooser.Get_Uri as 
  497.    --  the usual way to get the selection. 
  498.    --  Since: gtk+ 2.4 
  499.  
  500.    function Set_Current_Folder_Uri 
  501.       (Chooser : Gtk_File_Chooser; 
  502.        URI     : UTF8_String) return Boolean; 
  503.    --  Sets the current folder for Chooser from an URI. The user will be shown 
  504.    --  the full contents of the current folder, plus user interface elements 
  505.    --  for navigating to other folders. 
  506.    --  In general, you should not use this function. See the <link 
  507.    --  linkend="gtkfilechooserdialog-setting-up">section on setting up a file 
  508.    --  chooser dialog</link> for the rationale behind this. 
  509.    --  Since: gtk+ 2.4 
  510.    --  "uri": the URI for the new current folder 
  511.  
  512.    function Get_Do_Overwrite_Confirmation 
  513.       (Chooser : Gtk_File_Chooser) return Boolean; 
  514.    --  Queries whether a file chooser is set to confirm for overwriting when 
  515.    --  the user types a file name that already exists. 
  516.    --  Since: gtk+ 2.8 
  517.  
  518.    procedure Set_Do_Overwrite_Confirmation 
  519.       (Chooser                   : Gtk_File_Chooser; 
  520.        Do_Overwrite_Confirmation : Boolean); 
  521.    --  Sets whether a file chooser in Gtk.File_Chooser.Action_Save mode will 
  522.    --  present a confirmation dialog if the user types a file name that already 
  523.    --  exists. This is False by default. 
  524.    --  Regardless of this setting, the Chooser will emit the 
  525.    --  Gtk.File_Chooser.Gtk_File_Chooser::confirm-overwrite signal when 
  526.    --  appropriate. 
  527.    --  If all you need is the stock confirmation dialog, set this property to 
  528.    --  True. You can override the way confirmation is done by actually handling 
  529.    --  the Gtk.File_Chooser.Gtk_File_Chooser::confirm-overwrite signal; please 
  530.    --  refer to its documentation for the details. 
  531.    --  Since: gtk+ 2.8 
  532.    --  "do_overwrite_confirmation": whether to confirm overwriting in save 
  533.    --  mode 
  534.  
  535.    function Get_Extra_Widget 
  536.       (Chooser : Gtk_File_Chooser) return Gtk.Widget.Gtk_Widget; 
  537.    --  Gets the current preview widget; see Gtk.File_Chooser.Set_Extra_Widget. 
  538.    --  Since: gtk+ 2.4 
  539.  
  540.    procedure Set_Extra_Widget 
  541.       (Chooser      : Gtk_File_Chooser; 
  542.        Extra_Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class); 
  543.    --  Sets an application-supplied widget to provide extra options to the 
  544.    --  user. 
  545.    --  Since: gtk+ 2.4 
  546.    --  "extra_widget": widget for extra options 
  547.  
  548.    function Get_Filename (Chooser : Gtk_File_Chooser) return UTF8_String; 
  549.    --  Gets the filename for the currently selected file in the file selector. 
  550.    --  The filename is returned as an absolute path. If multiple files are 
  551.    --  selected, one of the filenames will be returned at random. 
  552.    --  If the file chooser is in folder mode, this function returns the 
  553.    --  selected folder. 
  554.    --  Since: gtk+ 2.4 
  555.  
  556.    function Set_Filename 
  557.       (Chooser  : Gtk_File_Chooser; 
  558.        Filename : UTF8_String) return Boolean; 
  559.    --  Sets Filename as the current filename for the file chooser, by changing 
  560.    --  to the file's parent folder and actually selecting the file in list; all 
  561.    --  other files will be unselected. If the Chooser is in 
  562.    --  Gtk.File_Chooser.Action_Save mode, the file's base name will also appear 
  563.    --  in the dialog's file name entry. 
  564.    --  Note that the file must exist, or nothing will be done except for the 
  565.    --  directory change. 
  566.    --  You should use this function only when implementing a 
  567.    --  <guimenuitem>File/Save As...</guimenuitem> dialog for which you already 
  568.    --  have a file name to which the user may save. For example, when the user 
  569.    --  opens an existing file and then does <guimenuitem>File/Save 
  570.    --  As...</guimenuitem> on it to save a copy or a modified version. If you 
  571.    --  don't have a file name already &mdash; for example, if the user just 
  572.    --  created a new file and is saving it for the first time, do not call this 
  573.    --  function. Instead, use something similar to this: |[ if 
  574.    --  (document_is_new) { /* the user just created a new document */ 
  575.    --  gtk_file_chooser_set_current_name (chooser, "Untitled document"); } else 
  576.    --  { /* the user edited an existing document */ 
  577.    --  gtk_file_chooser_set_filename (chooser, existing_filename); } ]| 
  578.    --  In the first case, the file chooser will present the user with useful 
  579.    --  suggestions as to where to save his new file. In the second case, the 
  580.    --  file's existing location is already known, so the file chooser will use 
  581.    --  it. 
  582.    --  Since: gtk+ 2.4 
  583.    --  "filename": the filename to set as current 
  584.  
  585.    function Get_Filenames 
  586.       (Chooser : Gtk_File_Chooser) return Gtk.Enums.String_SList.GSlist; 
  587.    --  Lists all the selected files and subfolders in the current folder of 
  588.    --  Chooser. The returned names are full absolute paths. If files in the 
  589.    --  current folder cannot be represented as local filenames they will be 
  590.    --  ignored. (See Gtk.File_Chooser.Get_Uris) 
  591.    --  Since: gtk+ 2.4 
  592.  
  593.    function Get_Filter 
  594.       (Chooser : Gtk_File_Chooser) return Gtk.File_Filter.Gtk_File_Filter; 
  595.    --  Gets the current filter; see Gtk.File_Chooser.Set_Filter. 
  596.    --  Since: gtk+ 2.4 
  597.  
  598.    procedure Set_Filter 
  599.       (Chooser : Gtk_File_Chooser; 
  600.        Filter  : not null access Gtk.File_Filter.Gtk_File_Filter_Record'Class); 
  601.    --  Sets the current filter; only the files that pass the filter will be 
  602.    --  displayed. If the user-selectable list of filters is non-empty, then the 
  603.    --  filter should be one of the filters in that list. Setting the current 
  604.    --  filter when the list of filters is empty is useful if you want to 
  605.    --  restrict the displayed set of files without letting the user change it. 
  606.    --  Since: gtk+ 2.4 
  607.    --  "filter": a Gtk.File_Filter.Gtk_File_Filter 
  608.  
  609.    function Get_Local_Only (Chooser : Gtk_File_Chooser) return Boolean; 
  610.    --  Gets whether only local files can be selected in the file selector. See 
  611.    --  Gtk.File_Chooser.Set_Local_Only 
  612.    --  Since: gtk+ 2.4 
  613.  
  614.    procedure Set_Local_Only 
  615.       (Chooser    : Gtk_File_Chooser; 
  616.        Local_Only : Boolean); 
  617.    --  Sets whether only local files can be selected in the file selector. If 
  618.    --  Local_Only is True (the default), then the selected file are files are 
  619.    --  guaranteed to be accessible through the operating systems native file 
  620.    --  file system and therefore the application only needs to worry about the 
  621.    --  filename functions in Gtk.File_Chooser.Gtk_File_Chooser, like 
  622.    --  Gtk.File_Chooser.Get_Filename, rather than the URI functions like 
  623.    --  Gtk.File_Chooser.Get_Uri, 
  624.    --  On some systems non-native files may still be available using the 
  625.    --  native filesystem via a userspace filesystem (FUSE). 
  626.    --  Since: gtk+ 2.4 
  627.    --  "local_only": True if only local files can be selected 
  628.  
  629.    function Get_Preview_Filename 
  630.       (Chooser : Gtk_File_Chooser) return UTF8_String; 
  631.    --  Gets the filename that should be previewed in a custom preview widget. 
  632.    --  See Gtk.File_Chooser.Set_Preview_Widget. 
  633.    --  Since: gtk+ 2.4 
  634.  
  635.    function Get_Preview_Uri (Chooser : Gtk_File_Chooser) return UTF8_String; 
  636.    --  Gets the URI that should be previewed in a custom preview widget. See 
  637.    --  Gtk.File_Chooser.Set_Preview_Widget. 
  638.    --  Since: gtk+ 2.4 
  639.  
  640.    function Get_Preview_Widget 
  641.       (Chooser : Gtk_File_Chooser) return Gtk.Widget.Gtk_Widget; 
  642.    --  Gets the current preview widget; see 
  643.    --  Gtk.File_Chooser.Set_Preview_Widget. 
  644.    --  Since: gtk+ 2.4 
  645.  
  646.    procedure Set_Preview_Widget 
  647.       (Chooser        : Gtk_File_Chooser; 
  648.        Preview_Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class); 
  649.    --  Sets an application-supplied widget to use to display a custom preview 
  650.    --  of the currently selected file. To implement a preview, after setting 
  651.    --  the preview widget, you connect to the 
  652.    --  Gtk.File_Chooser.Gtk_File_Chooser::update-preview signal, and call 
  653.    --  Gtk.File_Chooser.Get_Preview_Filename or 
  654.    --  Gtk.File_Chooser.Get_Preview_Uri on each change. If you can display a 
  655.    --  preview of the new file, update your widget and set the preview active 
  656.    --  using Gtk.File_Chooser.Set_Preview_Widget_Active. Otherwise, set the 
  657.    --  preview inactive. 
  658.    --  When there is no application-supplied preview widget, or the 
  659.    --  application-supplied preview widget is not active, the file chooser may 
  660.    --  display an internally generated preview of the current file or it may 
  661.    --  display no preview at all. 
  662.    --  Since: gtk+ 2.4 
  663.    --  "preview_widget": widget for displaying preview. 
  664.  
  665.    function Get_Preview_Widget_Active 
  666.       (Chooser : Gtk_File_Chooser) return Boolean; 
  667.    --  Gets whether the preview widget set by 
  668.    --  Gtk.File_Chooser.Set_Preview_Widget should be shown for the current 
  669.    --  filename. See Gtk.File_Chooser.Set_Preview_Widget_Active. 
  670.    --  Since: gtk+ 2.4 
  671.  
  672.    procedure Set_Preview_Widget_Active 
  673.       (Chooser : Gtk_File_Chooser; 
  674.        Active  : Boolean); 
  675.    --  Sets whether the preview widget set by 
  676.    --  Gtk.File_Chooser.Set_Preview_Widget should be shown for the current 
  677.    --  filename. When Active is set to false, the file chooser may display an 
  678.    --  internally generated preview of the current file or it may display no 
  679.    --  preview at all. See Gtk.File_Chooser.Set_Preview_Widget for more 
  680.    --  details. 
  681.    --  Since: gtk+ 2.4 
  682.    --  "active": whether to display the user-specified preview widget 
  683.  
  684.    function Get_Select_Multiple (Chooser : Gtk_File_Chooser) return Boolean; 
  685.    --  Gets whether multiple files can be selected in the file selector. See 
  686.    --  Gtk.File_Chooser.Set_Select_Multiple. 
  687.    --  Since: gtk+ 2.4 
  688.  
  689.    procedure Set_Select_Multiple 
  690.       (Chooser         : Gtk_File_Chooser; 
  691.        Select_Multiple : Boolean); 
  692.    --  Sets whether multiple files can be selected in the file selector. This 
  693.    --  is only relevant if the action is set to be Gtk.File_Chooser.Action_Open 
  694.    --  or Gtk.File_Chooser.Action_Select_Folder. 
  695.    --  Since: gtk+ 2.4 
  696.    --  "select_multiple": True if multiple files can be selected. 
  697.  
  698.    function Get_Show_Hidden (Chooser : Gtk_File_Chooser) return Boolean; 
  699.    --  Gets whether hidden files and folders are displayed in the file 
  700.    --  selector. See Gtk.File_Chooser.Set_Show_Hidden. 
  701.    --  Since: gtk+ 2.6 
  702.  
  703.    procedure Set_Show_Hidden 
  704.       (Chooser     : Gtk_File_Chooser; 
  705.        Show_Hidden : Boolean); 
  706.    --  Sets whether hidden files and folders are displayed in the file 
  707.    --  selector. 
  708.    --  Since: gtk+ 2.6 
  709.    --  "show_hidden": True if hidden files and folders should be displayed. 
  710.  
  711.    function Get_Uri (Chooser : Gtk_File_Chooser) return UTF8_String; 
  712.    --  Gets the URI for the currently selected file in the file selector. If 
  713.    --  multiple files are selected, one of the filenames will be returned at 
  714.    --  random. 
  715.    --  If the file chooser is in folder mode, this function returns the 
  716.    --  selected folder. 
  717.    --  Since: gtk+ 2.4 
  718.  
  719.    function Set_Uri 
  720.       (Chooser : Gtk_File_Chooser; 
  721.        URI     : UTF8_String) return Boolean; 
  722.    --  Sets the file referred to by Uri as the current file for the file 
  723.    --  chooser, by changing to the URI's parent folder and actually selecting 
  724.    --  the URI in the list. If the Chooser is Gtk.File_Chooser.Action_Save 
  725.    --  mode, the URI's base name will also appear in the dialog's file name 
  726.    --  entry. 
  727.    --  Note that the URI must exist, or nothing will be done except for the 
  728.    --  directory change. 
  729.    --  You should use this function only when implementing a 
  730.    --  <guimenuitem>File/Save As...</guimenuitem> dialog for which you already 
  731.    --  have a file name to which the user may save. For example, whenthe user 
  732.    --  opens an existing file and then does <guimenuitem>File/Save 
  733.    --  As...</guimenuitem> on it to save a copy or a modified version. If you 
  734.    --  don't have a file name already &mdash; for example, if the user just 
  735.    --  created a new file and is saving it for the first time, do not call this 
  736.    --  function. Instead, use something similar to this: |[ if 
  737.    --  (document_is_new) { /* the user just created a new document */ 
  738.    --  gtk_file_chooser_set_current_name (chooser, "Untitled document"); } else 
  739.    --  { /* the user edited an existing document */ gtk_file_chooser_set_uri 
  740.    --  (chooser, existing_uri); } ]| 
  741.    --  In the first case, the file chooser will present the user with useful 
  742.    --  suggestions as to where to save his new file. In the second case, the 
  743.    --  file's existing location is already known, so the file chooser will use 
  744.    --  it. 
  745.    --  Since: gtk+ 2.4 
  746.    --  "uri": the URI to set as current 
  747.  
  748.    function Get_Uris 
  749.       (Chooser : Gtk_File_Chooser) return Gtk.Enums.String_SList.GSlist; 
  750.    --  Lists all the selected files and subfolders in the current folder of 
  751.    --  Chooser. The returned names are full absolute URIs. 
  752.    --  Since: gtk+ 2.4 
  753.  
  754.    function Get_Use_Preview_Label 
  755.       (Chooser : Gtk_File_Chooser) return Boolean; 
  756.    --  Gets whether a stock label should be drawn with the name of the 
  757.    --  previewed file. See Gtk.File_Chooser.Set_Use_Preview_Label. 
  758.  
  759.    procedure Set_Use_Preview_Label 
  760.       (Chooser   : Gtk_File_Chooser; 
  761.        Use_Label : Boolean); 
  762.    --  Sets whether the file chooser should display a stock label with the 
  763.    --  name of the file that is being previewed; the default is True. 
  764.    --  Applications that want to draw the whole preview area themselves should 
  765.    --  set this to False and display the name themselves in their preview 
  766.    --  widget. 
  767.    --  See also: Gtk.File_Chooser.Set_Preview_Widget 
  768.    --  Since: gtk+ 2.4 
  769.    --  "use_label": whether to display a stock label with the name of the 
  770.    --  previewed file 
  771.  
  772.    function List_Filters 
  773.       (Chooser : Gtk_File_Chooser) return Glib.Object.Object_List.GSlist; 
  774.    --  Lists the current set of user-selectable filters; see 
  775.    --  Gtk.File_Chooser.Add_Filter, Gtk.File_Chooser.Remove_Filter. 
  776.    --  Since: gtk+ 2.4 
  777.  
  778.    function List_Shortcut_Folder_Uris 
  779.       (Chooser : Gtk_File_Chooser) return Gtk.Enums.String_SList.GSlist; 
  780.    --  Queries the list of shortcut folders in the file chooser, as set by 
  781.    --  Gtk.File_Chooser.Add_Shortcut_Folder_Uri. 
  782.    --  Since: gtk+ 2.4 
  783.  
  784.    function List_Shortcut_Folders 
  785.       (Chooser : Gtk_File_Chooser) return Gtk.Enums.String_SList.GSlist; 
  786.    --  Queries the list of shortcut folders in the file chooser, as set by 
  787.    --  Gtk.File_Chooser.Add_Shortcut_Folder. 
  788.    --  Since: gtk+ 2.4 
  789.  
  790.    procedure Remove_Filter 
  791.       (Chooser : Gtk_File_Chooser; 
  792.        Filter  : not null access Gtk.File_Filter.Gtk_File_Filter_Record'Class); 
  793.    --  Removes Filter from the list of filters that the user can select 
  794.    --  between. 
  795.    --  Since: gtk+ 2.4 
  796.    --  "filter": a Gtk.File_Filter.Gtk_File_Filter 
  797.  
  798.    function Remove_Shortcut_Folder 
  799.       (Chooser : Gtk_File_Chooser; 
  800.        Folder  : UTF8_String) return Boolean; 
  801.    --  Removes a folder from a file chooser's list of shortcut folders. 
  802.    --  Since: gtk+ 2.4 
  803.    --  "folder": filename of the folder to remove 
  804.  
  805.    function Remove_Shortcut_Folder_Uri 
  806.       (Chooser : Gtk_File_Chooser; 
  807.        URI     : UTF8_String) return Boolean; 
  808.    --  Removes a folder URI from a file chooser's list of shortcut folders. 
  809.    --  Since: gtk+ 2.4 
  810.    --  "uri": URI of the folder to remove 
  811.  
  812.    procedure Select_All (Chooser : Gtk_File_Chooser); 
  813.    pragma Import (C, Select_All, "gtk_file_chooser_select_all"); 
  814.    --  Selects all the files in the current folder of a file chooser. 
  815.    --  Since: gtk+ 2.4 
  816.  
  817.    function Select_Filename 
  818.       (Chooser  : Gtk_File_Chooser; 
  819.        Filename : UTF8_String) return Boolean; 
  820.    --  Selects a filename. If the file name isn't in the current folder of 
  821.    --  Chooser, then the current folder of Chooser will be changed to the 
  822.    --  folder containing Filename. 
  823.    --  Since: gtk+ 2.4 
  824.    --  "filename": the filename to select 
  825.  
  826.    function Select_Uri 
  827.       (Chooser : Gtk_File_Chooser; 
  828.        URI     : UTF8_String) return Boolean; 
  829.    --  Selects the file to by Uri. If the URI doesn't refer to a file in the 
  830.    --  current folder of Chooser, then the current folder of Chooser will be 
  831.    --  changed to the folder containing Filename. 
  832.    --  Since: gtk+ 2.4 
  833.    --  "uri": the URI to select 
  834.  
  835.    procedure Set_Current_Name 
  836.       (Chooser : Gtk_File_Chooser; 
  837.        Name    : UTF8_String); 
  838.    --  Sets the current name in the file selector, as if entered by the user. 
  839.    --  Note that the name passed in here is a UTF-8 string rather than a 
  840.    --  filename. This function is meant for such uses as a suggested name in a 
  841.    --  "Save As..." dialog. You can pass "Untitled.doc" or a similarly suitable 
  842.    --  suggestion for the Name. 
  843.    --  If you want to preselect a particular existing file, you should use 
  844.    --  Gtk.File_Chooser.Set_Filename or Gtk.File_Chooser.Set_Uri instead. 
  845.    --  Please see the documentation for those functions for an example of using 
  846.    --  Gtk.File_Chooser.Set_Current_Name as well. 
  847.    --  Since: gtk+ 2.4 
  848.    --  "name": the filename to use, as a UTF-8 string 
  849.  
  850.    procedure Unselect_All (Chooser : Gtk_File_Chooser); 
  851.    pragma Import (C, Unselect_All, "gtk_file_chooser_unselect_all"); 
  852.    --  Unselects all the files in the current folder of a file chooser. 
  853.    --  Since: gtk+ 2.4 
  854.  
  855.    procedure Unselect_Filename 
  856.       (Chooser  : Gtk_File_Chooser; 
  857.        Filename : UTF8_String); 
  858.    --  Unselects a currently selected filename. If the filename is not in the 
  859.    --  current directory, does not exist, or is otherwise not currently 
  860.    --  selected, does nothing. 
  861.    --  Since: gtk+ 2.4 
  862.    --  "filename": the filename to unselect 
  863.  
  864.    procedure Unselect_Uri (Chooser : Gtk_File_Chooser; URI : UTF8_String); 
  865.    --  Unselects the file referred to by Uri. If the file is not in the 
  866.    --  current directory, does not exist, or is otherwise not currently 
  867.    --  selected, does nothing. 
  868.    --  Since: gtk+ 2.4 
  869.    --  "uri": the URI to unselect 
  870.  
  871.    ---------------- 
  872.    -- Properties -- 
  873.    ---------------- 
  874.    --  The following properties are defined for this widget. See 
  875.    --  Glib.Properties for more information on properties) 
  876.  
  877.    Action_Property : constant Gtk.File_Chooser.Property_Gtk_File_Chooser_Action; 
  878.    --  Type: Gtk_File_Chooser_Action 
  879.  
  880.    Create_Folders_Property : constant Glib.Properties.Property_Boolean; 
  881.    --  Whether a file chooser not in Gtk.File_Chooser.Action_Open mode will 
  882.    --  offer the user to create new folders. 
  883.  
  884.    Do_Overwrite_Confirmation_Property : constant Glib.Properties.Property_Boolean; 
  885.    --  Whether a file chooser in Gtk.File_Chooser.Action_Save mode will 
  886.    --  present an overwrite confirmation dialog if the user selects a file name 
  887.    --  that already exists. 
  888.  
  889.    Extra_Widget_Property : constant Glib.Properties.Property_Object; 
  890.    --  Type: Gtk.Widget.Gtk_Widget 
  891.  
  892.    Filter_Property : constant Glib.Properties.Property_Object; 
  893.    --  Type: Gtk.File_Filter.Gtk_File_Filter 
  894.  
  895.    Local_Only_Property : constant Glib.Properties.Property_Boolean; 
  896.  
  897.    Preview_Widget_Property : constant Glib.Properties.Property_Object; 
  898.    --  Type: Gtk.Widget.Gtk_Widget 
  899.  
  900.    Preview_Widget_Active_Property : constant Glib.Properties.Property_Boolean; 
  901.  
  902.    Select_Multiple_Property : constant Glib.Properties.Property_Boolean; 
  903.  
  904.    Show_Hidden_Property : constant Glib.Properties.Property_Boolean; 
  905.  
  906.    Use_Preview_Label_Property : constant Glib.Properties.Property_Boolean; 
  907.  
  908.    ------------- 
  909.    -- Signals -- 
  910.    ------------- 
  911.  
  912.    type Cb_Gtk_File_Chooser_Gtk_File_Chooser_Confirmation is not null access function 
  913.      (Self : Gtk_File_Chooser) 
  914.    return Gtk_File_Chooser_Confirmation; 
  915.  
  916.    type Cb_GObject_Gtk_File_Chooser_Confirmation is not null access function 
  917.      (Self : access Glib.Object.GObject_Record'Class) 
  918.    return Gtk_File_Chooser_Confirmation; 
  919.  
  920.    Signal_Confirm_Overwrite : constant Glib.Signal_Name := "confirm-overwrite"; 
  921.    procedure On_Confirm_Overwrite 
  922.       (Self  : Gtk_File_Chooser; 
  923.        Call  : Cb_Gtk_File_Chooser_Gtk_File_Chooser_Confirmation; 
  924.        After : Boolean := False); 
  925.    procedure On_Confirm_Overwrite 
  926.       (Self  : Gtk_File_Chooser; 
  927.        Call  : Cb_GObject_Gtk_File_Chooser_Confirmation; 
  928.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  929.        After : Boolean := False); 
  930.    --  This signal gets emitted whenever it is appropriate to present a 
  931.    --  confirmation dialog when the user has selected a file name that already 
  932.    --  exists. The signal only gets emitted when the file chooser is in 
  933.    --  Gtk.File_Chooser.Action_Save mode. 
  934.    -- 
  935.    --  Most applications just need to turn on the 
  936.    --  Gtk.File_Chooser.Gtk_File_Chooser:do-overwrite-confirmation property (or 
  937.    --  call the Gtk.File_Chooser.Set_Do_Overwrite_Confirmation function), and 
  938.    --  they will automatically get a stock confirmation dialog. Applications 
  939.    --  which need to customize this behavior should do that, and also connect 
  940.    --  to the Gtk.File_Chooser.Gtk_File_Chooser::confirm-overwrite signal. 
  941.    -- 
  942.    --  A signal handler for this signal must return a 
  943.    --  Gtk.File_Chooser.Gtk_File_Chooser_Confirmation value, which indicates 
  944.    --  the action to take. If the handler determines that the user wants to 
  945.    --  select a different filename, it should return 
  946.    --  Gtk.File_Chooser.Confirmation_Select_Again. If it determines that the 
  947.    --  user is satisfied with his choice of file name, it should return 
  948.    --  Gtk.File_Chooser.Confirmation_Accept_Filename. On the other hand, if it 
  949.    --  determines that the stock confirmation dialog should be used, it should 
  950.    --  return Gtk.File_Chooser.Confirmation_Confirm. The following example 
  951.    --  illustrates this. <example id="gtkfilechooser-confirmation"> 
  952.    -- 
  953.    --  == Custom confirmation == 
  954.    -- 
  955.    --    static GtkFileChooserConfirmation 
  956.    --    confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data) 
  957.    --    { 
  958.    --       char *uri; 
  959.    --       uri = gtk_file_chooser_get_uri (chooser); 
  960.    --       if (is_uri_read_only (uri)) 
  961.    --       { 
  962.    --          if (user_wants_to_replace_read_only_file (uri)) 
  963.    --          return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME; 
  964.    --       else 
  965.    --          return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN; 
  966.    --       } else 
  967.    --          return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog 
  968.    --       } 
  969.    --       ... 
  970.    --       chooser = gtk_file_chooser_dialog_new (...); 
  971.    --       gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); 
  972.    --       g_signal_connect (chooser, "confirm-overwrite", 
  973.    --          G_CALLBACK (confirm_overwrite_callback), NULL); 
  974.    --       if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT) 
  975.    --       save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser)); 
  976.    --          gtk_widget_destroy (chooser); 
  977.    -- 
  978.    --  
  979.    --  Callback parameters: 
  980.    --    --  Returns a Gtk.File_Chooser.Gtk_File_Chooser_Confirmation value that indicates which action to take after emitting the signal. 
  981.  
  982.    type Cb_Gtk_File_Chooser_Void is not null access procedure (Self : Gtk_File_Chooser); 
  983.  
  984.    type Cb_GObject_Void is not null access procedure 
  985.      (Self : access Glib.Object.GObject_Record'Class); 
  986.  
  987.    Signal_Current_Folder_Changed : constant Glib.Signal_Name := "current-folder-changed"; 
  988.    procedure On_Current_Folder_Changed 
  989.       (Self  : Gtk_File_Chooser; 
  990.        Call  : Cb_Gtk_File_Chooser_Void; 
  991.        After : Boolean := False); 
  992.    procedure On_Current_Folder_Changed 
  993.       (Self  : Gtk_File_Chooser; 
  994.        Call  : Cb_GObject_Void; 
  995.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  996.        After : Boolean := False); 
  997.    --  This signal is emitted when the current folder in a 
  998.    --  Gtk.File_Chooser.Gtk_File_Chooser changes. This can happen due to the 
  999.    --  user performing some action that changes folders, such as selecting a 
  1000.    --  bookmark or visiting a folder on the file list. It can also happen as a 
  1001.    --  result of calling a function to explicitly change the current folder in 
  1002.    --  a file chooser. 
  1003.    -- 
  1004.    --  Normally you do not need to connect to this signal, unless you need to 
  1005.    --  keep track of which folder a file chooser is showing. 
  1006.    -- 
  1007.    --  See also: Gtk.File_Chooser.Set_Current_Folder, 
  1008.    --  Gtk.File_Chooser.Get_Current_Folder, 
  1009.    --  Gtk.File_Chooser.Set_Current_Folder_Uri, 
  1010.    --  Gtk.File_Chooser.Get_Current_Folder_Uri. 
  1011.  
  1012.    Signal_File_Activated : constant Glib.Signal_Name := "file-activated"; 
  1013.    procedure On_File_Activated 
  1014.       (Self  : Gtk_File_Chooser; 
  1015.        Call  : Cb_Gtk_File_Chooser_Void; 
  1016.        After : Boolean := False); 
  1017.    procedure On_File_Activated 
  1018.       (Self  : Gtk_File_Chooser; 
  1019.        Call  : Cb_GObject_Void; 
  1020.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1021.        After : Boolean := False); 
  1022.    --  This signal is emitted when the user "activates" a file in the file 
  1023.    --  chooser. This can happen by double-clicking on a file in the file list, 
  1024.    --  or by pressing 'Enter'. 
  1025.    -- 
  1026.    --  Normally you do not need to connect to this signal. It is used 
  1027.    --  internally by Gtk.File_Chooser_Dialog.Gtk_File_Chooser_Dialog to know 
  1028.    --  when to activate the default button in the dialog. 
  1029.    -- 
  1030.    --  See also: Gtk.File_Chooser.Get_Filename, 
  1031.    --  Gtk.File_Chooser.Get_Filenames, Gtk.File_Chooser.Get_Uri, 
  1032.    --  Gtk.File_Chooser.Get_Uris. 
  1033.  
  1034.    Signal_Selection_Changed : constant Glib.Signal_Name := "selection-changed"; 
  1035.    procedure On_Selection_Changed 
  1036.       (Self  : Gtk_File_Chooser; 
  1037.        Call  : Cb_Gtk_File_Chooser_Void; 
  1038.        After : Boolean := False); 
  1039.    procedure On_Selection_Changed 
  1040.       (Self  : Gtk_File_Chooser; 
  1041.        Call  : Cb_GObject_Void; 
  1042.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1043.        After : Boolean := False); 
  1044.    --  This signal is emitted when there is a change in the set of selected 
  1045.    --  files in a Gtk.File_Chooser.Gtk_File_Chooser. This can happen when the 
  1046.    --  user modifies the selection with the mouse or the keyboard, or when 
  1047.    --  explicitly calling functions to change the selection. 
  1048.    -- 
  1049.    --  Normally you do not need to connect to this signal, as it is easier to 
  1050.    --  wait for the file chooser to finish running, and then to get the list of 
  1051.    --  selected files using the functions mentioned below. 
  1052.    -- 
  1053.    --  See also: Gtk.File_Chooser.Select_Filename, 
  1054.    --  Gtk.File_Chooser.Unselect_Filename, Gtk.File_Chooser.Get_Filename, 
  1055.    --  Gtk.File_Chooser.Get_Filenames, Gtk.File_Chooser.Select_Uri, 
  1056.    --  Gtk.File_Chooser.Unselect_Uri, Gtk.File_Chooser.Get_Uri, 
  1057.    --  Gtk.File_Chooser.Get_Uris. 
  1058.  
  1059.    Signal_Update_Preview : constant Glib.Signal_Name := "update-preview"; 
  1060.    procedure On_Update_Preview 
  1061.       (Self  : Gtk_File_Chooser; 
  1062.        Call  : Cb_Gtk_File_Chooser_Void; 
  1063.        After : Boolean := False); 
  1064.    procedure On_Update_Preview 
  1065.       (Self  : Gtk_File_Chooser; 
  1066.        Call  : Cb_GObject_Void; 
  1067.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  1068.        After : Boolean := False); 
  1069.    --  This signal is emitted when the preview in a file chooser should be 
  1070.    --  regenerated. For example, this can happen when the currently selected 
  1071.    --  file changes. You should use this signal if you want your file chooser 
  1072.    --  to have a preview widget. 
  1073.    -- 
  1074.    --  Once you have installed a preview widget with 
  1075.    --  Gtk.File_Chooser.Set_Preview_Widget, you should update it when this 
  1076.    --  signal is emitted. You can use the functions 
  1077.    --  Gtk.File_Chooser.Get_Preview_Filename or 
  1078.    --  Gtk.File_Chooser.Get_Preview_Uri to get the name of the file to preview. 
  1079.    --  Your widget may not be able to preview all kinds of files; your callback 
  1080.    --  must call Gtk.File_Chooser.Set_Preview_Widget_Active to inform the file 
  1081.    --  chooser about whether the preview was generated successfully or not. 
  1082.    -- 
  1083.    --  Please see the example code in <xref 
  1084.    --  linkend="gtkfilechooser-preview"/>. 
  1085.    -- 
  1086.    --  See also: Gtk.File_Chooser.Set_Preview_Widget, 
  1087.    --  Gtk.File_Chooser.Set_Preview_Widget_Active, 
  1088.    --  Gtk.File_Chooser.Set_Use_Preview_Label, 
  1089.    --  Gtk.File_Chooser.Get_Preview_Filename, Gtk.File_Chooser.Get_Preview_Uri. 
  1090.  
  1091.    ---------------- 
  1092.    -- Interfaces -- 
  1093.    ---------------- 
  1094.    --  This class implements several interfaces. See Glib.Types 
  1095.    -- 
  1096.    --  - "Gtk_File_Chooser" 
  1097.  
  1098.    function "+" (W : Gtk_File_Chooser) return Gtk_File_Chooser; 
  1099.    pragma Inline ("+"); 
  1100.  
  1101. private 
  1102.    Use_Preview_Label_Property : constant Glib.Properties.Property_Boolean := 
  1103.      Glib.Properties.Build ("use-preview-label"); 
  1104.    Show_Hidden_Property : constant Glib.Properties.Property_Boolean := 
  1105.      Glib.Properties.Build ("show-hidden"); 
  1106.    Select_Multiple_Property : constant Glib.Properties.Property_Boolean := 
  1107.      Glib.Properties.Build ("select-multiple"); 
  1108.    Preview_Widget_Active_Property : constant Glib.Properties.Property_Boolean := 
  1109.      Glib.Properties.Build ("preview-widget-active"); 
  1110.    Preview_Widget_Property : constant Glib.Properties.Property_Object := 
  1111.      Glib.Properties.Build ("preview-widget"); 
  1112.    Local_Only_Property : constant Glib.Properties.Property_Boolean := 
  1113.      Glib.Properties.Build ("local-only"); 
  1114.    Filter_Property : constant Glib.Properties.Property_Object := 
  1115.      Glib.Properties.Build ("filter"); 
  1116.    Extra_Widget_Property : constant Glib.Properties.Property_Object := 
  1117.      Glib.Properties.Build ("extra-widget"); 
  1118.    Do_Overwrite_Confirmation_Property : constant Glib.Properties.Property_Boolean := 
  1119.      Glib.Properties.Build ("do-overwrite-confirmation"); 
  1120.    Create_Folders_Property : constant Glib.Properties.Property_Boolean := 
  1121.      Glib.Properties.Build ("create-folders"); 
  1122.    Action_Property : constant Gtk.File_Chooser.Property_Gtk_File_Chooser_Action := 
  1123.      Gtk.File_Chooser.Build ("action"); 
  1124.  
  1125. Null_Gtk_File_Chooser : constant Gtk_File_Chooser := 
  1126.    Gtk_File_Chooser (Glib.Types.Null_Interface); 
  1127. end Gtk.File_Chooser;