------------------------------------------------------------------------------
--                                                                          --
--                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.Ui_Loader_Proxies is

   function createAction_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Parent : access Qt_Ada.Internals.Objects.QObject;
     Name : not null access constant Qt4.Strings.Internals.QString)
       return not null access Qt_Ada.Internals.Objects.QObject;
      pragma Import (C, createAction_0_virtual,
                     "__Qt4Ada_QUiLoader_createAction_0_virtual");

   function createLayout_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Class_Name : not null access constant Qt4.Strings.Internals.QString;
     Parent : access Qt_Ada.Internals.Objects.QObject;
     Name : not null access constant Qt4.Strings.Internals.QString)
       return not null access Qt_Ada.Internals.Objects.QObject;
      pragma Import (C, createLayout_0_virtual,
                     "__Qt4Ada_QUiLoader_createLayout_0_virtual");

   function createWidget_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Class_Name : not null access constant Qt4.Strings.Internals.QString;
     Parent : access Qt_Ada.Internals.Objects.QObject;
     Name : not null access constant Qt4.Strings.Internals.QString)
       return not null access Qt_Ada.Internals.Objects.QObject;
      pragma Import (C, createWidget_0_virtual,
                     "__Qt4Ada_QUiLoader_createWidget_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");

   -------------------
   -- Create_Action --
   -------------------

   function Create_Action
    (Self : not null access Q_Ui_Loader_Proxy;
     Parent : access Qt4.Objects.Q_Object'Class;
     Name : Qt4.Strings.Q_String)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (createAction_0_virtual
             (Q_Ui_Loader_Proxy'Class (Self.all).QObject_View,
              Qt_Ada.Internals.Objects.Object_Utilities.Corresponding_QObject (Parent),
              Qt4.Strings.Internals.QString_View (Name))).all)'Access;
   end Create_Action;

   -------------------
   -- Create_Layout --
   -------------------

   function Create_Layout
    (Self : not null access Q_Ui_Loader_Proxy;
     Class_Name : Qt4.Strings.Q_String;
     Parent : access Qt4.Objects.Q_Object'Class;
     Name : Qt4.Strings.Q_String)
       return not null access Qt4.Layouts.Q_Layout'Class
   is
   begin
      return
        Qt4.Layouts.Q_Layout'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (createLayout_0_virtual
             (Q_Ui_Loader_Proxy'Class (Self.all).QObject_View,
              Qt4.Strings.Internals.QString_View (Class_Name),
              Qt_Ada.Internals.Objects.Object_Utilities.Corresponding_QObject (Parent),
              Qt4.Strings.Internals.QString_View (Name))).all)'Access;
   end Create_Layout;

   -------------------
   -- Create_Widget --
   -------------------

   function Create_Widget
    (Self : not null access Q_Ui_Loader_Proxy;
     Class_Name : Qt4.Strings.Q_String;
     Parent : access Qt4.Widgets.Q_Widget'Class;
     Name : Qt4.Strings.Q_String)
       return not null access Qt4.Widgets.Q_Widget'Class
   is
   begin
      return
        Qt4.Widgets.Q_Widget'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (createWidget_0_virtual
             (Q_Ui_Loader_Proxy'Class (Self.all).QObject_View,
              Qt4.Strings.Internals.QString_View (Class_Name),
              Qt_Ada.Internals.Objects.Object_Utilities.Corresponding_QObject (Parent),
              Qt4.Strings.Internals.QString_View (Name))).all)'Access;
   end Create_Widget;

   type Q_Ui_Loader_Proxy_Access is
     access all Q_Ui_Loader_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_Ui_Loader_Proxy_Access
        := new Q_Ui_Loader_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
    ("QUiLoader", Create'Access);
end Qt_Ada.Internals.Objects.Ui_Loader_Proxies;
