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

package Qt4.Date_Times is

   type Q_Date_Time is tagged private;

   function Create
    (Date : in Qt4.Dates.Q_Date'Class)
       return Q_Date_Time;

   function Create
    (Date : in Qt4.Dates.Q_Date'Class;
     Time : in Qt4.Times.Q_Time'Class;
     Spec : in Qt4.Time_Spec
       := Local_Time)
       return Q_Date_Time;

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

   function Add_M_Secs
    (Self : in Q_Date_Time'Class;
     Msecs : in Duration)
       return Q_Date_Time;

   function Add_Months
    (Self : in Q_Date_Time'Class;
     Days : in Qt4.Q_Integer)
       return Q_Date_Time;

   function Add_Secs
    (Self : in Q_Date_Time'Class;
     Days : in Qt4.Q_Integer)
       return Q_Date_Time;

   function Add_Years
    (Self : in Q_Date_Time'Class;
     Days : in Qt4.Q_Integer)
       return Q_Date_Time;

   function Date
    (Self : in Q_Date_Time'Class)
       return Qt4.Dates.Q_Date;

   function Days_To
    (Self : in Q_Date_Time'Class;
     Other : in Q_Date_Time'Class)
       return Qt4.Q_Integer;

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

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

   function Secs_To
    (Self : in Q_Date_Time'Class;
     Other : in Q_Date_Time'Class)
       return Qt4.Q_Integer;

   procedure Set_Date
    (Self : in out Q_Date_Time'Class;
     Date : in Qt4.Dates.Q_Date'Class);

   procedure Set_Time
    (Self : in out Q_Date_Time'Class;
     Time : in Qt4.Times.Q_Time'Class);

   procedure Set_Time_Spec
    (Self : in out Q_Date_Time'Class;
     Spec : in Qt4.Time_Spec);

   function Time
    (Self : in Q_Date_Time'Class)
       return Qt4.Times.Q_Time;

   function Time_Spec
    (Self : in Q_Date_Time'Class)
       return Qt4.Time_Spec;

   function To_Local_Time
    (Self : in Q_Date_Time'Class)
       return Q_Date_Time;

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

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

   function To_Time_Spec
    (Self : in Q_Date_Time'Class;
     Spec : in Qt4.Time_Spec)
       return Q_Date_Time;

   function To_UTC
    (Self : in Q_Date_Time'Class)
       return Q_Date_Time;

   function Current_Date_Time
     return Q_Date_Time;

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

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

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

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

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

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

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

   package Internals is

      type QDateTime is private;

      type QDateTime_Access is access all QDateTime;
      pragma Convention (C, QDateTime_Access);

      function QDateTime_View
       (Item : in Q_Date_Time'Class)
          return QDateTime_Access;
      pragma Inline (QDateTime_View);

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

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

      function Create_Wrapper
       (Item : in Internals.QDateTime_Access)
          return Q_Date_Time;

   private

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

   end Internals;

private

   type Q_Date_Time is new Ada.Finalization.Controlled with record
      Storage : aliased Internals.QDateTime;
      Object  : Internals.QDateTime_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Adjust (Self : in out Q_Date_Time);

   overriding
   procedure Finalize (Self : in out Q_Date_Time);

   overriding
   procedure Initialize (Self : in out Q_Date_Time);

end Qt4.Date_Times;
