------------------------------------------------------------------------------
--                                                                          --
--                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.     --
------------------------------------------------------------------------------
with Qt_Ada.Internals.Object_Registry;
with Qt_Ada.Internals.Objects;
with Qt_Ada.Internals.Objects.Style_Utilities;

with Qt_Ada.Internals.Objects.Application_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.Application_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.Applications is

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

   procedure sessionId_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Strings.Internals.QString);
   pragma Import (C, sessionId_0_wrapper,
                     "__Qt4Ada_QApplication_sessionId_0_wrapper");

   procedure sessionKey_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Strings.Internals.QString);
   pragma Import (C, sessionKey_0_wrapper,
                     "__Qt4Ada_QApplication_sessionKey_0_wrapper");

   procedure styleSheet_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Strings.Internals.QString);
   pragma Import (C, styleSheet_0_wrapper,
                     "__Qt4Ada_QApplication_styleSheet_0_wrapper");

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

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

   procedure setStyleSheet_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Sheet : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, setStyleSheet_0_wrapper,
                     "__Qt4Ada_QApplication_setStyleSheet_0_wrapper");

   procedure setOverrideCursor_wrapper
    (Cursor : not null access Qt4.Cursors.Internals.QCursor);
   pragma Import (C,
                  setOverrideCursor_wrapper,
                  "__Qt4Ada_QApplication_restoreOverrideCursor_wrapper");

   procedure setStyle_QStyleP
    (Style : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import
    (C, setStyle_QStyleP, "__QtAda_QApplication_setStyle_QStyleP_wrapper");

   function setStyle_QStringCR
    (Style : not null access Qt4.Strings.Internals.QString)
       return access Qt_Ada.Internals.Objects.QObject;
   pragma Import
    (C, setStyle_QStringCR, "__QtAda_QApplication_setStyle_QStringCR_wrapper");

   function style_wrapper
     return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, style_wrapper, "__QtAda_QApplication_style_wrapper");

   -------------------------
   -- Set_Override_Cursor --
   -------------------------

   procedure Set_Override_Cursor (Cursor : Qt4.Cursors.Q_Cursor) is
   begin
      setOverrideCursor_wrapper (Qt4.Cursors.Internals.QCursor_View (Cursor));
   end Set_Override_Cursor;

   ---------------
   -- Set_Style --
   ---------------

   procedure Set_Style (Style : not null access Qt4.Styles.Q_Style'Class) is
   begin
      setStyle_QStyleP (Style.QObject_View);
   end Set_Style;

   ---------------
   -- Set_Style --
   ---------------

   function Set_Style (Style : Qt4.Strings.Q_String'Class)
     return access Qt4.Styles.Q_Style'Class
   is
   begin
      return
        Qt_Ada.Internals.Objects.Style_Utilities.Corresponding_Q_Style
         (setStyle_QStringCR (Qt4.Strings.Internals.QString_View (Style)));
   end Set_Style;

   -----------
   -- Style --
   -----------

   function Style return not null access Qt4.Styles.Q_Style'Class is
   begin
      return
        Qt4.Styles.Q_Style'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (style_wrapper).all)'Access;
   end Style;

   pragma Style_Checks ("N");

   -------------------------
   -- Is_Session_Restored --
   -------------------------

   function Is_Session_Restored
    (Self : not null access constant Q_Application'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isSessionRestored_0_wrapper
           (Self.QObject_View));
   end Is_Session_Restored;

   ----------------
   -- Session_Id --
   ----------------

   function Session_Id
    (Self : not null access constant Q_Application'Class)
       return Qt4.Strings.Q_String
   is
      Returns : Qt4.Strings.Q_String;

   begin
      sessionId_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Returns));

      return Returns;
   end Session_Id;

   -----------------
   -- Session_Key --
   -----------------

   function Session_Key
    (Self : not null access constant Q_Application'Class)
       return Qt4.Strings.Q_String
   is
      Returns : Qt4.Strings.Q_String;

   begin
      sessionKey_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Returns));

      return Returns;
   end Session_Key;

   -----------------
   -- Style_Sheet --
   -----------------

   function Style_Sheet
    (Self : not null access constant Q_Application'Class)
       return Qt4.Strings.Q_String
   is
      Returns : Qt4.Strings.Q_String;

   begin
      styleSheet_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Returns));

      return Returns;
   end Style_Sheet;

   --------------
   -- About_Qt --
   --------------

   procedure About_Qt
    (Self : not null access Q_Application'Class)
   is
   begin
      aboutQt_0_wrapper
       (Self.QObject_View);
   end About_Qt;

   -----------------------
   -- Close_All_Windows --
   -----------------------

   procedure Close_All_Windows
    (Self : not null access Q_Application'Class)
   is
   begin
      closeAllWindows_0_wrapper
       (Self.QObject_View);
   end Close_All_Windows;

   ---------------------
   -- Set_Style_Sheet --
   ---------------------

   procedure Set_Style_Sheet
    (Self : not null access Q_Application'Class;
     Sheet : Qt4.Strings.Q_String)
   is
   begin
      setStyleSheet_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Sheet));
   end Set_Style_Sheet;

end Qt4.Applications;
