------------------------------------------------------------------------------
--                                                                          --
--                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.Times is

   type Q_Time is tagged private;

   function Create
    (H : in Qt4.Q_Hour_Number;
     M : in Qt4.Q_Minute_Number;
     S : in Qt4.Q_Second_Number
       := 0;
     Ms : in Qt4.Q_Second_Duration
       := 0.000000000)
       return Q_Time;

   function Add_M_Secs
    (Self : in Q_Time'Class;
     Ms : in Duration)
       return Q_Time;

   function Add_Secs
    (Self : in Q_Time'Class;
     Secs : in Qt4.Q_Integer)
       return Q_Time;

   function Elapsed
    (Self : in Q_Time'Class)
       return Qt4.Q_Day_Duration;

   function Hour
    (Self : in Q_Time'Class)
       return Qt4.Q_Hour_Number;

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

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

   function Minute
    (Self : in Q_Time'Class)
       return Qt4.Q_Minute_Number;

   function Msec
    (Self : in Q_Time'Class)
       return Qt4.Q_Second_Duration;

   function Msecs_To
    (Self : in Q_Time'Class;
     T : in Q_Time'Class)
       return Duration;

   function Second
    (Self : in Q_Time'Class)
       return Qt4.Q_Second_Number;

   function Secs_To
    (Self : in Q_Time'Class;
     T : in Q_Time'Class)
       return Qt4.Q_Integer;

   procedure Start
    (Self : in out Q_Time'Class);

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

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

   function Current_Time
     return Q_Time;

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

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

   function Is_Valid
    (H : in Qt4.Q_Hour_Number;
     M : in Qt4.Q_Minute_Number;
     S : in Qt4.Q_Second_Number;
     Ms : in Qt4.Q_Second_Duration
       := 0.000000000)
       return Boolean;

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

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

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

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

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

   package Internals is

      type QTime is private;

      type QTime_Access is access all QTime;
      pragma Convention (C, QTime_Access);

      function QTime_View
       (Item : in Q_Time'Class)
          return QTime_Access;
      pragma Inline (QTime_View);

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

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

      function Create_Wrapper
       (Item : in Internals.QTime_Access)
          return Q_Time;

   private

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

   end Internals;

private

   type Q_Time is new Ada.Finalization.Controlled with record
      Storage : aliased Internals.QTime;
      Object  : Internals.QTime_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Adjust (Self : in out Q_Time);

   overriding
   procedure Finalize (Self : in out Q_Time);

   overriding
   procedure Initialize (Self : in out Q_Time);

end Qt4.Times;
