------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008-2011 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.Sql_Query_Model_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.Sql_Query_Model_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.Sql_Query_Models is

   procedure lastError_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Sql_Errors.Internals.QSqlError);
   pragma Import (C, lastError_0_wrapper,
                     "__Qt4Ada_QSqlQueryModel_lastError_0_wrapper");

   procedure query_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Sql_Queries.Internals.QSqlQuery);
   pragma Import (C, query_0_wrapper,
                     "__Qt4Ada_QSqlQueryModel_query_0_wrapper");

   procedure record_1_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Sql_Records.Internals.QSqlRecord);
   pragma Import (C, record_1_wrapper,
                     "__Qt4Ada_QSqlQueryModel_record_1_wrapper");

   procedure record_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Row : Qt4.Q_Integer;
     Returns : not null access Qt4.Sql_Records.Internals.QSqlRecord);
   pragma Import (C, record_0_wrapper,
                     "__Qt4Ada_QSqlQueryModel_record_0_wrapper");

   procedure setQuery_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Query : not null access constant Qt4.Sql_Queries.Internals.QSqlQuery);
   pragma Import (C, setQuery_0_wrapper,
                     "__Qt4Ada_QSqlQueryModel_setQuery_0_wrapper");

   pragma Style_Checks ("N");

   ----------------
   -- Last_Error --
   ----------------

   function Last_Error
    (Self : not null access constant Q_Sql_Query_Model'Class)
       return Qt4.Sql_Errors.Q_Sql_Error
   is
      Returns : Qt4.Sql_Errors.Q_Sql_Error;

   begin
      lastError_0_wrapper
       (Self.QObject_View,
        Qt4.Sql_Errors.Internals.QSqlError_View (Returns));

      return Returns;
   end Last_Error;

   -----------
   -- Query --
   -----------

   function Query
    (Self : not null access constant Q_Sql_Query_Model'Class)
       return Qt4.Sql_Queries.Q_Sql_Query
   is
      Returns : Qt4.Sql_Queries.Q_Sql_Query;

   begin
      query_0_wrapper
       (Self.QObject_View,
        Qt4.Sql_Queries.Internals.QSqlQuery_View (Returns));

      return Returns;
   end Query;

   ----------------
   -- Get_Record --
   ----------------

   function Get_Record
    (Self : not null access constant Q_Sql_Query_Model'Class)
       return Qt4.Sql_Records.Q_Sql_Record
   is
      Returns : Qt4.Sql_Records.Q_Sql_Record;

   begin
      record_1_wrapper
       (Self.QObject_View,
        Qt4.Sql_Records.Internals.QSqlRecord_View (Returns));

      return Returns;
   end Get_Record;

   ----------------
   -- Get_Record --
   ----------------

   function Get_Record
    (Self : not null access constant Q_Sql_Query_Model'Class;
     Row : Qt4.Q_Integer)
       return Qt4.Sql_Records.Q_Sql_Record
   is
      Returns : Qt4.Sql_Records.Q_Sql_Record;

   begin
      record_0_wrapper
       (Self.QObject_View,
        Row,
        Qt4.Sql_Records.Internals.QSqlRecord_View (Returns));

      return Returns;
   end Get_Record;

   ---------------
   -- Set_Query --
   ---------------

   procedure Set_Query
    (Self : not null access Q_Sql_Query_Model'Class;
     Query : Qt4.Sql_Queries.Q_Sql_Query)
   is
   begin
      setQuery_0_wrapper
       (Self.QObject_View,
        Qt4.Sql_Queries.Internals.QSqlQuery_View (Query));
   end Set_Query;

end Qt4.Sql_Query_Models;
