------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008-2010 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.Process_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.Process_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.Processes is

   procedure closeReadChannel_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Channel : Qt4.Processes.Process_Process_Channel);
   pragma Import (C, closeReadChannel_0_wrapper,
                     "__Qt4Ada_QProcess_closeReadChannel_0_wrapper");

   procedure closeWriteChannel_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, closeWriteChannel_0_wrapper,
                     "__Qt4Ada_QProcess_closeWriteChannel_0_wrapper");

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

   function error_1_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Processes.Process_Process_Error;
   pragma Import (C, error_1_wrapper,
                     "__Qt4Ada_QProcess_error_1_wrapper");

   function exitCode_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Q_Integer;
   pragma Import (C, exitCode_0_wrapper,
                     "__Qt4Ada_QProcess_exitCode_0_wrapper");

   function exitStatus_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Processes.Process_Exit_Status;
   pragma Import (C, exitStatus_0_wrapper,
                     "__Qt4Ada_QProcess_exitStatus_0_wrapper");

   function processChannelMode_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Processes.Process_Process_Channel_Mode;
   pragma Import (C, processChannelMode_0_wrapper,
                     "__Qt4Ada_QProcess_processChannelMode_0_wrapper");

   procedure processEnvironment_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Process_Environments.Internals.QProcessEnvironment);
   pragma Import (C, processEnvironment_0_wrapper,
                     "__Qt4Ada_QProcess_processEnvironment_0_wrapper");

   procedure readAllStandardError_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Byte_Arrays.Internals.QByteArray);
   pragma Import (C, readAllStandardError_0_wrapper,
                     "__Qt4Ada_QProcess_readAllStandardError_0_wrapper");

   procedure readAllStandardOutput_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Byte_Arrays.Internals.QByteArray);
   pragma Import (C, readAllStandardOutput_0_wrapper,
                     "__Qt4Ada_QProcess_readAllStandardOutput_0_wrapper");

   function readChannel_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Processes.Process_Process_Channel;
   pragma Import (C, readChannel_0_wrapper,
                     "__Qt4Ada_QProcess_readChannel_0_wrapper");

   procedure setEnvironment_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Environment : not null access constant Qt4.String_Lists.Internals.QStringList);
   pragma Import (C, setEnvironment_0_wrapper,
                     "__Qt4Ada_QProcess_setEnvironment_0_wrapper");

   procedure setProcessChannelMode_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Mode : Qt4.Processes.Process_Process_Channel_Mode);
   pragma Import (C, setProcessChannelMode_0_wrapper,
                     "__Qt4Ada_QProcess_setProcessChannelMode_0_wrapper");

   procedure setProcessEnvironment_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Environment : not null access constant Qt4.Process_Environments.Internals.QProcessEnvironment);
   pragma Import (C, setProcessEnvironment_0_wrapper,
                     "__Qt4Ada_QProcess_setProcessEnvironment_0_wrapper");

   procedure setReadChannel_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Channel : Qt4.Processes.Process_Process_Channel);
   pragma Import (C, setReadChannel_0_wrapper,
                     "__Qt4Ada_QProcess_setReadChannel_0_wrapper");

   procedure setStandardInputFile_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     File_Name : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, setStandardInputFile_0_wrapper,
                     "__Qt4Ada_QProcess_setStandardInputFile_0_wrapper");

   procedure setStandardOutputProcess_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Destination : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, setStandardOutputProcess_0_wrapper,
                     "__Qt4Ada_QProcess_setStandardOutputProcess_0_wrapper");

   procedure setWorkingDirectory_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Dir : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, setWorkingDirectory_0_wrapper,
                     "__Qt4Ada_QProcess_setWorkingDirectory_0_wrapper");

   function state_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Processes.Process_Process_State;
   pragma Import (C, state_0_wrapper,
                     "__Qt4Ada_QProcess_state_0_wrapper");

   function waitForFinished_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Msecs : Qt4.Q_Integer)
       return Qt4.bool;
   pragma Import (C, waitForFinished_0_wrapper,
                     "__Qt4Ada_QProcess_waitForFinished_0_wrapper");

   function waitForStarted_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Msecs : Qt4.Q_Integer)
       return Qt4.bool;
   pragma Import (C, waitForStarted_0_wrapper,
                     "__Qt4Ada_QProcess_waitForStarted_0_wrapper");

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

   procedure kill_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, kill_0_wrapper,
                     "__Qt4Ada_QProcess_kill_0_wrapper");

   procedure terminate_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, terminate_0_wrapper,
                     "__Qt4Ada_QProcess_terminate_0_wrapper");

   procedure setStandardErrorFile_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     File_Name : not null access constant Qt4.Strings.Internals.QString;
     Mode : Qt4.IO_Devices.Open_Mode);
   pragma Import (C, setStandardErrorFile_0_wrapper,
                     "__Qt4Ada_QProcess_setStandardErrorFile_0_wrapper");

   procedure setStandardOutputFile_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     File_Name : not null access constant Qt4.Strings.Internals.QString;
     Mode : Qt4.IO_Devices.Open_Mode);
   pragma Import (C, setStandardOutputFile_0_wrapper,
                     "__Qt4Ada_QProcess_setStandardOutputFile_0_wrapper");

   procedure start_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Program : not null access constant Qt4.Strings.Internals.QString;
     Arguments : not null access constant Qt4.String_Lists.Internals.QStringList;
     Mode : Qt4.IO_Devices.Open_Mode);
   pragma Import (C, start_0_wrapper,
                     "__Qt4Ada_QProcess_start_0_wrapper");

   procedure start_1_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Program : not null access constant Qt4.Strings.Internals.QString;
     Mode : Qt4.IO_Devices.Open_Mode);
   pragma Import (C, start_1_wrapper,
                     "__Qt4Ada_QProcess_start_1_wrapper");

   -----------------------------
   -- Set_Standard_Error_File --
   -----------------------------

   procedure Set_Standard_Error_File
    (Self : not null access Q_Process'Class;
     File_Name : Qt4.Strings.Q_String;
     Mode : Qt4.IO_Devices.Open_Mode
       := +Qt4.IO_Devices.Truncate)
   is
   begin
      setStandardErrorFile_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (File_Name),
        Mode);
   end Set_Standard_Error_File;

   ------------------------------
   -- Set_Standard_Output_File --
   ------------------------------

   procedure Set_Standard_Output_File
    (Self : not null access Q_Process'Class;
     File_Name : Qt4.Strings.Q_String;
     Mode : Qt4.IO_Devices.Open_Mode
       := +Qt4.IO_Devices.Truncate)
   is
   begin
      setStandardOutputFile_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (File_Name),
        Mode);
   end Set_Standard_Output_File;

   -----------
   -- Start --
   -----------

   procedure Start
    (Self : not null access Q_Process'Class;
     Program : Qt4.Strings.Q_String;
     Arguments : Qt4.String_Lists.Q_String_List;
     Mode : Qt4.IO_Devices.Open_Mode
       := +Qt4.IO_Devices.Read_Write)
   is
   begin
      start_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Program),
        Qt4.String_Lists.Internals.QStringList_View (Arguments),
        Mode);
   end Start;

   -----------
   -- Start --
   -----------

   procedure Start
    (Self : not null access Q_Process'Class;
     Program : Qt4.Strings.Q_String;
     Mode : Qt4.IO_Devices.Open_Mode
       := +Qt4.IO_Devices.Read_Write)
   is
   begin
      start_1_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Program),
        Mode);
   end Start;

   pragma Style_Checks ("N");

   ------------------------
   -- Close_Read_Channel --
   ------------------------

   procedure Close_Read_Channel
    (Self : not null access Q_Process'Class;
     Channel : Qt4.Processes.Process_Process_Channel)
   is
   begin
      closeReadChannel_0_wrapper
       (Self.QObject_View,
        Channel);
   end Close_Read_Channel;

   -------------------------
   -- Close_Write_Channel --
   -------------------------

   procedure Close_Write_Channel
    (Self : not null access Q_Process'Class)
   is
   begin
      closeWriteChannel_0_wrapper
       (Self.QObject_View);
   end Close_Write_Channel;

   -----------------
   -- Environment --
   -----------------

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

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

      return Returns;
   end Environment;

   -----------
   -- Error --
   -----------

   function Error
    (Self : not null access constant Q_Process'Class)
       return Qt4.Processes.Process_Process_Error
   is
   begin
      return
        error_1_wrapper
         (Self.QObject_View);
   end Error;

   ---------------
   -- Exit_Code --
   ---------------

   function Exit_Code
    (Self : not null access constant Q_Process'Class)
       return Qt4.Q_Integer
   is
   begin
      return
        exitCode_0_wrapper
         (Self.QObject_View);
   end Exit_Code;

   -----------------
   -- Exit_Status --
   -----------------

   function Exit_Status
    (Self : not null access constant Q_Process'Class)
       return Qt4.Processes.Process_Exit_Status
   is
   begin
      return
        exitStatus_0_wrapper
         (Self.QObject_View);
   end Exit_Status;

   --------------------------
   -- Process_Channel_Mode --
   --------------------------

   function Process_Channel_Mode
    (Self : not null access constant Q_Process'Class)
       return Qt4.Processes.Process_Process_Channel_Mode
   is
   begin
      return
        processChannelMode_0_wrapper
         (Self.QObject_View);
   end Process_Channel_Mode;

   -------------------------
   -- Process_Environment --
   -------------------------

   function Process_Environment
    (Self : not null access constant Q_Process'Class)
       return Qt4.Process_Environments.Q_Process_Environment
   is
      Returns : Qt4.Process_Environments.Q_Process_Environment;

   begin
      processEnvironment_0_wrapper
       (Self.QObject_View,
        Qt4.Process_Environments.Internals.QProcessEnvironment_View (Returns));

      return Returns;
   end Process_Environment;

   -----------------------------
   -- Read_All_Standard_Error --
   -----------------------------

   function Read_All_Standard_Error
    (Self : not null access Q_Process'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array
   is
      Returns : Qt4.Byte_Arrays.Q_Byte_Array;

   begin
      readAllStandardError_0_wrapper
       (Self.QObject_View,
        Qt4.Byte_Arrays.Internals.QByteArray_View (Returns));

      return Returns;
   end Read_All_Standard_Error;

   ------------------------------
   -- Read_All_Standard_Output --
   ------------------------------

   function Read_All_Standard_Output
    (Self : not null access Q_Process'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array
   is
      Returns : Qt4.Byte_Arrays.Q_Byte_Array;

   begin
      readAllStandardOutput_0_wrapper
       (Self.QObject_View,
        Qt4.Byte_Arrays.Internals.QByteArray_View (Returns));

      return Returns;
   end Read_All_Standard_Output;

   ------------------
   -- Read_Channel --
   ------------------

   function Read_Channel
    (Self : not null access constant Q_Process'Class)
       return Qt4.Processes.Process_Process_Channel
   is
   begin
      return
        readChannel_0_wrapper
         (Self.QObject_View);
   end Read_Channel;

   ---------------------
   -- Set_Environment --
   ---------------------

   procedure Set_Environment
    (Self : not null access Q_Process'Class;
     Environment : Qt4.String_Lists.Q_String_List)
   is
   begin
      setEnvironment_0_wrapper
       (Self.QObject_View,
        Qt4.String_Lists.Internals.QStringList_View (Environment));
   end Set_Environment;

   ------------------------------
   -- Set_Process_Channel_Mode --
   ------------------------------

   procedure Set_Process_Channel_Mode
    (Self : not null access Q_Process'Class;
     Mode : Qt4.Processes.Process_Process_Channel_Mode)
   is
   begin
      setProcessChannelMode_0_wrapper
       (Self.QObject_View,
        Mode);
   end Set_Process_Channel_Mode;

   -----------------------------
   -- Set_Process_Environment --
   -----------------------------

   procedure Set_Process_Environment
    (Self : not null access Q_Process'Class;
     Environment : Qt4.Process_Environments.Q_Process_Environment)
   is
   begin
      setProcessEnvironment_0_wrapper
       (Self.QObject_View,
        Qt4.Process_Environments.Internals.QProcessEnvironment_View (Environment));
   end Set_Process_Environment;

   ----------------------
   -- Set_Read_Channel --
   ----------------------

   procedure Set_Read_Channel
    (Self : not null access Q_Process'Class;
     Channel : Qt4.Processes.Process_Process_Channel)
   is
   begin
      setReadChannel_0_wrapper
       (Self.QObject_View,
        Channel);
   end Set_Read_Channel;

   -----------------------------
   -- Set_Standard_Input_File --
   -----------------------------

   procedure Set_Standard_Input_File
    (Self : not null access Q_Process'Class;
     File_Name : Qt4.Strings.Q_String)
   is
   begin
      setStandardInputFile_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (File_Name));
   end Set_Standard_Input_File;

   ---------------------------------
   -- Set_Standard_Output_Process --
   ---------------------------------

   procedure Set_Standard_Output_Process
    (Self : not null access Q_Process'Class;
     Destination : not null access Qt4.Processes.Q_Process'Class)
   is
   begin
      setStandardOutputProcess_0_wrapper
       (Self.QObject_View,
        Destination.QObject_View);
   end Set_Standard_Output_Process;

   ---------------------------
   -- Set_Working_Directory --
   ---------------------------

   procedure Set_Working_Directory
    (Self : not null access Q_Process'Class;
     Dir : Qt4.Strings.Q_String)
   is
   begin
      setWorkingDirectory_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Dir));
   end Set_Working_Directory;

   -----------
   -- State --
   -----------

   function State
    (Self : not null access constant Q_Process'Class)
       return Qt4.Processes.Process_Process_State
   is
   begin
      return
        state_0_wrapper
         (Self.QObject_View);
   end State;

   -----------------------
   -- Wait_For_Finished --
   -----------------------

   function Wait_For_Finished
    (Self : not null access Q_Process'Class;
     Msecs : Qt4.Q_Integer
       :=  30000)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (waitForFinished_0_wrapper
           (Self.QObject_View,
            Msecs));
   end Wait_For_Finished;

   ----------------------
   -- Wait_For_Started --
   ----------------------

   function Wait_For_Started
    (Self : not null access Q_Process'Class;
     Msecs : Qt4.Q_Integer
       :=  30000)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (waitForStarted_0_wrapper
           (Self.QObject_View,
            Msecs));
   end Wait_For_Started;

   -----------------------
   -- Working_Directory --
   -----------------------

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

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

      return Returns;
   end Working_Directory;

   ----------
   -- Kill --
   ----------

   procedure Kill
    (Self : not null access Q_Process'Class)
   is
   begin
      kill_0_wrapper
       (Self.QObject_View);
   end Kill;

   -----------------------
   -- Terminate_Process --
   -----------------------

   procedure Terminate_Process
    (Self : not null access Q_Process'Class)
   is
   begin
      terminate_0_wrapper
       (Self.QObject_View);
   end Terminate_Process;

end Qt4.Processes;
