------------------------------------------------------------------------------
--                                                                          --
--                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.Layout_Items.Impl;
with Qt4.Widgets;
with Qt_Ada.Internals.Object_Registry;
with Qt_Ada.Internals.Objects;

with Qt_Ada.Internals.Objects.Layout_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.Layout_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.Layouts is

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

   procedure addWidget_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     W : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, addWidget_0_wrapper,
                     "__Qt4Ada_QLayout_addWidget_0_wrapper");

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

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

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

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

   procedure removeItem_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Item : not null access Qt4.Layout_Items.Impl.Thin.QLayoutItem);
   pragma Import (C, removeItem_0_wrapper,
                     "__Qt4Ada_QLayout_removeItem_0_wrapper");

   procedure removeWidget_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Widget : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, removeWidget_0_wrapper,
                     "__Qt4Ada_QLayout_removeWidget_0_wrapper");

   procedure setContentsMargins_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Left : Qt4.Q_Integer;
     Top : Qt4.Q_Integer;
     Right : Qt4.Q_Integer;
     Bottom : Qt4.Q_Integer);
   pragma Import (C, setContentsMargins_0_wrapper,
                     "__Qt4Ada_QLayout_setContentsMargins_0_wrapper");

   procedure setEnabled_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Enable : Qt4.bool);
   pragma Import (C, setEnabled_0_wrapper,
                     "__Qt4Ada_QLayout_setEnabled_0_wrapper");

   procedure setMargin_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Margin : Qt4.Q_Integer);
   pragma Import (C, setMargin_0_wrapper,
                     "__Qt4Ada_QLayout_setMargin_0_wrapper");

   procedure setMenuBar_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Widget : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, setMenuBar_0_wrapper,
                     "__Qt4Ada_QLayout_setMenuBar_0_wrapper");

   procedure setSpacing_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Margin : Qt4.Q_Integer);
   pragma Import (C, setSpacing_0_wrapper,
                     "__Qt4Ada_QLayout_setSpacing_0_wrapper");

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

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

   pragma Style_Checks ("N");

   --------------
   -- Activate --
   --------------

   function Activate
    (Self : not null access Q_Layout'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (activate_0_wrapper
           (Self.QObject_View));
   end Activate;

   ----------------
   -- Add_Widget --
   ----------------

   procedure Add_Widget
    (Self : not null access Q_Layout'Class;
     W : not null access Qt4.Widgets.Q_Widget'Class)
   is
   begin
      addWidget_0_wrapper
       (Self.QObject_View,
        W.QObject_View);
   end Add_Widget;

   ----------------
   -- Is_Enabled --
   ----------------

   function Is_Enabled
    (Self : not null access constant Q_Layout'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isEnabled_0_wrapper
           (Self.QObject_View));
   end Is_Enabled;

   ------------
   -- Margin --
   ------------

   function Margin
    (Self : not null access constant Q_Layout'Class)
       return Qt4.Q_Integer
   is
   begin
      return
        margin_0_wrapper
         (Self.QObject_View);
   end Margin;

   --------------
   -- Menu_Bar --
   --------------

   function Menu_Bar
    (Self : not null access constant Q_Layout'Class)
       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
           (menuBar_0_wrapper
             (Self.QObject_View)).all)'Access;
   end Menu_Bar;

   -------------------
   -- Parent_Widget --
   -------------------

   function Parent_Widget
    (Self : not null access constant Q_Layout'Class)
       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
           (parentWidget_0_wrapper
             (Self.QObject_View)).all)'Access;
   end Parent_Widget;

   -----------------
   -- Remove_Item --
   -----------------

   procedure Remove_Item
    (Self : not null access Q_Layout'Class;
     Item : not null access Qt4.Layout_Items.Q_Layout_Item'Class)
   is
   begin
      removeItem_0_wrapper
       (Self.QObject_View,
        Qt4.Layout_Items.Impl.Q_Layout_Item_Impl_Base'Class (Item.all).QLayoutItem_View);
   end Remove_Item;

   -------------------
   -- Remove_Widget --
   -------------------

   procedure Remove_Widget
    (Self : not null access Q_Layout'Class;
     Widget : not null access Qt4.Widgets.Q_Widget'Class)
   is
   begin
      removeWidget_0_wrapper
       (Self.QObject_View,
        Widget.QObject_View);
   end Remove_Widget;

   --------------------------
   -- Set_Contents_Margins --
   --------------------------

   procedure Set_Contents_Margins
    (Self : not null access Q_Layout'Class;
     Left : Qt4.Q_Integer;
     Top : Qt4.Q_Integer;
     Right : Qt4.Q_Integer;
     Bottom : Qt4.Q_Integer)
   is
   begin
      setContentsMargins_0_wrapper
       (Self.QObject_View,
        Left,
        Top,
        Right,
        Bottom);
   end Set_Contents_Margins;

   -----------------
   -- Set_Enabled --
   -----------------

   procedure Set_Enabled
    (Self : not null access Q_Layout'Class;
     Enable : Standard.Boolean)
   is
   begin
      setEnabled_0_wrapper
       (Self.QObject_View,
        Qt4.To_bool (Enable));
   end Set_Enabled;

   ----------------
   -- Set_Margin --
   ----------------

   procedure Set_Margin
    (Self : not null access Q_Layout'Class;
     Margin : Qt4.Q_Integer)
   is
   begin
      setMargin_0_wrapper
       (Self.QObject_View,
        Margin);
   end Set_Margin;

   ------------------
   -- Set_Menu_Bar --
   ------------------

   procedure Set_Menu_Bar
    (Self : not null access Q_Layout'Class;
     Widget : not null access Qt4.Widgets.Q_Widget'Class)
   is
   begin
      setMenuBar_0_wrapper
       (Self.QObject_View,
        Widget.QObject_View);
   end Set_Menu_Bar;

   -----------------
   -- Set_Spacing --
   -----------------

   procedure Set_Spacing
    (Self : not null access Q_Layout'Class;
     Margin : Qt4.Q_Integer)
   is
   begin
      setSpacing_0_wrapper
       (Self.QObject_View,
        Margin);
   end Set_Spacing;

   -------------
   -- Spacing --
   -------------

   function Spacing
    (Self : not null access constant Q_Layout'Class)
       return Qt4.Q_Integer
   is
   begin
      return
        spacing_0_wrapper
         (Self.QObject_View);
   end Spacing;

   ------------
   -- Update --
   ------------

   procedure Update
    (Self : not null access Q_Layout'Class)
   is
   begin
      update_0_wrapper
       (Self.QObject_View);
   end Update;

end Qt4.Layouts;
