1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2006, AdaCore                        -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  Gtk_File_Chooser_Dialog is a dialog box suitable for use with "File/Open" 
  26. --  or "File/Save as" commands. This widget works by putting a 
  27. --  Gtk_File_Chooser_Widget inside a Gtk_Dialog. It exposes the 
  28. --  Gtk_File_Chooser interface, so you can use all of the Gtk_File_Chooser 
  29. --  functions on the file chooser dialog as well as those for GtkDialog. 
  30. -- 
  31. --  Note that Gtk_File_Chooser_Dialog does not have any methods of its own. 
  32. --  Instead, you should use the functions that work on a Gtk_File_Chooser. 
  33. --  </description> 
  34. --  <c_version>2.8.17</c_version> 
  35. --  <group>Selectors</group> 
  36. --  <screenshot>filechooser.png</screenshot> 
  37.  
  38. with Glib.Types; 
  39. with Gtk.Dialog; 
  40. with Gtk.File_Chooser; 
  41. with Gtk.Window; 
  42.  
  43. package Gtk.File_Chooser_Dialog is 
  44.  
  45.    type Gtk_File_Chooser_Dialog_Record is 
  46.      new Gtk.Dialog.Gtk_Dialog_Record with null record; 
  47.    type Gtk_File_Chooser_Dialog is 
  48.      access all Gtk_File_Chooser_Dialog_Record'Class; 
  49.  
  50.    function Get_Type return GType; 
  51.    --  Return the internal value associated with a Gtk_File_Chooser_Button 
  52.  
  53.    procedure Gtk_New 
  54.      (Dialog            : out Gtk_File_Chooser_Dialog; 
  55.       Title             : String; 
  56.       Parent            : access Gtk.Window.Gtk_Window_Record'Class; 
  57.       Action            : Gtk.File_Chooser.File_Chooser_Action); 
  58.    procedure Initialize 
  59.      (Dialog            : access Gtk_File_Chooser_Dialog_Record'Class; 
  60.       Title             : String; 
  61.       Parent            : access Gtk.Window.Gtk_Window_Record'Class; 
  62.       Action            : Gtk.File_Chooser.File_Chooser_Action); 
  63.    --  Creates a new file chooser dialog 
  64.  
  65.    procedure Gtk_New_With_Backend 
  66.      (Dialog            : out Gtk_File_Chooser_Dialog; 
  67.       Title             : String; 
  68.       Parent            : access Gtk.Window.Gtk_Window_Record'Class; 
  69.       Action            : Gtk.File_Chooser.File_Chooser_Action; 
  70.       Backend           : String); 
  71.    procedure Initialize_With_Backend 
  72.      (Dialog            : access Gtk_File_Chooser_Dialog_Record'Class; 
  73.       Title             : String; 
  74.       Parent            : access Gtk.Window.Gtk_Window_Record'Class; 
  75.       Action            : Gtk.File_Chooser.File_Chooser_Action; 
  76.       Backend           : String); 
  77.    --  Creates a new file chooser dialog 
  78.  
  79.    ---------------- 
  80.    -- Interfaces -- 
  81.    ---------------- 
  82.    --  This class implements several interfaces. See Glib.Types 
  83.    -- 
  84.    --  - "Gtk_File_Chooser" 
  85.  
  86.    package Implements_File_Chooser is new Glib.Types.Implements 
  87.      (Gtk.File_Chooser.Gtk_File_Chooser, 
  88.       Gtk_File_Chooser_Dialog_Record, Gtk_File_Chooser_Dialog); 
  89.    function "+" 
  90.      (Dialog : access Gtk_File_Chooser_Dialog_Record'Class) 
  91.       return Gtk.File_Chooser.Gtk_File_Chooser 
  92.       renames Implements_File_Chooser.To_Interface; 
  93.    function "-" 
  94.      (File : Gtk.File_Chooser.Gtk_File_Chooser) 
  95.       return Gtk_File_Chooser_Dialog 
  96.       renames Implements_File_Chooser.To_Object; 
  97.    --  Converts to and from the Gtk_File_Chooser interface 
  98.  
  99. private 
  100.    pragma Import (C, Get_Type, "gtk_file_chooser_dialog_get_type"); 
  101. end Gtk.File_Chooser_Dialog; 
  102.  
  103. --  Binding is done through our own C functions: 
  104. --  No binding: gtk_file_chooser_dialog_new 
  105. --  No binding: gtk_file_chooser_dialog_new_with_backend