------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008, 2009 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: 3791 $ $Date: 2010-10-28 19:45:44 +0400 (Thu, 28 Oct 2010) $
------------------------------------------------------------------------------

package Qt_Ada.Internals.Events is

   pragma Preelaborate;

   type QEvent is null record;
   pragma Convention (C, QEvent);
   --  This is representation of the all C++ Events of the QEvent subclasses
   --  casted to QEvent.

   type QEvent_Access is access all QEvent;
   pragma Convention (C, QEvent_Access);

--   type Q_Event_Base is limited interface;
--   --  Base tagged type for all Ada Events of types derived from Q_Event.
--   --  It has only one dispatching operation, which returns pointer to the
--   --  associated C++ event which supports QEvent operations.
--
--   not overriding
--   function QEvent_View (Self : not null access constant Q_Event_Base)
--     return not null QEvent_Access
--       is abstract;
--   --  Returns view to the associated C++ Event which casted to QEvent.

--   type Q_Event_Impl_Base is abstract limited new Q_Event_Base with private;
   type Q_Event_Base is abstract tagged limited private;

   type Q_Event_Base_Access is access all Q_Event_Base'Class;

   not overriding function QEvent_View
    (Self : not null access constant Q_Event_Base)
       return not null QEvent_Access;

   procedure Initialize
    (Self   : not null access Q_Event_Base'Class;
     Object : not null QEvent_Access);
   --  Initialize Ada object to be connected with C++ object.

private

   type Q_Event_Base is abstract tagged limited record
--   type Q_Event_Impl_Base is abstract limited new Q_Event_Base with record
      Object : QEvent_Access;
   end record;

end Qt_Ada.Internals.Events;
