------------------------------------------------------------------------------
--                                                                          --
--                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.                                      --
--                                                                          --
------------------------------------------------------------------------------
--  $Revision: 3769 $ $Date: 2010-10-24 03:16:28 +0400 (Sun, 24 Oct 2010) $
------------------------------------------------------------------------------
with Qt_Ada.Internals.Object_Registry;
with Qt_Ada.Internals.Objects;

package body Qt4.Session_Managers.Directors is

   type Q_Session_Manager_Director_Access is
     access all Q_Session_Manager_Director'Class;
   --  XXX Need to be replaced by the proxy.

   function Create
     (Object : not null Qt_Ada.Internals.Objects.QObject_Access)
       return not null Qt_Ada.Internals.Objects.Q_Object_Base_Access;

   ------------
   -- Create --
   ------------

   function Create
     (Object : not null Qt_Ada.Internals.Objects.QObject_Access)
       return not null Qt_Ada.Internals.Objects.Q_Object_Base_Access
   is
   begin
--      Qt_Ada.Internals.Objects.Initialize (Self, Object);

      return new Q_Session_Manager_Director;
   end Create;

   function qt_metacast_wrapper
    (This       : not null access Qt_Ada.Internals.Objects.QObject;
     Class_Name : Interfaces.C.char_array)
       return System.Address;
   pragma Import
    (C, qt_metacast_wrapper, "__Qt4Ada_QSessionManager_qt_metacast_wrapper");

   function qt_metacall_wrapper
    (This : not null access Qt_Ada.Internals.Objects.QObject;
     Kind : Qt4.Meta_Objects.Call;
     Id   : Q_Integer;
     Args : Qt4.Address_Pointer)
       return Q_Integer;
   pragma Import
    (C, qt_metacall_wrapper, "__Qt4Ada_QSessionManager_qt_metacall_wrapper");

--    function allowsInteraction
--     (This : not null access Qt_Ada.Internals.Objects.QObject)
--        return bool;
--    pragma Import
--     (C, allowsInteraction,
--      Qt4.Gui_Link_Names.QSessionManager_allowsInteraction);
--
--    function allowsErrorInteraction
--     (This : not null access Qt_Ada.Internals.Objects.QObject)
--        return bool;
--    pragma Import
--     (C, allowsErrorInteraction,
--      Qt4.Gui_Link_Names.QSessionManager_allowsErrorInteraction);
--
--    procedure cancel
--     (This : not null access Qt_Ada.Internals.Objects.QObject);
--    pragma Import (C, cancel,  Qt4.Gui_Link_Names.QSessionManager_cancel);
--
--    procedure release
--     (This : not null access Qt_Ada.Internals.Objects.QObject);
--    pragma Import (C, release,  Qt4.Gui_Link_Names.QSessionManager_release);
--
--    function restartHint
--     (This : not null access Qt_Ada.Internals.Objects.QObject)
--        return Q_Restart_Hint;
--    pragma Import
--     (C, restartHint, Qt4.Gui_Link_Names.QSessionManager_restartHint);
--
--    procedure setRestartHint
--     (This  : not null access Qt_Ada.Internals.Objects.QObject;
--      Value : Q_Restart_Hint);
--    pragma Import
--     (C, setRestartHint, Qt4.Gui_Link_Names.QSessionManager_setRestartHint);
--
--    function isPhase2
--     (This  : not null access Qt_Ada.Internals.Objects.QObject)
--        return bool;
--    pragma Import (C, isPhase2, Qt4.Gui_Link_Names.QSessionManager_isPhase2);
--
--    procedure requestPhase2
--     (This  : not null access Qt_Ada.Internals.Objects.QObject);
--    pragma Import
--     (C, requestPhase2, Qt4.Gui_Link_Names.QSessionManager_requestPhase2);

--    ------------------------------
--    -- Allows_Error_Interaction --
--    ------------------------------
--
--    function Allows_Error_Interaction
--     (Self : not null access Q_Session_Manager_Impl)
--        return Boolean
--    is
--    begin
--       return
--         To_Boolean
--          (allowsErrorInteraction
--            (Qt4.Objects.Impl.Internals.Cpp_This (Self)));
--    end Allows_Error_Interaction;
--
--    ------------------------
--    -- Allows_Interaction --
--    ------------------------
--
--  function Allows_Interaction (Self : not null access Q_Session_Manager_Impl)
--      return Boolean
--    is
--    begin
--       return
--         To_Boolean
--          (allowsInteraction
--            (Qt4.Objects.Impl.Internals.Cpp_This (Self)));
--    end Allows_Interaction;
--
--    ------------
--    -- Cancel --
--    ------------
--
--    procedure Cancel (Self : not null access Q_Session_Manager_Impl) is
--    begin
--       cancel (Qt4.Objects.Impl.Internals.Cpp_This (Self));
--    end Cancel;
--
--    ----------------
--    -- Is_Phase_2 --
--    ----------------
--
--    function Is_Phase_2
--     (Self : not null access Q_Session_Manager_Impl)
--        return Boolean
--    is
--    begin
--       return
--         To_Boolean
--          (isPhase2 (Qt4.Objects.Impl.Internals.Cpp_This (Self)));
--    end Is_Phase_2;

--    -------------
--    -- Release --
--    -------------
--
--    procedure Release (Self : not null access Q_Session_Manager_Impl) is
--    begin
--       release (Qt4.Objects.Impl.Internals.Cpp_This (Self));
--    end Release;
--
--    ---------------------
--    -- Request_Phase_2 --
--    ---------------------
--
--   procedure Request_Phase_2 (Self : not null access Q_Session_Manager_Impl)
--    is
--    begin
--       requestPhase2 (Qt4.Objects.Impl.Internals.Cpp_This (Self));
--    end Request_Phase_2;
--
--    ------------------
--    -- Restart_Hint --
--    ------------------
--
--    function Restart_Hint (Self : not null access Q_Session_Manager_Impl)
--      return Q_Restart_Hint
--    is
--    begin
--       return restartHint (Qt4.Objects.Impl.Internals.Cpp_This (Self));
--    end Restart_Hint;
--
--    ----------------------
--    -- Set_Restart_Hint --
--    ----------------------
--
--  ocedure Set_Restart_Hint (Self  : not null access Q_Session_Manager_Impl;
--                                Value : Q_Restart_Hint)
--    is
--    begin
--       setRestartHint (Qt4.Objects.Impl.Internals.Cpp_This (Self), Value);
--    end Set_Restart_Hint;

begin
   Qt_Ada.Internals.Object_Registry.Register_Proxy
    ("QSessionManager", Create'Access);
--   Qt_Ada.Internals.Object_Registry.Register_Director
--    ("QSessionManager",
--     qt_metacast_wrapper'Access,
--     qt_metacall_wrapper'Access);
end Qt4.Session_Managers.Directors;
