------------------------------------------------------------------------------
--                                                                          --
--                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;
with Qt4.Strings;
with Qt_Ada.Internals.Value_Class_Sizes;
with System;

package Qt4.Dates is

   type Q_Date is tagged private;

   function Create
    (Y : in Qt4.Q_Year_Number;
     M : in Qt4.Q_Month_Number;
     D : in Qt4.Q_Day_Number)
       return Q_Date;

   function Add_Days
    (Self : in Q_Date'Class;
     Days : in Qt4.Q_Integer)
       return Q_Date;

   function Add_Months
    (Self : in Q_Date'Class;
     Months : in Qt4.Q_Integer)
       return Q_Date;

   function Add_Years
    (Self : in Q_Date'Class;
     Years : in Qt4.Q_Integer)
       return Q_Date;

   function Day
    (Self : in Q_Date'Class)
       return Qt4.Q_Day_Number;

   function Day_Of_Week
    (Self : in Q_Date'Class)
       return Qt4.Day_Of_Week;

   function Day_Of_Year
    (Self : in Q_Date'Class)
       return Qt4.Q_Years_Day_Number;

   function Days_In_Month
    (Self : in Q_Date'Class)
       return Qt4.Q_Day_Number;

   function Days_In_Year
    (Self : in Q_Date'Class)
       return Qt4.Q_Years_Day_Number;

   function Days_To
    (Self : in Q_Date'Class;
     D : in Q_Date'Class)
       return Qt4.Q_Integer;

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

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

   function Month
    (Self : in Q_Date'Class)
       return Qt4.Q_Month_Number;

   function To_Julian_Day
    (Self : in Q_Date'Class)
       return Qt4.Q_Integer;

   function To_String
    (Self : in Q_Date'Class;
     Format : in Qt4.Strings.Q_String'Class)
       return Qt4.Strings.Q_String;

   function To_String
    (Self : in Q_Date'Class;
     F : in Qt4.Date_Format
       := Text_Date)
       return Qt4.Strings.Q_String;

   function Year
    (Self : in Q_Date'Class)
       return Qt4.Q_Year_Number;

   function Current_Date
     return Q_Date;

   function From_Julian_Day
    (Jd : in Qt4.Q_Integer)
       return Q_Date;

   function From_String
    (S : in Qt4.Strings.Q_String'Class;
     F : in Qt4.Date_Format
       := Text_Date)
       return Q_Date;

   function From_String
    (S : in Qt4.Strings.Q_String'Class;
     Format : in Qt4.Strings.Q_String'Class)
       return Q_Date;

   function Is_Leap_Year
    (Year : in Qt4.Q_Year_Number)
       return Boolean;

   function Is_Valid
    (Y : in Qt4.Q_Year_Number;
     M : in Qt4.Q_Month_Number;
     D : in Qt4.Q_Day_Number)
       return Boolean;

   function Long_Day_Name
    (Weekday : in Qt4.Day_Of_Week)
       return Qt4.Strings.Q_String;

   function Long_Month_Name
    (Month : in Qt4.Q_Month_Number)
       return Qt4.Strings.Q_String;

   function Short_Day_Name
    (Weekday : in Qt4.Day_Of_Week)
       return Qt4.Strings.Q_String;

   function Short_Month_Name
    (Month : in Qt4.Q_Month_Number)
       return Qt4.Strings.Q_String;

   function "="
    (Self : in Q_Date;
     Other : in Q_Date)
       return Boolean;

   function "<"
    (Self : in Q_Date;
     Other : in Q_Date)
       return Boolean;

   function "<="
    (Self : in Q_Date;
     Other : in Q_Date)
       return Boolean;

   function ">"
    (Self : in Q_Date;
     Other : in Q_Date)
       return Boolean;

   function ">="
    (Self : in Q_Date;
     Other : in Q_Date)
       return Boolean;

   package Internals is

      type QDate is private;

      type QDate_Access is access all QDate;
      pragma Convention (C, QDate_Access);

      function QDate_View
       (Item : in Q_Date'Class)
          return QDate_Access;
      pragma Inline (QDate_View);

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

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

      function Create_Wrapper
       (Item : in Internals.QDate_Access)
          return Q_Date;

   private

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

   end Internals;

private

   type Q_Date is new Ada.Finalization.Controlled with record
      Storage : aliased Internals.QDate;
      Object  : Internals.QDate_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Adjust (Self : in out Q_Date);

   overriding
   procedure Finalize (Self : in out Q_Date);

   overriding
   procedure Initialize (Self : in out Q_Date);

end Qt4.Dates;
