------------------------------------------------------------------------------
--                                                                          --
--                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 Qt4.Byte_Arrays;
with Qt4.IO_Devices;
with Qt4.Process_Environments;
with Qt4.String_Lists;
with Qt4.Strings;
with Qt_Ada.Generic_Object_Pointers;

package Qt4.Processes is

   type Process_Exit_Status is
    (Normal_Exit,
     Crash_Exit);
   pragma Convention (C, Process_Exit_Status);

   type Process_Process_Channel is
    (Standard_Output,
     Standard_Error);
   pragma Convention (C, Process_Process_Channel);

   type Process_Process_Channel_Mode is
    (Separate_Channels,
     Merged_Channels,
     Forwarded_Channels);
   pragma Convention (C, Process_Process_Channel_Mode);

   type Process_Process_Error is
    (Failed_To_Start,
     Crashed,
     Timedout,
     Read_Error,
     Write_Error,
     Unknown_Error);
   pragma Convention (C, Process_Process_Error);

   type Process_Process_State is
    (Not_Running,
     Starting,
     Running);
   pragma Convention (C, Process_Process_State);

   type Q_Process is limited interface
     and Qt4.IO_Devices.Q_IO_Device;

   type Q_Process_Access is
     access all Q_Process'Class;
   for Q_Process_Access'Storage_Size use 0;

   type Q_Process_Pointer is tagged;

   procedure Close_Read_Channel
    (Self : not null access Q_Process'Class;
     Channel : Qt4.Processes.Process_Process_Channel);

   procedure Close_Write_Channel
    (Self : not null access Q_Process'Class);

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

   function Error
    (Self : not null access constant Q_Process'Class)
       return Qt4.Processes.Process_Process_Error;

   function Exit_Code
    (Self : not null access constant Q_Process'Class)
       return Qt4.Q_Integer;

   function Exit_Status
    (Self : not null access constant Q_Process'Class)
       return Qt4.Processes.Process_Exit_Status;

   function Process_Channel_Mode
    (Self : not null access constant Q_Process'Class)
       return Qt4.Processes.Process_Process_Channel_Mode;

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

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

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

   function Read_Channel
    (Self : not null access constant Q_Process'Class)
       return Qt4.Processes.Process_Process_Channel;

   procedure Set_Environment
    (Self : not null access Q_Process'Class;
     Environment : Qt4.String_Lists.Q_String_List);

   procedure Set_Process_Channel_Mode
    (Self : not null access Q_Process'Class;
     Mode : Qt4.Processes.Process_Process_Channel_Mode);

   procedure Set_Process_Environment
    (Self : not null access Q_Process'Class;
     Environment : Qt4.Process_Environments.Q_Process_Environment);

   procedure Set_Read_Channel
    (Self : not null access Q_Process'Class;
     Channel : Qt4.Processes.Process_Process_Channel);

   procedure Set_Standard_Input_File
    (Self : not null access Q_Process'Class;
     File_Name : Qt4.Strings.Q_String);

   procedure Set_Standard_Output_Process
    (Self : not null access Q_Process'Class;
     Destination : not null access Qt4.Processes.Q_Process'Class);

   procedure Set_Working_Directory
    (Self : not null access Q_Process'Class;
     Dir : Qt4.Strings.Q_String);

   function State
    (Self : not null access constant Q_Process'Class)
       return Qt4.Processes.Process_Process_State;

   function Wait_For_Finished
    (Self : not null access Q_Process'Class;
     Msecs : Qt4.Q_Integer
       :=  30000)
       return Standard.Boolean;

   function Wait_For_Started
    (Self : not null access Q_Process'Class;
     Msecs : Qt4.Q_Integer
       :=  30000)
       return Standard.Boolean;

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

   procedure Kill
    (Self : not null access Q_Process'Class);

   procedure Terminate_Process
    (Self : not null access Q_Process'Class);

   use type Qt4.IO_Devices.Open_Mode;

   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);

   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);

   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);

   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);

   package Q_Process_Pointers is
     new Qt_Ada.Generic_Object_Pointers (Q_Process, Q_Process_Access);

   type Q_Process_Pointer is
     new Q_Process_Pointers.Q_Pointer with null record;

end Qt4.Processes;
