------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2007-2010 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.     --
------------------------------------------------------------------------------
private with Ada.Finalization;
private with Qt_Ada.Internals.Value_Class_Sizes;
with System;

package Qt4.Sizes is

   type Q_Size is tagged private;

   function Create
     return Q_Size;

   function Create
    (W : in Qt4.Q_Integer;
     H : in Qt4.Q_Integer)
       return Q_Size;

   function Bounded_To
    (Self : in Q_Size'Class;
     Other_Size : in Q_Size'Class)
       return Q_Size;

   function Expanded_To
    (Self : in Q_Size'Class;
     Other_Size : in Q_Size'Class)
       return Q_Size;

   function Height
    (Self : in Q_Size'Class)
       return Qt4.Q_Integer;

   function Is_Empty
    (Self : in Q_Size'Class)
       return Boolean;

   function Is_Null
    (Self : in Q_Size'Class)
       return Boolean;

   function Is_Valid
    (Self : in Q_Size'Class)
       return Boolean;

   procedure Scale
    (Self : in out Q_Size'Class;
     W : in Qt4.Q_Integer;
     H : in Qt4.Q_Integer;
     Mode : in Qt4.Aspect_Ratio_Mode);

   procedure Scale
    (Self : in out Q_Size'Class;
     S : in Q_Size'Class;
     Mode : in Qt4.Aspect_Ratio_Mode);

   procedure Set_Height
    (Self : in out Q_Size'Class;
     H : in Qt4.Q_Integer);

   procedure Set_Width
    (Self : in out Q_Size'Class;
     W : in Qt4.Q_Integer);

   procedure Transpose
    (Self : in out Q_Size'Class);

   function Width
    (Self : in Q_Size'Class)
       return Qt4.Q_Integer;

   function "="
    (S_1 : in Q_Size;
     S_2 : in Q_Size)
       return Boolean;

   function "+"
    (S_1 : in Q_Size;
     S_2 : in Q_Size)
       return Q_Size;

   function "-"
    (S_1 : in Q_Size;
     S_2 : in Q_Size)
       return Q_Size;

   function "*"
    (S : in Q_Size;
     Factor : in Qt4.Q_Real)
       return Q_Size;

   function "*"
    (Factor : in Qt4.Q_Real;
     S : in Q_Size)
       return Q_Size;

   function "/"
    (S : in Q_Size;
     Factor : in Qt4.Q_Real)
       return Q_Size;

   package Internals is

      type QSize is private;

      type QSize_Access is access all QSize;
      pragma Convention (C, QSize_Access);

      function QSize_View
       (Item : in Q_Size'Class)
          return QSize_Access;
      pragma Inline (QSize_View);

      function To_Pointer
       (Address : in System.Address)
          return QSize_Access;
      pragma Inline (To_Pointer);

      function To_Address
       (Pointer : in QSize_Access)
          return System.Address;
      pragma Inline (To_Address);

      function Create_Wrapper
       (Item : in Internals.QSize_Access)
          return Q_Size;

   private

      type QSize is record
         Placeholder : Interfaces.C.char_array (1 .. Qt_Ada.Internals.Value_Class_Sizes.QSize_C_Size_Of);
      end record;
      pragma Convention (C, QSize);

   end Internals;

   package Thin is

      function copy_QSize (Cpp_Object : not null access Internals.QSize)
        return not null access Internals.QSize;
      pragma Import (C, copy_QSize, "__Qt4Ada_copy_QSize");

   end Thin;

private

   type Q_Size is new Ada.Finalization.Controlled with record
      Storage : aliased Internals.QSize;
      Object  : Internals.QSize_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Adjust (Self : in out Q_Size);

   overriding
   procedure Finalize (Self : in out Q_Size);

   overriding
   procedure Initialize (Self : in out Q_Size);

end Qt4.Sizes;
