------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008, 2009 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.                                      --
--                                                                          --
------------------------------------------------------------------------------
--  $Revision: 3118 $ $Date: 2009-02-09 14:56:57 +0300 (Mon, 09 Feb 2009) $
------------------------------------------------------------------------------
with Qt_Ada.Internals.Generic_Q_Flags;

package Qt4.Sql is

   type Location is
    (After_Last_Row,
     Before_First_Row);
   pragma Convention (C, Location);
   for Location'Size use Interfaces.C.int'Size;
   for Location use
    (After_Last_Row   => -2,
     Before_First_Row => -1);

   type Numerical_Precision_Policy is
    (High_Precision,
     Low_Precision_Int_32,
     Low_Precision_Int_64,
     Low_Precision_Double);
   pragma Convention (C, Numerical_Precision_Policy);
   for Numerical_Precision_Policy'Size use Interfaces.C.unsigned'Size;
   for Numerical_Precision_Policy use
    (High_Precision       => 0,
     Low_Precision_Int_32 => 16#1#,
     Low_Precision_Int_64 => 16#2#,
     Low_Precision_Double => 16#4#);

   --  QSql::TableType

   type Table_Type is
    (Tables,
     System_Tables,
     Views,
     All_Tables);
   pragma Convention (C, Table_Type);
   for Table_Type'Size use Interfaces.C.unsigned'Size;
   for Table_Type use
    (Tables        => 1,
     System_Tables => 2,
     Views         => 4,
     All_Tables    => 255);

   --  QSql::ParamTypeFlag

   type Param_Type_Flag is
    (In_Parameter,
     Out_Parameter,
     In_Out_Parameter,
     Binary_Parameter);
   pragma Convention (C, Param_Type_Flag);
   for Param_Type_Flag'Size use Interfaces.C.unsigned'Size;
   for Param_Type_Flag use
    (In_Parameter     => 1,
     Out_Parameter    => 2,
     In_Out_Parameter => 3,
     Binary_Parameter => 4);

   --  Qt::ParamType

   package Q_Flags_Of_Param_Type_Flag is
     new Qt_Ada.Internals.Generic_Q_Flags (Param_Type_Flag);

   type Param_Type is new Q_Flags_Of_Param_Type_Flag.Flags;

end Qt4.Sql;
