------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008 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.     --
------------------------------------------------------------------------------
with Qt_Ada.Internals.Objects;

with Qt_Ada.Internals.Objects.Timer_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.Timer_Proxies);
--  Elaboration of the proxy tagged type package register proxy object
--  constructor. Bindings must be able to create proxy object of the
--  corresponding tagged type for works properly.

package body Qt4.Timers is

   function isActive_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.bool;
   pragma Import (C, isActive_0_wrapper,
                     "__Qt4Ada_QTimer_isActive_0_wrapper");

   function isSingleShot_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.bool;
   pragma Import (C, isSingleShot_0_wrapper,
                     "__Qt4Ada_QTimer_isSingleShot_0_wrapper");

   procedure setSingleShot_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Single_Shot : Qt4.bool);
   pragma Import (C, setSingleShot_0_wrapper,
                     "__Qt4Ada_QTimer_setSingleShot_0_wrapper");

   function timerId_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Q_Integer;
   pragma Import (C, timerId_0_wrapper,
                     "__Qt4Ada_QTimer_timerId_0_wrapper");

   procedure start_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, start_0_wrapper,
                     "__Qt4Ada_QTimer_start_0_wrapper");

   procedure stop_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, stop_0_wrapper,
                     "__Qt4Ada_QTimer_stop_0_wrapper");

   procedure start_sec_wrapper
    (Self    : not null access Qt_Ada.Internals.Objects.QObject;
     Seconds : Interfaces.C.int);
   pragma Import (C, start_sec_wrapper, "__Qt4Ada_QTimer_start_sec_wrapper");

   -----------
   -- Start --
   -----------

   procedure Start
    (Self    : not null access Q_Timer'Class;
     Seconds : Duration)
   is
   begin
      start_sec_wrapper (Self.QObject_View, Interfaces.C.int (Seconds * 1000));
   end Start;

   pragma Style_Checks ("N");

   ---------------
   -- Is_Active --
   ---------------

   function Is_Active
    (Self : not null access constant Q_Timer'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isActive_0_wrapper
           (Self.QObject_View));
   end Is_Active;

   --------------------
   -- Is_Single_Shot --
   --------------------

   function Is_Single_Shot
    (Self : not null access constant Q_Timer'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isSingleShot_0_wrapper
           (Self.QObject_View));
   end Is_Single_Shot;

   ---------------------
   -- Set_Single_Shot --
   ---------------------

   procedure Set_Single_Shot
    (Self : not null access Q_Timer'Class;
     Single_Shot : Standard.Boolean)
   is
   begin
      setSingleShot_0_wrapper
       (Self.QObject_View,
        Qt4.To_bool (Single_Shot));
   end Set_Single_Shot;

   --------------
   -- Timer_Id --
   --------------

   function Timer_Id
    (Self : not null access constant Q_Timer'Class)
       return Qt4.Q_Integer
   is
   begin
      return
        timerId_0_wrapper
         (Self.QObject_View);
   end Timer_Id;

   -----------
   -- Start --
   -----------

   procedure Start
    (Self : not null access Q_Timer'Class)
   is
   begin
      start_0_wrapper
       (Self.QObject_View);
   end Start;

   ----------
   -- Stop --
   ----------

   procedure Stop
    (Self : not null access Q_Timer'Class)
   is
   begin
      stop_0_wrapper
       (Self.QObject_View);
   end Stop;

end Qt4.Timers;
