------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008-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;
with Qt4.Brushes;
with Qt4.Colors;
private with Qt_Ada.Internals.Value_Class_Sizes;
with System;

package Qt4.Pens is

   type Q_Pen is tagged private;

   function Create return Q_Pen;

   function Create
    (Style : Qt4.Pen_Style)
       return Q_Pen;

   function Create
    (Color : Qt4.Colors.Q_Color'Class)
       return Q_Pen;

   function Create
    (Brush : Qt4.Brushes.Q_Brush'Class;
     Width : Qt4.Q_Real;
     S : Qt4.Pen_Style
       := Solid_Line;
     C : Qt4.Pen_Cap_Style
       := Square_Cap;
     J : Qt4.Pen_Join_Style
       := Bevel_Join)
       return Q_Pen;

   function Brush
    (Self : Q_Pen'Class)
       return Qt4.Brushes.Q_Brush;

   function Cap_Style
    (Self : Q_Pen'Class)
       return Qt4.Pen_Cap_Style;

   function Color
    (Self : Q_Pen'Class)
       return Qt4.Colors.Q_Color;

   function Dash_Offset
    (Self : Q_Pen'Class)
       return Qt4.Q_Real;

   function Is_Cosmetic
    (Self : Q_Pen'Class)
       return Boolean;

   function Is_Solid
    (Self : Q_Pen'Class)
       return Boolean;

   function Join_Style
    (Self : Q_Pen'Class)
       return Qt4.Pen_Join_Style;

   function Miter_Limit
    (Self : Q_Pen'Class)
       return Qt4.Q_Real;

   procedure Set_Brush
    (Self : in out Q_Pen'Class;
     Brush : Qt4.Brushes.Q_Brush'Class);

   procedure Set_Cap_Style
    (Self : in out Q_Pen'Class;
     Style : Qt4.Pen_Cap_Style);

   procedure Set_Color
    (Self : in out Q_Pen'Class;
     Color : Qt4.Colors.Q_Color'Class);

   procedure Set_Cosmetic
    (Self : in out Q_Pen'Class;
     Cosmetic : Boolean);

   procedure Set_Dash_Offset
    (Self : in out Q_Pen'Class;
     Doffset : Qt4.Q_Real);

   procedure Set_Join_Style
    (Self : in out Q_Pen'Class;
     Pcs : Qt4.Pen_Join_Style);

   procedure Set_Miter_Limit
    (Self : in out Q_Pen'Class;
     Limit : Qt4.Q_Real);

   procedure Set_Style
    (Self : in out Q_Pen'Class;
     Style : Qt4.Pen_Style);

   procedure Set_Width
    (Self : in out Q_Pen'Class;
     Width : Qt4.Q_Integer);

   procedure Set_Width_F
    (Self : in out Q_Pen'Class;
     Width : Qt4.Q_Real);

   function Style
    (Self : Q_Pen'Class)
       return Qt4.Pen_Style;

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

   function Width_F
    (Self : Q_Pen'Class)
       return Qt4.Q_Real;

   overriding function "="
    (Self : Q_Pen;
     Pen : Q_Pen)
       return Boolean;

   package Internals is

      type QPen is private;

      type QPen_Access is access all QPen;
      pragma Convention (C, QPen_Access);

      function QPen_View
       (Item : Q_Pen'Class)
          return QPen_Access;
      pragma Inline (QPen_View);

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

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

      function Create_Wrapper
       (Item : Internals.QPen_Access)
          return Q_Pen;

   private

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

   end Internals;

private

   type Q_Pen is new Ada.Finalization.Controlled with record
      Storage : aliased Internals.QPen;
      Object  : Internals.QPen_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Adjust (Self : in out Q_Pen);

   overriding
   procedure Finalize (Self : in out Q_Pen);

   overriding
   procedure Initialize (Self : in out Q_Pen);

end Qt4.Pens;
