------------------------------------------------------------------------------
--                                                                          --
--                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.                                      --
--                                                                          --
------------------------------------------------------------------------------
--  $Revision$ $Date$
------------------------------------------------------------------------------
with Qt4.Layouts;
pragma Warnings (Off, Qt4.Layouts);
--  For full type visibility. GCC 4.3 issue incorrect warning.
with Qt4.Widgets;
pragma Warnings (Off, Qt4.Widgets);
--  For full type visibility. GCC 4.3 issue incorrect warning.
with Qt_Ada.Internals.Objects;

package body Qt4.Layout_Items.Impl is

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> hasHeightForWidth_0_dispatch
   --!    <Purpose> Подпрограмма диспетчеризации вызова виртуальной функции
   --! QLayout::hasHeightForWidth.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function hasHeightForWidth_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return Qt4.bool;
   pragma Export (C,
                  hasHeightForWidth_0_dispatch,
                  "__Qt4Ada_QLayoutItem_hasHeightForWidth_0_dispatch");
   pragma Warnings (Off, hasHeightForWidth_0_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> heightForWidth_0_dispatch
   --!    <Purpose> Подпрограмма диспетчеризации вызова виртуальной функции
   --! QLayout::heightForWidth.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function heightForWidth_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class;
     W    : Qt4.Q_Integer)
       return Qt4.Q_Integer;
   pragma Export (C,
                  heightForWidth_0_dispatch,
                  "__Qt4Ada_QLayoutItem_heightForWidth_0_dispatch");
   pragma Warnings (Off, heightForWidth_0_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> invalidate_0_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова виртуальной функции
   --! QLayoutItem::invalidate.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   procedure invalidate_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class);
   pragma Export (C,
                  invalidate_0_dispatch,
                  "__Qt4Ada_QLayoutItem_invalidate_0_dispatch");
   pragma Warnings (Off, invalidate_0_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> isEmpty_0_dispatch
   --!    <Purpose> Подпрограмма диспетчеризации вызова виртуальной функции
   --! QLayout::isEmpty.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function isEmpty_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return Qt4.bool;
   pragma Export (C,
                  isEmpty_0_dispatch,
                  "__Qt4Ada_QLayoutItem_isEmpty_0_dispatch");
   pragma Warnings (Off, isEmpty_0_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> layout_0_dispatch
   --!    <Purpose>
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function layout_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Export (C, layout_0_dispatch,
                  "__Qt4Ada_QLayoutItem_layout_0_dispatch");
   pragma Warnings (Off, layout_0_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> maximumSize_0_dispatch
   --!    <Purpose>
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function maximumSize_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return not null access Qt4.Sizes.Internals.QSize;
   pragma Export (C, maximumSize_0_dispatch,
                     "__Qt4Ada_QLayoutItem_maximumSize_0_dispatch");
   pragma Warnings (Off, maximumSize_0_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> minimumHeightForWidth_0_dispatch
   --!    <Purpose> Подпрограмма диспетчеризации вызова виртуальной функции
   --! QLayoutItem::minimumHeightForWidth.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function minimumHeightForWidth_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class;
     W    : Qt4.Q_Integer)
       return Qt4.Q_Integer;
   pragma Export (C,
                  minimumHeightForWidth_0_dispatch,
                  "__Qt4Ada_QLayoutItem_minimumHeightForWidth_0_dispatch");
   pragma Warnings (Off, minimumHeightForWidth_0_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> minimumSize_0_dispatch
   --!    <Purpose>
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function minimumSize_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return not null access Qt4.Sizes.Internals.QSize;
   pragma Export (C, minimumSize_0_dispatch,
                     "__Qt4Ada_QLayoutItem_minimumSize_0_dispatch");
   pragma Warnings (Off, minimumSize_0_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> sizeHint_0_dispatch
   --!    <Purpose>
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function sizeHint_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return not null access Qt4.Sizes.Internals.QSize;
   pragma Export (C, sizeHint_0_dispatch,
                     "__Qt4Ada_QLayoutItem_sizeHint_0_dispatch");
   pragma Warnings (Off, sizeHint_0_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> widget_0_dispatch
   --!    <Purpose>
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function widget_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Export (C, widget_0_dispatch,
                  "__Qt4Ada_QLayoutItem_widget_0_dispatch");
   pragma Warnings (Off, widget_0_dispatch);

   ---------------
   -- Internals --
   ---------------

   package body Internals is

      pragma Warnings (Off);

      function Create_Wrapper (Item : not null access Thin.QLayoutItem)
        return not null access Q_Layout_Item_Impl_Base'Class
      is
      begin
         raise Program_Error;
         return null;
      end Create_Wrapper;

      pragma Warnings (On);

   end Internals;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> hasHeightForWidth_0_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function hasHeightForWidth_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return Qt4.bool
   is
   begin
      return
        To_bool
         (Q_Layout_Item_Impl_Base'Class (Self.all).Has_Height_For_Width);
   end hasHeightForWidth_0_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> heightForWidth_0_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function heightForWidth_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class;
     W    : Qt4.Q_Integer)
       return Qt4.Q_Integer
   is
   begin
      return Q_Layout_Item_Impl_Base'Class (Self.all).Height_For_Width (W);
   end heightForWidth_0_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> invalidate_0_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   procedure invalidate_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
   is
   begin
      Q_Layout_Item_Impl_Base'Class (Self.all).Invalidate;
   end invalidate_0_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> isEmpty_0_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function isEmpty_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return Qt4.bool
   is
   begin
      return
        To_bool
         (Q_Layout_Item_Impl_Base'Class (Self.all).Is_Empty);
   end isEmpty_0_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> layout_0_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function layout_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return not null access Qt_Ada.Internals.Objects.QObject
   is
   begin
      return
        Q_Layout_Item_Impl_Base'Class (Self.all).Layout.QObject_View;
--        Qt_Ada.Internals.Objects.Q_Object_Base'Class
--         (Q_Layout_Item_Impl_Base'Class (Self.all).Layout.all).QObject_View;
   end layout_0_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> maximumSize_0_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function maximumSize_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return not null access Qt4.Sizes.Internals.QSize
   is
   begin
      return
        Qt4.Sizes.Thin.copy_QSize
         (Qt4.Sizes.Internals.QSize_View
           (Q_Layout_Item_Impl_Base'Class (Self.all).Maximum_Size));
   end maximumSize_0_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> minimumHeightForWidth_0_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function minimumHeightForWidth_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class;
     W    : Qt4.Q_Integer)
       return Qt4.Q_Integer
   is
   begin
      return
        Q_Layout_Item_Impl_Base'Class (Self.all).Minimum_Height_For_Width (W);
   end minimumHeightForWidth_0_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> minimumSize_0_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function minimumSize_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return not null access Qt4.Sizes.Internals.QSize
   is
   begin
      return
        Qt4.Sizes.Thin.copy_QSize
         (Qt4.Sizes.Internals.QSize_View
           (Q_Layout_Item_Impl_Base'Class (Self.all).Minimum_Size));
   end minimumSize_0_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> sizeHint_0_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function sizeHint_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return not null access Qt4.Sizes.Internals.QSize
   is
   begin
      return
        Qt4.Sizes.Thin.copy_QSize
         (Qt4.Sizes.Internals.QSize_View
           (Q_Layout_Item_Impl_Base'Class (Self.all).Size_Hint));
   end sizeHint_0_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> widget_0_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function widget_0_dispatch
    (Self : not null access Qt4_Entities.Limited_Entity'Class)
       return not null access Qt_Ada.Internals.Objects.QObject
   is
   begin
      return
        Q_Layout_Item_Impl_Base'Class (Self.all).Widget.QObject_View;
--        Qt4.Objects.Impl.Q_Object_Impl_Base'Class
--         (Q_Layout_Item_Impl_Base'Class (Self.all).Widget.all).QObject_View;
   end widget_0_dispatch;

end Qt4.Layout_Items.Impl;
