------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008, 2009 Vadim Godunko <vgodunko@gmail.com>                --
--                                                                          --
-- QtAda is free software;  you can  redistribute it and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion. QtAda is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
-- for  more details.  You should have  received  a copy of the GNU General --
-- Public License distributed with QtAda;  see file COPYING.  If not, write --
-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
-- Boston, MA 02110-1301, USA.                                              --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable  to  be --
-- covered  by the  GNU  General  Public  License.  This exception does not --
-- however invalidate  any other reasons why  the executable file  might be --
-- covered by the  GNU Public License.                                      --
--                                                                          --
------------------------------------------------------------------------------
--    This file has been generated automatically. Please don't edit it.     --
------------------------------------------------------------------------------
with Qt_Ada.Internals.Objects;
with Qt_Ada.Internals.Objects.Object_Utilities;

with Qt_Ada.Internals.Objects.File_Dialog_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.File_Dialog_Proxies);
--  Elaboration of the proxy tagged type package register proxy object
--  constructor. Bindings must be able to create proxy object of the
--  corresponding tagged type for works properly.

package body Qt4.File_Dialogs is

   function confirmOverwrite_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.bool;
   pragma Import (C, confirmOverwrite_0_wrapper,
                     "__Qt4Ada_QFileDialog_confirmOverwrite_0_wrapper");

   procedure defaultSuffix_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Strings.Internals.QString);
   pragma Import (C, defaultSuffix_0_wrapper,
                     "__Qt4Ada_QFileDialog_defaultSuffix_0_wrapper");

   function fileMode_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.File_Dialogs.File_Dialog_File_Mode;
   pragma Import (C, fileMode_0_wrapper,
                     "__Qt4Ada_QFileDialog_fileMode_0_wrapper");

   function isReadOnly_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.bool;
   pragma Import (C, isReadOnly_0_wrapper,
                     "__Qt4Ada_QFileDialog_isReadOnly_0_wrapper");

   function resolveSymlinks_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.bool;
   pragma Import (C, resolveSymlinks_0_wrapper,
                     "__Qt4Ada_QFileDialog_resolveSymlinks_0_wrapper");

   procedure selectFile_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Filename : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, selectFile_0_wrapper,
                     "__Qt4Ada_QFileDialog_selectFile_0_wrapper");

   procedure selectFilter_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Filter : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, selectFilter_0_wrapper,
                     "__Qt4Ada_QFileDialog_selectFilter_0_wrapper");

   procedure selectedFilter_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Strings.Internals.QString);
   pragma Import (C, selectedFilter_0_wrapper,
                     "__Qt4Ada_QFileDialog_selectedFilter_0_wrapper");

   procedure setConfirmOverwrite_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Enabled : Qt4.bool);
   pragma Import (C, setConfirmOverwrite_0_wrapper,
                     "__Qt4Ada_QFileDialog_setConfirmOverwrite_0_wrapper");

   procedure setDefaultSuffix_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Suffix : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, setDefaultSuffix_0_wrapper,
                     "__Qt4Ada_QFileDialog_setDefaultSuffix_0_wrapper");

   procedure setDirectory_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Directory : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, setDirectory_0_wrapper,
                     "__Qt4Ada_QFileDialog_setDirectory_0_wrapper");

   procedure setFileMode_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Mode : Qt4.File_Dialogs.File_Dialog_File_Mode);
   pragma Import (C, setFileMode_0_wrapper,
                     "__Qt4Ada_QFileDialog_setFileMode_0_wrapper");

   procedure setFilter_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Filter : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, setFilter_0_wrapper,
                     "__Qt4Ada_QFileDialog_setFilter_0_wrapper");

   procedure setReadOnly_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Enabled : Qt4.bool);
   pragma Import (C, setReadOnly_0_wrapper,
                     "__Qt4Ada_QFileDialog_setReadOnly_0_wrapper");

   procedure setResolveSymlinks_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Enabled : Qt4.bool);
   pragma Import (C, setResolveSymlinks_0_wrapper,
                     "__Qt4Ada_QFileDialog_setResolveSymlinks_0_wrapper");

   procedure getExistingDirectory_wrapper
    (Parent          : access Qt_Ada.Internals.Objects.QObject;
     Caption         : not null access Qt4.Strings.Internals.QString;
     Dir             : not null access Qt4.Strings.Internals.QString;
     Opts            : Options;
     Result          : access Qt4.Strings.Internals.QString);
   pragma Import (C,
                  getExistingDirectory_wrapper,
                  "__QtAda_QFileDialog_getExistingDirectory_wrapper");

   procedure getOpenFileName_wrapper
    (Parent          : access Qt_Ada.Internals.Objects.QObject := null;
     Caption         : not null access Qt4.Strings.Internals.QString;
     Dir             : not null access Qt4.Strings.Internals.QString;
     Filter          : not null access Qt4.Strings.Internals.QString;
     Selected_Filter : access Qt4.Strings.Internals.QString;
     Opts            : Options;
     Result          : access Qt4.Strings.Internals.QString);
   pragma Import (C,
                  getOpenFileName_wrapper,
                  "__Qt4Ada_QMainWindow_getOpenFileName_wrapper");

   procedure getSaveFileName_wrapper
    (Parent          : access Qt_Ada.Internals.Objects.QObject := null;
     Caption         : not null access Qt4.Strings.Internals.QString;
     Dir             : not null access Qt4.Strings.Internals.QString;
     Filter          : not null access Qt4.Strings.Internals.QString;
     Selected_Filter : access Qt4.Strings.Internals.QString;
     Opts            : Options;
     Result          : access Qt4.Strings.Internals.QString);
   pragma Import (C,
                  getSaveFileName_wrapper,
                  "__Qt4Ada_QMainWindow_getSaveFileName_wrapper");

   procedure selectedFiles_wrapper
    (Self    : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.String_Lists.Internals.QStringList);
   pragma Import (C, selectedFiles_wrapper,
                     "__QtAda_QFileDialog_selectedFiles_Q_wrapper");

   ----------------------------
   -- Get_Existing_Directory --
   ----------------------------

   function Get_Existing_Directory
    (Parent          : access Qt4.Widgets.Q_Widget'Class := null;
     Caption         : Qt4.Strings.Q_String := Qt4.Strings.Create;
     Dir             : Qt4.Strings.Q_String := Qt4.Strings.Create;
     Opts            : Options := +Show_Dirs_Only)
       return Qt4.Strings.Q_String
   is
   begin
      return Result : Qt4.Strings.Q_String do
         getExistingDirectory_wrapper
          (Qt_Ada.Internals.Objects.Object_Utilities.Corresponding_QObject
            (Parent),
             Qt4.Strings.Internals.QString_View (Caption),
             Qt4.Strings.Internals.QString_View (Dir),
             Opts,
             Qt4.Strings.Internals.QString_View (Result));
      end return;
   end Get_Existing_Directory;

   ------------------------
   -- Get_Open_File_Name --
   ------------------------

   function Get_Open_File_Name
    (Parent          : access Qt4.Widgets.Q_Widget'Class := null;
     Caption         : Qt4.Strings.Q_String := Qt4.Strings.Create;
     Dir             : Qt4.Strings.Q_String := Qt4.Strings.Create;
     Filter          : Qt4.Strings.Q_String := Qt4.Strings.Create;
     Selected_Filter : Qt4.Strings.Q_String := Qt4.Strings.Create;
     Opts            : Options := +Default)
       return Qt4.Strings.Q_String is
   begin
      if Parent = null then
         return Result : Qt4.Strings.Q_String do
           getOpenFileName_wrapper
            (null,
             Qt4.Strings.Internals.QString_View (Caption),
             Qt4.Strings.Internals.QString_View (Dir),
             Qt4.Strings.Internals.QString_View (Filter),
             Qt4.Strings.Internals.QString_View (Selected_Filter),
             Opts,
             Qt4.Strings.Internals.QString_View (Result));
         end return;

      else
         return Result : Qt4.Strings.Q_String do
            getOpenFileName_wrapper
             (Parent.QObject_View,
              Qt4.Strings.Internals.QString_View (Caption),
              Qt4.Strings.Internals.QString_View (Dir),
              Qt4.Strings.Internals.QString_View (Filter),
              Qt4.Strings.Internals.QString_View (Selected_Filter),
              Opts,
              Qt4.Strings.Internals.QString_View (Result));
         end return;
      end if;
   end Get_Open_File_Name;

   ------------------------
   -- Get_Save_File_Name --
   ------------------------

   function Get_Save_File_Name
    (Parent          : access Qt4.Widgets.Q_Widget'Class := null;
     Caption         : Qt4.Strings.Q_String := Qt4.Strings.Create;
     Dir             : Qt4.Strings.Q_String := Qt4.Strings.Create;
     Filter          : Qt4.Strings.Q_String := Qt4.Strings.Create;
     Selected_Filter : Qt4.Strings.Q_String := Qt4.Strings.Create;
     Opts            : Options := +Default)
       return Qt4.Strings.Q_String is
   begin
      if Parent = null then
         return Result : Qt4.Strings.Q_String do
          getSaveFileName_wrapper
           (null,
            Qt4.Strings.Internals.QString_View (Caption),
            Qt4.Strings.Internals.QString_View (Dir),
            Qt4.Strings.Internals.QString_View (Filter),
            Qt4.Strings.Internals.QString_View (Selected_Filter),
            Opts,
            Qt4.Strings.Internals.QString_View (Result));
         end return;

      else
         return Result : Qt4.Strings.Q_String do
            getSaveFileName_wrapper
             (Parent.QObject_View,
              Qt4.Strings.Internals.QString_View (Caption),
              Qt4.Strings.Internals.QString_View (Dir),
              Qt4.Strings.Internals.QString_View (Filter),
              Qt4.Strings.Internals.QString_View (Selected_Filter),
              Opts,
              Qt4.Strings.Internals.QString_View (Result));
         end return;
      end if;
   end Get_Save_File_Name;

   --------------------
   -- Selected_Files --
   --------------------

   function Selected_Files
    (Self : not null access constant Q_File_Dialog'Class)
       return Qt4.String_Lists.Q_String_List
   is
      Returns : Qt4.String_Lists.Q_String_List;

   begin
      selectedFiles_wrapper
       (Self.QObject_View,
        Qt4.String_Lists.Internals.QStringList_View (Returns));

      return Returns;
   end Selected_Files;

   pragma Style_Checks ("N");

   -----------------------
   -- Confirm_Overwrite --
   -----------------------

   function Confirm_Overwrite
    (Self : not null access constant Q_File_Dialog'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (confirmOverwrite_0_wrapper
           (Self.QObject_View));
   end Confirm_Overwrite;

   --------------------
   -- Default_Suffix --
   --------------------

   function Default_Suffix
    (Self : not null access constant Q_File_Dialog'Class)
       return Qt4.Strings.Q_String
   is
      Returns : Qt4.Strings.Q_String;

   begin
      defaultSuffix_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Returns));

      return Returns;
   end Default_Suffix;

   ---------------
   -- File_Mode --
   ---------------

   function File_Mode
    (Self : not null access constant Q_File_Dialog'Class)
       return Qt4.File_Dialogs.File_Dialog_File_Mode
   is
   begin
      return
        fileMode_0_wrapper
         (Self.QObject_View);
   end File_Mode;

   ------------------
   -- Is_Read_Only --
   ------------------

   function Is_Read_Only
    (Self : not null access constant Q_File_Dialog'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isReadOnly_0_wrapper
           (Self.QObject_View));
   end Is_Read_Only;

   ----------------------
   -- Resolve_Symlinks --
   ----------------------

   function Resolve_Symlinks
    (Self : not null access constant Q_File_Dialog'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (resolveSymlinks_0_wrapper
           (Self.QObject_View));
   end Resolve_Symlinks;

   -----------------
   -- Select_File --
   -----------------

   procedure Select_File
    (Self : not null access Q_File_Dialog'Class;
     Filename : Qt4.Strings.Q_String)
   is
   begin
      selectFile_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Filename));
   end Select_File;

   -------------------
   -- Select_Filter --
   -------------------

   procedure Select_Filter
    (Self : not null access Q_File_Dialog'Class;
     Filter : Qt4.Strings.Q_String)
   is
   begin
      selectFilter_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Filter));
   end Select_Filter;

   ---------------------
   -- Selected_Filter --
   ---------------------

   function Selected_Filter
    (Self : not null access constant Q_File_Dialog'Class)
       return Qt4.Strings.Q_String
   is
      Returns : Qt4.Strings.Q_String;

   begin
      selectedFilter_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Returns));

      return Returns;
   end Selected_Filter;

   ---------------------------
   -- Set_Confirm_Overwrite --
   ---------------------------

   procedure Set_Confirm_Overwrite
    (Self : not null access Q_File_Dialog'Class;
     Enabled : Standard.Boolean)
   is
   begin
      setConfirmOverwrite_0_wrapper
       (Self.QObject_View,
        Qt4.To_bool (Enabled));
   end Set_Confirm_Overwrite;

   ------------------------
   -- Set_Default_Suffix --
   ------------------------

   procedure Set_Default_Suffix
    (Self : not null access Q_File_Dialog'Class;
     Suffix : Qt4.Strings.Q_String)
   is
   begin
      setDefaultSuffix_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Suffix));
   end Set_Default_Suffix;

   -------------------
   -- Set_Directory --
   -------------------

   procedure Set_Directory
    (Self : not null access Q_File_Dialog'Class;
     Directory : Qt4.Strings.Q_String)
   is
   begin
      setDirectory_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Directory));
   end Set_Directory;

   -------------------
   -- Set_File_Mode --
   -------------------

   procedure Set_File_Mode
    (Self : not null access Q_File_Dialog'Class;
     Mode : Qt4.File_Dialogs.File_Dialog_File_Mode)
   is
   begin
      setFileMode_0_wrapper
       (Self.QObject_View,
        Mode);
   end Set_File_Mode;

   ----------------
   -- Set_Filter --
   ----------------

   procedure Set_Filter
    (Self : not null access Q_File_Dialog'Class;
     Filter : Qt4.Strings.Q_String)
   is
   begin
      setFilter_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Filter));
   end Set_Filter;

   -------------------
   -- Set_Read_Only --
   -------------------

   procedure Set_Read_Only
    (Self : not null access Q_File_Dialog'Class;
     Enabled : Standard.Boolean)
   is
   begin
      setReadOnly_0_wrapper
       (Self.QObject_View,
        Qt4.To_bool (Enabled));
   end Set_Read_Only;

   --------------------------
   -- Set_Resolve_Symlinks --
   --------------------------

   procedure Set_Resolve_Symlinks
    (Self : not null access Q_File_Dialog'Class;
     Enabled : Standard.Boolean)
   is
   begin
      setResolveSymlinks_0_wrapper
       (Self.QObject_View,
        Qt4.To_bool (Enabled));
   end Set_Resolve_Symlinks;

end Qt4.File_Dialogs;
