------------------------------------------------------------------------------
--                                                                          --
--                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;
with Qt_Ada.Internals.Objects;

with Qt_Ada.Internals.Objects.Signal_Mapper_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.Signal_Mapper_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.Signal_Mappers is

   procedure setMapping_2_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Sender : not null access Qt_Ada.Internals.Objects.QObject;
     Id : Qt4.Q_Integer);
   pragma Import (C, setMapping_2_wrapper,
                     "__Qt4Ada_QSignalMapper_setMapping_2_wrapper");

   procedure setMapping_1_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Sender : not null access Qt_Ada.Internals.Objects.QObject;
     Text : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, setMapping_1_wrapper,
                     "__Qt4Ada_QSignalMapper_setMapping_1_wrapper");

   procedure setMapping_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Sender : not null access Qt_Ada.Internals.Objects.QObject;
     Object : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, setMapping_0_wrapper,
                     "__Qt4Ada_QSignalMapper_setMapping_0_wrapper");

   procedure removeMappings_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Sender : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, removeMappings_0_wrapper,
                     "__Qt4Ada_QSignalMapper_removeMappings_0_wrapper");

   function mapping_2_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Id : Qt4.Q_Integer)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, mapping_2_wrapper,
                     "__Qt4Ada_QSignalMapper_mapping_2_wrapper");

   function mapping_1_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Text : not null access constant Qt4.Strings.Internals.QString)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, mapping_1_wrapper,
                     "__Qt4Ada_QSignalMapper_mapping_1_wrapper");

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

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

   procedure map_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Sender : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, map_0_wrapper,
                     "__Qt4Ada_QSignalMapper_map_0_wrapper");

   pragma Style_Checks ("N");

   -----------------
   -- Set_Mapping --
   -----------------

   procedure Set_Mapping
    (Self : not null access Q_Signal_Mapper'Class;
     Sender : not null access Qt4.Objects.Q_Object'Class;
     Id : Qt4.Q_Integer)
   is
   begin
      setMapping_2_wrapper
       (Self.QObject_View,
        Sender.QObject_View,
        Id);
   end Set_Mapping;

   -----------------
   -- Set_Mapping --
   -----------------

   procedure Set_Mapping
    (Self : not null access Q_Signal_Mapper'Class;
     Sender : not null access Qt4.Objects.Q_Object'Class;
     Text : Qt4.Strings.Q_String)
   is
   begin
      setMapping_1_wrapper
       (Self.QObject_View,
        Sender.QObject_View,
        Qt4.Strings.Internals.QString_View (Text));
   end Set_Mapping;

   -----------------
   -- Set_Mapping --
   -----------------

   procedure Set_Mapping
    (Self : not null access Q_Signal_Mapper'Class;
     Sender : not null access Qt4.Objects.Q_Object'Class;
     Object : not null access Qt4.Objects.Q_Object'Class)
   is
   begin
      setMapping_0_wrapper
       (Self.QObject_View,
        Sender.QObject_View,
        Object.QObject_View);
   end Set_Mapping;

   ---------------------
   -- Remove_Mappings --
   ---------------------

   procedure Remove_Mappings
    (Self : not null access Q_Signal_Mapper'Class;
     Sender : not null access Qt4.Objects.Q_Object'Class)
   is
   begin
      removeMappings_0_wrapper
       (Self.QObject_View,
        Sender.QObject_View);
   end Remove_Mappings;

   -------------
   -- Mapping --
   -------------

   function Mapping
    (Self : not null access constant Q_Signal_Mapper'Class;
     Id : Qt4.Q_Integer)
       return not null access Qt4.Objects.Q_Object'Class
   is
   begin
      return
        Qt4.Objects.Q_Object'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (mapping_2_wrapper
             (Self.QObject_View,
              Id)).all)'Access;
   end Mapping;

   -------------
   -- Mapping --
   -------------

   function Mapping
    (Self : not null access constant Q_Signal_Mapper'Class;
     Text : Qt4.Strings.Q_String)
       return not null access Qt4.Objects.Q_Object'Class
   is
   begin
      return
        Qt4.Objects.Q_Object'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (mapping_1_wrapper
             (Self.QObject_View,
              Qt4.Strings.Internals.QString_View (Text))).all)'Access;
   end Mapping;

   -------------
   -- Mapping --
   -------------

   function Mapping
    (Self : not null access constant Q_Signal_Mapper'Class;
     Object : not null access Qt4.Objects.Q_Object'Class)
       return not null access Qt4.Objects.Q_Object'Class
   is
   begin
      return
        Qt4.Objects.Q_Object'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (mapping_0_wrapper
             (Self.QObject_View,
              Object.QObject_View)).all)'Access;
   end Mapping;

   ---------
   -- Map --
   ---------

   procedure Map
    (Self : not null access Q_Signal_Mapper'Class)
   is
   begin
      map_1_wrapper
       (Self.QObject_View);
   end Map;

   ---------
   -- Map --
   ---------

   procedure Map
    (Self : not null access Q_Signal_Mapper'Class;
     Sender : not null access Qt4.Objects.Q_Object'Class)
   is
   begin
      map_0_wrapper
       (Self.QObject_View,
        Sender.QObject_View);
   end Map;

end Qt4.Signal_Mappers;
