------------------------------------------------------------------------------
--                                                                          --
--                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.                                      --
--                                                                          --
------------------------------------------------------------------------------
--    This file has been generated automatically. Please don't edit it.     --
------------------------------------------------------------------------------
with Qt4.Abstract_Item_Models;
with Qt_Ada.Internals.Object_Registry;
with Qt_Ada.Internals.Objects;

with Qt_Ada.Internals.Objects.Item_Selection_Model_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.Item_Selection_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.Item_Selection_Models is

   function columnIntersectsSelection_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Column : Qt4.Q_Integer;
     Parent : not null access constant Qt4.Model_Indices.Internals.QModelIndex)
       return Qt4.bool;
   pragma Import (C, columnIntersectsSelection_0_wrapper,
                     "__Qt4Ada_QItemSelectionModel_columnIntersectsSelection_0_wrapper");

   procedure currentIndex_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Model_Indices.Internals.QModelIndex);
   pragma Import (C, currentIndex_0_wrapper,
                     "__Qt4Ada_QItemSelectionModel_currentIndex_0_wrapper");

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

   function isColumnSelected_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Column : Qt4.Q_Integer;
     Parent : not null access constant Qt4.Model_Indices.Internals.QModelIndex)
       return Qt4.bool;
   pragma Import (C, isColumnSelected_0_wrapper,
                     "__Qt4Ada_QItemSelectionModel_isColumnSelected_0_wrapper");

   function isRowSelected_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Row : Qt4.Q_Integer;
     Parent : not null access constant Qt4.Model_Indices.Internals.QModelIndex)
       return Qt4.bool;
   pragma Import (C, isRowSelected_0_wrapper,
                     "__Qt4Ada_QItemSelectionModel_isRowSelected_0_wrapper");

   function isSelected_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Index : not null access constant Qt4.Model_Indices.Internals.QModelIndex)
       return Qt4.bool;
   pragma Import (C, isSelected_0_wrapper,
                     "__Qt4Ada_QItemSelectionModel_isSelected_0_wrapper");

   function model_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, model_0_wrapper,
                     "__Qt4Ada_QItemSelectionModel_model_0_wrapper");

   function rowIntersectsSelection_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Row : Qt4.Q_Integer;
     Parent : not null access constant Qt4.Model_Indices.Internals.QModelIndex)
       return Qt4.bool;
   pragma Import (C, rowIntersectsSelection_0_wrapper,
                     "__Qt4Ada_QItemSelectionModel_rowIntersectsSelection_0_wrapper");

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

   procedure setCurrentIndex_wrapper
    (Self    : not null access Qt_Ada.Internals.Objects.QObject;
     Index   : not null Qt4.Model_Indices.Internals.QModelIndex_Access;
     Command : Selection_Flags);
   pragma Import
    (C, setCurrentIndex_wrapper,
     "__QtAda_QItemSelectionModel_setCurrentIndex_wrapper");

   -----------------------
   -- Set_Current_Index --
   -----------------------

   procedure Set_Current_Index
    (Self    : not null access Q_Item_Selection_Model'Class;
     Index   : Qt4.Model_Indices.Q_Model_Index;
     Command : Selection_Flags)
   is
   begin
      setCurrentIndex_wrapper
       (Self.QObject_View,
        Qt4.Model_Indices.Internals.QModelIndex_View (Index),
        Command);
   end Set_Current_Index;

   pragma Style_Checks ("N");

   ---------------------------------
   -- Column_Intersects_Selection --
   ---------------------------------

   function Column_Intersects_Selection
    (Self : not null access constant Q_Item_Selection_Model'Class;
     Column : Qt4.Q_Integer;
     Parent : Qt4.Model_Indices.Q_Model_Index)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (columnIntersectsSelection_0_wrapper
           (Self.QObject_View,
            Column,
            Qt4.Model_Indices.Internals.QModelIndex_View (Parent)));
   end Column_Intersects_Selection;

   -------------------
   -- Current_Index --
   -------------------

   function Current_Index
    (Self : not null access constant Q_Item_Selection_Model'Class)
       return Qt4.Model_Indices.Q_Model_Index
   is
      Returns : Qt4.Model_Indices.Q_Model_Index;

   begin
      currentIndex_0_wrapper
       (Self.QObject_View,
        Qt4.Model_Indices.Internals.QModelIndex_View (Returns));

      return Returns;
   end Current_Index;

   -------------------
   -- Has_Selection --
   -------------------

   function Has_Selection
    (Self : not null access constant Q_Item_Selection_Model'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (hasSelection_0_wrapper
           (Self.QObject_View));
   end Has_Selection;

   ------------------------
   -- Is_Column_Selected --
   ------------------------

   function Is_Column_Selected
    (Self : not null access constant Q_Item_Selection_Model'Class;
     Column : Qt4.Q_Integer;
     Parent : Qt4.Model_Indices.Q_Model_Index)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isColumnSelected_0_wrapper
           (Self.QObject_View,
            Column,
            Qt4.Model_Indices.Internals.QModelIndex_View (Parent)));
   end Is_Column_Selected;

   ---------------------
   -- Is_Row_Selected --
   ---------------------

   function Is_Row_Selected
    (Self : not null access constant Q_Item_Selection_Model'Class;
     Row : Qt4.Q_Integer;
     Parent : Qt4.Model_Indices.Q_Model_Index)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isRowSelected_0_wrapper
           (Self.QObject_View,
            Row,
            Qt4.Model_Indices.Internals.QModelIndex_View (Parent)));
   end Is_Row_Selected;

   -----------------
   -- Is_Selected --
   -----------------

   function Is_Selected
    (Self : not null access constant Q_Item_Selection_Model'Class;
     Index : Qt4.Model_Indices.Q_Model_Index)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isSelected_0_wrapper
           (Self.QObject_View,
            Qt4.Model_Indices.Internals.QModelIndex_View (Index)));
   end Is_Selected;

   -----------
   -- Model --
   -----------

   function Model
    (Self : not null access constant Q_Item_Selection_Model'Class)
       return not null access Qt4.Abstract_Item_Models.Q_Abstract_Item_Model'Class
   is
   begin
      return
        Qt4.Abstract_Item_Models.Q_Abstract_Item_Model'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (model_0_wrapper
             (Self.QObject_View)).all)'Access;
   end Model;

   ------------------------------
   -- Row_Intersects_Selection --
   ------------------------------

   function Row_Intersects_Selection
    (Self : not null access constant Q_Item_Selection_Model'Class;
     Row : Qt4.Q_Integer;
     Parent : Qt4.Model_Indices.Q_Model_Index)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (rowIntersectsSelection_0_wrapper
           (Self.QObject_View,
            Row,
            Qt4.Model_Indices.Internals.QModelIndex_View (Parent)));
   end Row_Intersects_Selection;

   ---------------------
   -- Clear_Selection --
   ---------------------

   procedure Clear_Selection
    (Self : not null access Q_Item_Selection_Model'Class)
   is
   begin
      clearSelection_0_wrapper
       (Self.QObject_View);
   end Clear_Selection;

end Qt4.Item_Selection_Models;
