------------------------------------------------------------------------------
--                                                                          --
--                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.Object_Registry;
pragma Elaborate (Qt_Ada.Internals.Object_Registry);

package body Qt_Ada.Internals.Objects.IO_Device_Proxies is

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

   function bytesAvailable_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Q_Integer_64;
      pragma Import (C, bytesAvailable_0_virtual,
                     "__Qt4Ada_QIODevice_bytesAvailable_0_virtual");

   function bytesToWrite_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Q_Integer_64;
      pragma Import (C, bytesToWrite_0_virtual,
                     "__Qt4Ada_QIODevice_bytesToWrite_0_virtual");

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

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

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

   function pos_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Q_Integer_64;
      pragma Import (C, pos_0_virtual,
                     "__Qt4Ada_QIODevice_pos_0_virtual");

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

   function seek_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Pos : Qt4.Q_Integer_64)
       return Qt4.bool;
      pragma Import (C, seek_0_virtual,
                     "__Qt4Ada_QIODevice_seek_0_virtual");

   function size_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Q_Integer_64;
      pragma Import (C, size_0_virtual,
                     "__Qt4Ada_QIODevice_size_0_virtual");

   function Create
    (Object : not null Qt_Ada.Internals.Objects.QObject_Access)
       return not null Qt_Ada.Internals.Objects.Q_Object_Base_Access;

   function open_virtual
    (This : not null access Qt_Ada.Internals.Objects.QObject;
     Mode : Qt4.IO_Devices.Open_Mode)
       return Qt4.bool;
   pragma Import (C, open_virtual, "__Qt4Ada_QIODevice_open_virtual");

   ----------
   -- Open --
   ----------

   overriding function Open
    (Self : not null access Q_IO_Device_Proxy;
     Mode : Qt4.IO_Devices.Open_Mode)
       return Boolean is
   begin
      return Qt4.To_Boolean (open_virtual (Self.QObject_View, Mode));
   end Open;

   pragma Style_Checks ("N");

   ------------
   -- At_End --
   ------------

   function At_End
    (Self : not null access constant Q_IO_Device_Proxy)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (atEnd_0_virtual
           (Q_IO_Device_Proxy'Class (Self.all).QObject_View));
   end At_End;

   ---------------------
   -- Bytes_Available --
   ---------------------

   function Bytes_Available
    (Self : not null access constant Q_IO_Device_Proxy)
       return Qt4.Q_Integer_64
   is
   begin
      return
        bytesAvailable_0_virtual
         (Q_IO_Device_Proxy'Class (Self.all).QObject_View);
   end Bytes_Available;

   --------------------
   -- Bytes_To_Write --
   --------------------

   function Bytes_To_Write
    (Self : not null access constant Q_IO_Device_Proxy)
       return Qt4.Q_Integer_64
   is
   begin
      return
        bytesToWrite_0_virtual
         (Q_IO_Device_Proxy'Class (Self.all).QObject_View);
   end Bytes_To_Write;

   -------------------
   -- Can_Read_Line --
   -------------------

   function Can_Read_Line
    (Self : not null access constant Q_IO_Device_Proxy)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (canReadLine_0_virtual
           (Q_IO_Device_Proxy'Class (Self.all).QObject_View));
   end Can_Read_Line;

   -----------
   -- Close --
   -----------

   procedure Close
    (Self : not null access Q_IO_Device_Proxy)
   is
   begin
      close_0_virtual
       (Q_IO_Device_Proxy'Class (Self.all).QObject_View);
   end Close;

   -------------------
   -- Is_Sequential --
   -------------------

   function Is_Sequential
    (Self : not null access constant Q_IO_Device_Proxy)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isSequential_0_virtual
           (Q_IO_Device_Proxy'Class (Self.all).QObject_View));
   end Is_Sequential;

   ---------
   -- Pos --
   ---------

   function Pos
    (Self : not null access constant Q_IO_Device_Proxy)
       return Qt4.Q_Integer_64
   is
   begin
      return
        pos_0_virtual
         (Q_IO_Device_Proxy'Class (Self.all).QObject_View);
   end Pos;

   -----------
   -- Reset --
   -----------

   function Reset
    (Self : not null access Q_IO_Device_Proxy)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (reset_0_virtual
           (Q_IO_Device_Proxy'Class (Self.all).QObject_View));
   end Reset;

   ----------
   -- Seek --
   ----------

   function Seek
    (Self : not null access Q_IO_Device_Proxy;
     Pos : Qt4.Q_Integer_64)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (seek_0_virtual
           (Q_IO_Device_Proxy'Class (Self.all).QObject_View,
            Pos));
   end Seek;

   ----------
   -- Size --
   ----------

   function Size
    (Self : not null access constant Q_IO_Device_Proxy)
       return Qt4.Q_Integer_64
   is
   begin
      return
        size_0_virtual
         (Q_IO_Device_Proxy'Class (Self.all).QObject_View);
   end Size;

   type Q_IO_Device_Proxy_Access is
     access all Q_IO_Device_Proxy'Class;

   ------------
   -- Create --
   ------------

   function Create
    (Object : not null Qt_Ada.Internals.Objects.QObject_Access)
       return not null Qt_Ada.Internals.Objects.Q_Object_Base_Access
   is
      Self : constant not null Q_IO_Device_Proxy_Access
        := new Q_IO_Device_Proxy;

   begin
      Qt_Ada.Internals.Objects.Initialize (Self, Object);

      return Qt_Ada.Internals.Objects.Q_Object_Base_Access (Self);
   end Create;

begin
   Qt_Ada.Internals.Object_Registry.Register_Proxy
    ("QIODevice", Create'Access);
end Qt_Ada.Internals.Objects.IO_Device_Proxies;
