------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008 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);
with Qt_Ada.Internals.Objects.Object_Utilities;

package body Qt_Ada.Internals.Objects.Abstract_Proxy_Model_Proxies is

   procedure mapFromSource_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Source_Index : not null access constant Qt4.Model_Indices.Internals.QModelIndex;
     Returns : not null access Qt4.Model_Indices.Internals.QModelIndex);
      pragma Import (C, mapFromSource_0_virtual,
                     "__Qt4Ada_QAbstractProxyModel_mapFromSource_0_virtual");

   procedure mapSelectionFromSource_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Source_Selection : not null access constant Qt4.Item_Selections.Thin.QItemSelection;
     Returns : out Qt4.Item_Selections.Thin.QItemSelection);
      pragma Import (C, mapSelectionFromSource_0_virtual,
                     "__Qt4Ada_QAbstractProxyModel_mapSelectionFromSource_0_virtual");

   procedure mapSelectionToSource_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Proxy_Selection : not null access constant Qt4.Item_Selections.Thin.QItemSelection;
     Returns : out Qt4.Item_Selections.Thin.QItemSelection);
      pragma Import (C, mapSelectionToSource_0_virtual,
                     "__Qt4Ada_QAbstractProxyModel_mapSelectionToSource_0_virtual");

   procedure mapToSource_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Proxy_Index : not null access constant Qt4.Model_Indices.Internals.QModelIndex;
     Returns : not null access Qt4.Model_Indices.Internals.QModelIndex);
      pragma Import (C, mapToSource_0_virtual,
                     "__Qt4Ada_QAbstractProxyModel_mapToSource_0_virtual");

   procedure setSourceModel_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Source_Model : access Qt_Ada.Internals.Objects.QObject);
      pragma Import (C, setSourceModel_0_virtual,
                     "__Qt4Ada_QAbstractProxyModel_setSourceModel_0_virtual");

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

   pragma Style_Checks ("N");

   ---------------------
   -- Map_From_Source --
   ---------------------

   function Map_From_Source
    (Self : not null access Q_Abstract_Proxy_Model_Proxy;
     Source_Index : Qt4.Model_Indices.Q_Model_Index)
       return Qt4.Model_Indices.Q_Model_Index
   is
      Returns : Qt4.Model_Indices.Q_Model_Index;

   begin
      mapFromSource_0_virtual
       (Q_Abstract_Proxy_Model_Proxy'Class (Self.all).QObject_View,
        Qt4.Model_Indices.Internals.QModelIndex_View (Source_Index),
        Qt4.Model_Indices.Internals.QModelIndex_View (Returns));

      return Returns;
   end Map_From_Source;

   -------------------------------
   -- Map_Selection_From_Source --
   -------------------------------

   function Map_Selection_From_Source
    (Self : not null access constant Q_Abstract_Proxy_Model_Proxy;
     Source_Selection : Qt4.Item_Selections.Q_Item_Selection)
       return Qt4.Item_Selections.Q_Item_Selection
   is
      Returns : Qt4.Item_Selections.Q_Item_Selection;

   begin
      mapSelectionFromSource_0_virtual
       (Q_Abstract_Proxy_Model_Proxy'Class (Self.all).QObject_View,
        Qt4.Item_Selections.Internals.QItemSelection_View (Source_Selection),
        Qt4.Item_Selections.Internals.QItemSelection_View (Returns).all);

      return Returns;
   end Map_Selection_From_Source;

   -----------------------------
   -- Map_Selection_To_Source --
   -----------------------------

   function Map_Selection_To_Source
    (Self : not null access constant Q_Abstract_Proxy_Model_Proxy;
     Proxy_Selection : Qt4.Item_Selections.Q_Item_Selection)
       return Qt4.Item_Selections.Q_Item_Selection
   is
      Returns : Qt4.Item_Selections.Q_Item_Selection;

   begin
      mapSelectionToSource_0_virtual
       (Q_Abstract_Proxy_Model_Proxy'Class (Self.all).QObject_View,
        Qt4.Item_Selections.Internals.QItemSelection_View (Proxy_Selection),
        Qt4.Item_Selections.Internals.QItemSelection_View (Returns).all);

      return Returns;
   end Map_Selection_To_Source;

   -------------------
   -- Map_To_Source --
   -------------------

   function Map_To_Source
    (Self : not null access Q_Abstract_Proxy_Model_Proxy;
     Proxy_Index : Qt4.Model_Indices.Q_Model_Index)
       return Qt4.Model_Indices.Q_Model_Index
   is
      Returns : Qt4.Model_Indices.Q_Model_Index;

   begin
      mapToSource_0_virtual
       (Q_Abstract_Proxy_Model_Proxy'Class (Self.all).QObject_View,
        Qt4.Model_Indices.Internals.QModelIndex_View (Proxy_Index),
        Qt4.Model_Indices.Internals.QModelIndex_View (Returns));

      return Returns;
   end Map_To_Source;

   ----------------------
   -- Set_Source_Model --
   ----------------------

   procedure Set_Source_Model
    (Self : not null access Q_Abstract_Proxy_Model_Proxy;
     Source_Model : access Qt4.Abstract_Item_Models.Q_Abstract_Item_Model'Class)
   is
   begin
      setSourceModel_0_virtual
       (Q_Abstract_Proxy_Model_Proxy'Class (Self.all).QObject_View,
        Qt_Ada.Internals.Objects.Object_Utilities.Corresponding_QObject (Source_Model));
   end Set_Source_Model;

   type Q_Abstract_Proxy_Model_Proxy_Access is
     access all Q_Abstract_Proxy_Model_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_Abstract_Proxy_Model_Proxy_Access
        := new Q_Abstract_Proxy_Model_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
    ("QAbstractProxyModel", Create'Access);
end Qt_Ada.Internals.Objects.Abstract_Proxy_Model_Proxies;
