1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2006-2013, 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. -- As a special exception, if other files instantiate generics from  -- 
  22. -- this unit, or you link this unit with other files to produce an   -- 
  23. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  24. -- executable to be covered by the GNU General Public License. This  -- 
  25. -- exception does not however invalidate any other reasons why the   -- 
  26. -- executable file  might be covered by the  GNU Public License.     -- 
  27. ----------------------------------------------------------------------- 
  28.  
  29. --  <description> 
  30. --  Gtk_File_Chooser_Dialog is a dialog box suitable for use with "File/Open" 
  31. --  or "File/Save as" commands. This widget works by putting a 
  32. --  Gtk_File_Chooser_Widget inside a Gtk_Dialog. It exposes the 
  33. --  Gtk_File_Chooser interface, so you can use all of the Gtk_File_Chooser 
  34. --  functions on the file chooser dialog as well as those for GtkDialog. 
  35. -- 
  36. --  Note that Gtk_File_Chooser_Dialog does not have any methods of its own. 
  37. --  Instead, you should use the functions that work on a Gtk_File_Chooser. 
  38. --  </description> 
  39. --  <c_version>2.8.17</c_version> 
  40. --  <group>Selectors</group> 
  41. --  <screenshot>filechooser.png</screenshot> 
  42.  
  43. with Glib.Types; 
  44. with Gtk.Dialog; 
  45. with Gtk.File_Chooser; 
  46. with Gtk.Window; 
  47.  
  48. package Gtk.File_Chooser_Dialog is 
  49.  
  50.    type Gtk_File_Chooser_Dialog_Record is 
  51.      new Gtk.Dialog.Gtk_Dialog_Record with null record; 
  52.    type Gtk_File_Chooser_Dialog is 
  53.      access all Gtk_File_Chooser_Dialog_Record'Class; 
  54.  
  55.    function Get_Type return GType; 
  56.    --  Return the internal value associated with a Gtk_File_Chooser_Button 
  57.  
  58.    procedure Gtk_New 
  59.      (Dialog            : out Gtk_File_Chooser_Dialog; 
  60.       Title             : String; 
  61.       Parent            : access Gtk.Window.Gtk_Window_Record'Class; 
  62.       Action            : Gtk.File_Chooser.File_Chooser_Action); 
  63.    procedure Initialize 
  64.      (Dialog            : access Gtk_File_Chooser_Dialog_Record'Class; 
  65.       Title             : String; 
  66.       Parent            : access Gtk.Window.Gtk_Window_Record'Class; 
  67.       Action            : Gtk.File_Chooser.File_Chooser_Action); 
  68.    --  Creates a new file chooser dialog 
  69.  
  70.    procedure Gtk_New_With_Backend 
  71.      (Dialog            : out Gtk_File_Chooser_Dialog; 
  72.       Title             : String; 
  73.       Parent            : access Gtk.Window.Gtk_Window_Record'Class; 
  74.       Action            : Gtk.File_Chooser.File_Chooser_Action; 
  75.       Backend           : String); 
  76.    procedure Initialize_With_Backend 
  77.      (Dialog            : access Gtk_File_Chooser_Dialog_Record'Class; 
  78.       Title             : String; 
  79.       Parent            : access Gtk.Window.Gtk_Window_Record'Class; 
  80.       Action            : Gtk.File_Chooser.File_Chooser_Action; 
  81.       Backend           : String); 
  82.    --  Creates a new file chooser dialog 
  83.  
  84.    ---------------- 
  85.    -- Interfaces -- 
  86.    ---------------- 
  87.    --  This class implements several interfaces. See Glib.Types 
  88.    -- 
  89.    --  - "Gtk_File_Chooser" 
  90.  
  91.    package Implements_File_Chooser is new Glib.Types.Implements 
  92.      (Gtk.File_Chooser.Gtk_File_Chooser, 
  93.       Gtk_File_Chooser_Dialog_Record, Gtk_File_Chooser_Dialog); 
  94.    function "+" 
  95.      (Dialog : access Gtk_File_Chooser_Dialog_Record'Class) 
  96.       return Gtk.File_Chooser.Gtk_File_Chooser 
  97.       renames Implements_File_Chooser.To_Interface; 
  98.    function "-" 
  99.      (File : Gtk.File_Chooser.Gtk_File_Chooser) 
  100.       return Gtk_File_Chooser_Dialog 
  101.       renames Implements_File_Chooser.To_Object; 
  102.    --  Converts to and from the Gtk_File_Chooser interface 
  103.  
  104. private 
  105.    pragma Import (C, Get_Type, "gtk_file_chooser_dialog_get_type"); 
  106. end Gtk.File_Chooser_Dialog; 
  107.  
  108. --  Binding is done through our own C functions: 
  109. --  No binding: gtk_file_chooser_dialog_new 
  110. --  No binding: gtk_file_chooser_dialog_new_with_backend