------------------------------------------------------------------------------
--                                                                          --
--                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.Colors;
limited with Qt4.Gradients;
with Qt4.Matrices;
with Qt4.Pixmaps;
with Qt4.Transforms;
private with Qt_Ada.Internals.Value_Class_Sizes;
with System;

package Qt4.Brushes is

   type Q_Brush is tagged private;

   function Create return Q_Brush;

   function Create
    (Bs : Qt4.Brush_Style)
       return Q_Brush;

   function Create
    (Color : Qt4.Colors.Q_Color'Class;
     Bs : Qt4.Brush_Style
       := Solid_Pattern)
       return Q_Brush;

   function Create
    (Color : Qt4.Global_Color;
     Bs : Qt4.Brush_Style
       := Solid_Pattern)
       return Q_Brush;

   function Create
    (Color : Qt4.Colors.Q_Color'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class)
       return Q_Brush;

   function Create
    (Color : Qt4.Global_Color;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class)
       return Q_Brush;

   function Create
    (Pixmap : Qt4.Pixmaps.Q_Pixmap'Class)
       return Q_Brush;

   function Create
    (Gradient : Qt4.Gradients.Q_Gradient'Class)
       return Q_Brush;

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

   function Is_Detached
    (Self : Q_Brush'Class)
       return Boolean;

   function Is_Opaque
    (Self : Q_Brush'Class)
       return Boolean;

   function Matrix
    (Self : Q_Brush'Class)
       return Qt4.Matrices.Q_Matrix;

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

   procedure Set_Color
    (Self : in out Q_Brush'Class;
     Color : Qt4.Global_Color);

   procedure Set_Matrix
    (Self : in out Q_Brush'Class;
     Mat : Qt4.Matrices.Q_Matrix'Class);

   procedure Set_Style
    (Self : in out Q_Brush'Class;
     Style : Qt4.Brush_Style);

   procedure Set_Texture
    (Self : in out Q_Brush'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class);

   procedure Set_Transform
    (Self : in out Q_Brush'Class;
     T : Qt4.Transforms.Q_Transform'Class);

   function Style
    (Self : Q_Brush'Class)
       return Qt4.Brush_Style;

   function Texture
    (Self : Q_Brush'Class)
       return Qt4.Pixmaps.Q_Pixmap;

   function Transform
    (Self : Q_Brush'Class)
       return Qt4.Transforms.Q_Transform;

   overriding function "="
    (Self : Q_Brush;
     B : Q_Brush)
       return Boolean;

   package Internals is

      type QBrush is private;

      type QBrush_Access is access all QBrush;
      pragma Convention (C, QBrush_Access);

      function QBrush_View
       (Item : Q_Brush'Class)
          return QBrush_Access;
      pragma Inline (QBrush_View);

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

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

      function Create_Wrapper
       (Item : Internals.QBrush_Access)
          return Q_Brush;

   private

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

   end Internals;

private

   type Q_Brush is new Ada.Finalization.Controlled with record
      Storage : aliased Internals.QBrush;
      Object  : Internals.QBrush_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Adjust (Self : in out Q_Brush);

   overriding
   procedure Finalize (Self : in out Q_Brush);

   overriding
   procedure Initialize (Self : in out Q_Brush);

end Qt4.Brushes;
