------------------------------------------------------------------------------
--                                                                          --
--                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 Interfaces.C;

with Qt4.Paint_Devices;
with Qt4.Paint_Engines;
with Qt4.Rects;
with Qt4.Size_Fs;
with Qt4.Strings;
private with Qt_Ada.Internals.Value_Class_Sizes;
with Qt_Ada.Internals.Paint_Devices;
with System;

package Qt4.Printers is

   --  QPrinter::ColorMode

   type Printer_Color_Mode is
    (Gray_Scale,
     Color);
   pragma Convention (C, Printer_Color_Mode);
   for Printer_Color_Mode'Size use Interfaces.C.unsigned'Size;

   --  QPrinter::Orientation

   type Printer_Orientation is
    (Portrait,
     Landscape);
   pragma Convention (C, Printer_Orientation);
   for Printer_Orientation'Size use Interfaces.C.unsigned'Size;

   --  QPrinter::OutputFormat

   type Printer_Output_Format is
    (Native_Format,
     Pdf_Format,
     Post_Script_Format);
   pragma Convention (C, Printer_Output_Format);
   for Printer_Output_Format'Size use Interfaces.C.unsigned'Size;

   --  QPrinter::PageOrder

   type Printer_Page_Order is
    (First_Page_First,
     Last_Page_First);
   pragma Convention (C, Printer_Page_Order);
   for Printer_Page_Order'Size use Interfaces.C.unsigned'Size;

   --  QPrinter::PageSize

   type Printer_Page_Size is
    (A4,
     B5,
     Letter,
     Legal,
     Executive,
     A0,
     A1,
     A2,
     A3,
     A5,
     A6,
     A7,
     A8,
     A9,
     B0,
     B1,
     B10,
     B2,
     B3,
     B4,
     B6,
     B7,
     B8,
     B9,
     C5_E,
     Comm_10_E,
     DLE,
     Folio,
     Ledger,
     Tabloid,
     Custom);
   pragma Convention (C, Printer_Page_Size);
   for Printer_Page_Size'Size use Interfaces.C.unsigned'Size;

   --  QPrinter::PaperSource

   type Printer_Paper_Source is
    (Only_One,
     Lower,
     Middle,
     Manual,
     Envelope,
     Envelope_Manual,
     Auto,
     Tractor,
     Small_Format,
     Large_Format,
     Large_Capacity,
     Cassette,
     Form_Source,
     Max_Page_Source);
   pragma Convention (C, Printer_Paper_Source);
   for Printer_Paper_Source'Size use Interfaces.C.unsigned'Size;

   --  QPrinter::PaperSize

   type Printer_Paper_Size is
    (A4,
     B5,
     Letter,
     Legal,
     Executive,
     A0,
     A1,
     A2,
     A3,
     A5,
     A6,
     A7,
     A8,
     A9,
     B0,
     B1,
     B10,
     B2,
     B3,
     B4,
     B6,
     B7,
     B8,
     B9,
     C5_E,
     Comm_10_E,
     DLE,
     Folio,
     Ledger,
     Tabloid,
     Custom);
   pragma Convention (C, Printer_Paper_Size);
   for Printer_Paper_Size'Size use Interfaces.C.unsigned'Size;

   --  QPrinter::PrintRange

   type Printer_Print_Range is
    (All_Pages,
     Selection,
     Page_Range);
   pragma Convention (C, Printer_Print_Range);
   for Printer_Print_Range'Size use Interfaces.C.unsigned'Size;

   --  QPrinter::PrinterMode

   type Printer_Mode is
    (Screen_Resolution,
     Printer_Resolution,
     High_Resolution);
   pragma Convention (C, Printer_Mode);
   for Printer_Mode'Size use Interfaces.C.unsigned'Size;

   --  QPrinter::PrinterState

   type Printer_Printer_State is
    (Idle,
     Active,
     Aborted,
     Error);
   pragma Convention (C, Printer_Printer_State);
   for Printer_Printer_State'Size use Interfaces.C.unsigned'Size;

   --  QPrinter::Unit

   type Printer_Unit is
    (Millimeter,
     Point,
     Inch,
     Pica,
     Didot,
     Cicero,
     Device_Pixel);
   pragma Convention (C, Printer_Unit);
   for Printer_Unit'Size use Interfaces.C.unsigned'Size;

   type Q_Printer is limited new Qt4.Paint_Devices.Q_Paint_Device with private;

   function Create
    (Mode : Printer_Mode := Screen_Resolution)
       return Q_Printer;

   function Abort_Print
    (Self : not null access Q_Printer'Class)
       return Boolean;

   function Collate_Copies
    (Self : Q_Printer'Class)
       return Boolean;

   function Color_Mode
    (Self : Q_Printer'Class)
       return Printer_Color_Mode;

   function Creator
    (Self : Q_Printer'Class)
       return Qt4.Strings.Q_String;

   function Doc_Name
    (Self : Q_Printer'Class)
       return Qt4.Strings.Q_String;

   function Double_Sided_Printing
    (Self : Q_Printer'Class)
       return Boolean;

   function Font_Embedding_Enabled
    (Self : Q_Printer'Class)
       return Boolean;

   function From_Page
    (Self : Q_Printer'Class)
       return Qt4.Q_Integer;

   function Full_Page
    (Self : Q_Printer'Class)
       return Boolean;

   function New_Page
    (Self : not null access Q_Printer'Class)
       return Boolean;

   function Num_Copies
    (Self : Q_Printer'Class)
       return Qt4.Q_Integer;

   function Orientation
    (Self : Q_Printer'Class)
       return Printer_Orientation;

   function Output_File_Name
    (Self : Q_Printer'Class)
       return Qt4.Strings.Q_String;

   function Output_Format
    (Self : Q_Printer'Class)
       return Printer_Output_Format;

   function Page_Order
    (Self : Q_Printer'Class)
       return Printer_Page_Order;

   function Page_Rect
    (Self : Q_Printer'Class)
       return Qt4.Rects.Q_Rect;

   function Page_Size
    (Self : Q_Printer'Class)
       return Printer_Page_Size;

   function Paper_Rect
    (Self : Q_Printer'Class)
       return Qt4.Rects.Q_Rect;

   function Paper_Size
    (Self : Q_Printer'Class)
       return Printer_Paper_Size;

   function Paper_Size
    (Self : Q_Printer'Class;
     Unit : Printer_Unit)
       return Qt4.Size_Fs.Q_Size_F;

   function Paper_Source
    (Self : Q_Printer'Class)
       return Printer_Paper_Source;

   function Print_Program
    (Self : Q_Printer'Class)
       return Qt4.Strings.Q_String;

   function Print_Range
    (Self : Q_Printer'Class)
       return Printer_Print_Range;

   function Printer_Name
    (Self : Q_Printer'Class)
       return Qt4.Strings.Q_String;

   function Printer_State
    (Self : Q_Printer'Class)
       return Printer_Printer_State;

   function Resolution
    (Self : Q_Printer'Class)
       return Qt4.Q_Integer;

   procedure Set_Collate_Copies
    (Self    : in out Q_Printer'Class;
     Collate : Boolean);

   procedure Set_Color_Mode
    (Self : in out Q_Printer'Class;
     Mode : Printer_Color_Mode);

   procedure Set_Creator
    (Self    : in out Q_Printer'Class;
     Creator : Qt4.Strings.Q_String'Class);

   procedure Set_Doc_Name
    (Self : in out Q_Printer'Class;
     Name : Qt4.Strings.Q_String'Class);

   procedure Set_Double_Sided_Printing
    (Self   : in out Q_Printer'Class;
     Enable : Boolean);

   procedure Set_Font_Embedding_Enabled
    (Self   : in out Q_Printer'Class;
     Enable : Boolean);

   procedure Set_From_To
    (Self      : in out Q_Printer'Class;
     From_Page : Qt4.Q_Integer;
     To_Page   : Qt4.Q_Integer);

   procedure Set_Full_Page
    (Self : in out Q_Printer'Class;
     Fp   : Boolean);

   procedure Set_Num_Copies
    (Self       : in out Q_Printer'Class;
     Num_Copies : Qt4.Q_Integer);

   procedure Set_Orientation
    (Self              : in out Q_Printer'Class;
     Print_Orientation : Printer_Orientation);

   procedure Set_Output_File_Name
    (Self      : in out Q_Printer'Class;
     File_Name : Qt4.Strings.Q_String'Class);

   procedure Set_Output_Format
    (Self   : in out Q_Printer'Class;
     Format : Printer_Output_Format);

   procedure Set_Page_Margins
    (Self   : in out Q_Printer'Class;
     Left   : Qt4.Q_Real;
     Top    : Qt4.Q_Real;
     Right  : Qt4.Q_Real;
     Bottom : Qt4.Q_Real;
     Unit   : Printer_Unit);

   procedure Set_Page_Order
    (Self  : in out Q_Printer'Class;
     Order : Printer_Page_Order);

   procedure Set_Page_Size
    (Self : in out Q_Printer'Class;
     Size : Printer_Page_Size);

   procedure Set_Paper_Size
    (Self           : in out Q_Printer'Class;
     New_Paper_Size : Printer_Paper_Size);

   procedure Set_Paper_Size
    (Self       : in out Q_Printer'Class;
     Paper_Size : Qt4.Size_Fs.Q_Size_F'Class;
     Unit       : Printer_Unit);

   procedure Set_Paper_Source
    (Self   : in out Q_Printer'Class;
     Source : Printer_Paper_Source);

   procedure Set_Print_Program
    (Self    : in out Q_Printer'Class;
     Program : Qt4.Strings.Q_String'Class);

   procedure Set_Print_Range
    (Self    : in out Q_Printer'Class;
     P_Range : Printer_Print_Range);

   procedure Set_Printer_Name
    (Self : in out Q_Printer'Class;
     Name : Qt4.Strings.Q_String'Class);

   procedure Set_Resolution
    (Self       : in out Q_Printer'Class;
     Resolution : Qt4.Q_Integer);

   function To_Page
    (Self : Q_Printer'Class)
       return Qt4.Q_Integer;

   package Internals is

      type QPrinter is private;

      type QPrinter_Access is access all QPrinter;
      pragma Convention (C, QPrinter_Access);

      function QPrinter_View
       (Item : Q_Printer'Class)
          return QPrinter_Access;
      pragma Inline (QPrinter_View);

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

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

      function Create_Wrapper
       (Item : Internals.QPrinter_Access)
          return Q_Printer;

   private

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

   end Internals;

private

   type Q_Printer is
     limited new Ada.Finalization.Limited_Controlled
      and Qt4.Paint_Devices.Q_Paint_Device with
   record
      Storage : aliased Internals.QPrinter;
      Object  : Internals.QPrinter_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding function QPaintDevice_View
    (Self : not null access constant Q_Printer)
       return not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access;

   overriding function Paint_Engine
    (Self : not null access Q_Printer)
       return not null access Qt4.Paint_Engines.Q_Paint_Engine;

   overriding procedure Finalize (Self : in out Q_Printer);

   overriding procedure Initialize (Self : in out Q_Printer);

end Qt4.Printers;
