------------------------------------------------------------------------------
--                                                                          --
--                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.Objects;
with Qt4.Strings;
with Qt_Ada.Generic_Object_Pointers;

package Qt4.IO_Devices is

   type Q_IO_Device is limited interface
     and Qt4.Objects.Q_Object;

   type Q_IO_Device_Access is
     access all Q_IO_Device'Class;
   for Q_IO_Device_Access'Storage_Size use 0;

   type Q_IO_Device_Pointer is tagged;

   not overriding
   function At_End
    (Self : not null access constant Q_IO_Device)
       return Standard.Boolean
         is abstract;

   not overriding
   function Bytes_Available
    (Self : not null access constant Q_IO_Device)
       return Qt4.Q_Integer_64
         is abstract;

   not overriding
   function Bytes_To_Write
    (Self : not null access constant Q_IO_Device)
       return Qt4.Q_Integer_64
         is abstract;

   not overriding
   function Can_Read_Line
    (Self : not null access constant Q_IO_Device)
       return Standard.Boolean
         is abstract;

   not overriding
   procedure Close
    (Self : not null access Q_IO_Device)
       is abstract;

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

   function Is_Open
    (Self : not null access constant Q_IO_Device'Class)
       return Standard.Boolean;

   function Is_Readable
    (Self : not null access constant Q_IO_Device'Class)
       return Standard.Boolean;

   not overriding
   function Is_Sequential
    (Self : not null access constant Q_IO_Device)
       return Standard.Boolean
         is abstract;

   function Is_Text_Mode_Enabled
    (Self : not null access constant Q_IO_Device'Class)
       return Standard.Boolean;

   function Is_Writable
    (Self : not null access constant Q_IO_Device'Class)
       return Standard.Boolean;

   function Peek
    (Self : not null access Q_IO_Device'Class;
     Maxlen : Qt4.Q_Integer_64)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   not overriding
   function Pos
    (Self : not null access constant Q_IO_Device)
       return Qt4.Q_Integer_64
         is abstract;

   function Read
    (Self : not null access Q_IO_Device'Class;
     Maxlen : Qt4.Q_Integer_64)
       return Qt4.Byte_Arrays.Q_Byte_Array;

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

   function Read_Line
    (Self : not null access Q_IO_Device'Class;
     Maxlen : Qt4.Q_Integer_64
       :=  0)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   not overriding
   function Reset
    (Self : not null access Q_IO_Device)
       return Standard.Boolean
         is abstract;

   not overriding
   function Seek
    (Self : not null access Q_IO_Device;
     Pos : Qt4.Q_Integer_64)
       return Standard.Boolean
         is abstract;

   procedure Set_Text_Mode_Enabled
    (Self : not null access Q_IO_Device'Class;
     Enabled : Standard.Boolean);

   not overriding
   function Size
    (Self : not null access constant Q_IO_Device)
       return Qt4.Q_Integer_64
         is abstract;

   function Write
    (Self : not null access Q_IO_Device'Class;
     Data : Qt4.Byte_Arrays.Q_Byte_Array)
       return Qt4.Q_Integer_64;

   --  Open Mode

   type Open_Mode_Flag is
     (Not_Open,
      Read_Only,
      Write_Only,
      Read_Write,
      Append,
      Truncate,
      Text,
      Unbuffered);
   pragma Convention (C, Open_Mode_Flag);
   for Open_Mode_Flag'Size use Interfaces.C.int'Size;
   for Open_Mode_Flag use
     (Not_Open   => 16#00000000#,
      Read_Only  => 16#00000001#,
      Write_Only => 16#00000002#,
      Read_Write => 16#00000003#,  --  ReadOnly | WriteOnly
      Append     => 16#00000004#,
      Truncate   => 16#00000008#,
      Text       => 16#00000010#,
      Unbuffered => 16#00000020#);

   package Open_Mode_Flag_Flags is new Qt4_Generic_Flags (Open_Mode_Flag);
   type Open_Mode is new Open_Mode_Flag_Flags.Flags;

   not overriding
   function Open
    (Self : not null access Q_IO_Device;
     Mode : Qt4.IO_Devices.Open_Mode)
       return Boolean
         is abstract;

   procedure Open
    (Self : not null access Q_IO_Device'Class;
     Mode : Qt4.IO_Devices.Open_Mode);

   package Q_IO_Device_Pointers is
     new Qt_Ada.Generic_Object_Pointers (Q_IO_Device, Q_IO_Device_Access);

   type Q_IO_Device_Pointer is
     new Q_IO_Device_Pointers.Q_Pointer with null record;

end Qt4.IO_Devices;
