------------------------------------------------------------------------------
--                                                                          --
--                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 Qt4.Style_Options;
with Qt_Ada.Internals.Events;
with Qt_Ada.Internals.Object_Registry;
pragma Elaborate (Qt_Ada.Internals.Object_Registry);

package body Qt_Ada.Internals.Objects.Abstract_Item_Delegate_Proxies is

   function createEditor_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Parent : not null access Qt_Ada.Internals.Objects.QObject;
     Option : not null access constant Qt4.Style_Options.Thin.QStyleOption;
     Index : not null access constant Qt4.Model_Indices.Internals.QModelIndex)
       return not null access Qt_Ada.Internals.Objects.QObject;
      pragma Import (C, createEditor_0_virtual,
                     "__Qt4Ada_QAbstractItemDelegate_createEditor_0_virtual");

   function editorEvent_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Event : not null access Qt_Ada.Internals.Events.QEvent;
     Model : not null access Qt_Ada.Internals.Objects.QObject;
     Option : not null access constant Qt4.Style_Options.Thin.QStyleOption;
     Index : not null access constant Qt4.Model_Indices.Internals.QModelIndex)
       return Qt4.bool;
      pragma Import (C, editorEvent_0_virtual,
                     "__Qt4Ada_QAbstractItemDelegate_editorEvent_0_virtual");

   procedure setEditorData_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Editor : not null access Qt_Ada.Internals.Objects.QObject;
     Index : not null access constant Qt4.Model_Indices.Internals.QModelIndex);
      pragma Import (C, setEditorData_0_virtual,
                     "__Qt4Ada_QAbstractItemDelegate_setEditorData_0_virtual");

   procedure setModelData_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Editor : not null access Qt_Ada.Internals.Objects.QObject;
     Model : not null access Qt_Ada.Internals.Objects.QObject;
     Index : not null access constant Qt4.Model_Indices.Internals.QModelIndex);
      pragma Import (C, setModelData_0_virtual,
                     "__Qt4Ada_QAbstractItemDelegate_setModelData_0_virtual");

   procedure sizeHint_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Option : not null access constant Qt4.Style_Options.Thin.QStyleOption;
     Index : not null access constant Qt4.Model_Indices.Internals.QModelIndex;
     Returns : not null access Qt4.Sizes.Internals.QSize);
      pragma Import (C, sizeHint_0_virtual,
                     "__Qt4Ada_QAbstractItemDelegate_sizeHint_0_virtual");

   procedure updateEditorGeometry_0_virtual
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Editor : not null access Qt_Ada.Internals.Objects.QObject;
     Option : not null access constant Qt4.Style_Options.Thin.QStyleOption;
     Index : not null access constant Qt4.Model_Indices.Internals.QModelIndex);
      pragma Import (C, updateEditorGeometry_0_virtual,
                     "__Qt4Ada_QAbstractItemDelegate_updateEditorGeometry_0_virtual");

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

   procedure paint_virtual
    (Self    : not null access Qt_Ada.Internals.Objects.QObject;
     Painter : not null access Qt4.Painters.Internals.QPainter;
     Option  : not null access Qt4.Style_Options.Thin.QStyleOption;
     Index   : not null access Qt4.Model_Indices.Internals.QModelIndex);
   pragma Import
    (C, paint_virtual, "__Qt4Ada_QAbstractItemDelegate_paint_virtual");

   -----------
   -- Paint --
   -----------

   overriding
   procedure Paint
    (Self    : not null access Q_Abstract_Item_Delegate_Proxy;
     Painter : Qt4.Painters.Q_Painter;
     Option  : Qt4.Style_Option_View_Items.Q_Style_Option_View_Item;
     Index   : Qt4.Model_Indices.Q_Model_Index)
   is
   begin
      paint_virtual
       (Self.QObject_View,
        Qt4.Painters.Internals.QPainter_View (Painter),
        Qt4.Style_Options.Internals.QStyleOption_View (Option),
        Qt4.Model_Indices.Internals.QModelIndex_View (Index));
   end Paint;

   pragma Style_Checks ("N");

   -------------------
   -- Create_Editor --
   -------------------

   function Create_Editor
    (Self : not null access constant Q_Abstract_Item_Delegate_Proxy;
     Parent : not null access Qt4.Widgets.Q_Widget'Class;
     Option : Qt4.Style_Option_View_Items.Q_Style_Option_View_Item'Class;
     Index : Qt4.Model_Indices.Q_Model_Index)
       return not null access Qt4.Widgets.Q_Widget'Class
   is
   begin
      return
        Qt4.Widgets.Q_Widget'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (createEditor_0_virtual
             (Q_Abstract_Item_Delegate_Proxy'Class (Self.all).QObject_View,
              Parent.QObject_View,
              Qt4.Style_Options.Internals.QStyleOption_View (Option),
              Qt4.Model_Indices.Internals.QModelIndex_View (Index))).all)'Access;
   end Create_Editor;

   ------------------
   -- Editor_Event --
   ------------------

   function Editor_Event
    (Self : not null access Q_Abstract_Item_Delegate_Proxy;
     Event : not null access Qt4.Events.Q_Event'Class;
     Model : not null access Qt4.Abstract_Item_Models.Q_Abstract_Item_Model'Class;
     Option : Qt4.Style_Option_View_Items.Q_Style_Option_View_Item'Class;
     Index : Qt4.Model_Indices.Q_Model_Index)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (editorEvent_0_virtual
           (Q_Abstract_Item_Delegate_Proxy'Class (Self.all).QObject_View,
            Event.QEvent_View,
            Model.QObject_View,
            Qt4.Style_Options.Internals.QStyleOption_View (Option),
            Qt4.Model_Indices.Internals.QModelIndex_View (Index)));
   end Editor_Event;

   ---------------------
   -- Set_Editor_Data --
   ---------------------

   procedure Set_Editor_Data
    (Self : not null access constant Q_Abstract_Item_Delegate_Proxy;
     Editor : not null access Qt4.Widgets.Q_Widget'Class;
     Index : Qt4.Model_Indices.Q_Model_Index)
   is
   begin
      setEditorData_0_virtual
       (Q_Abstract_Item_Delegate_Proxy'Class (Self.all).QObject_View,
        Editor.QObject_View,
        Qt4.Model_Indices.Internals.QModelIndex_View (Index));
   end Set_Editor_Data;

   --------------------
   -- Set_Model_Data --
   --------------------

   procedure Set_Model_Data
    (Self : not null access constant Q_Abstract_Item_Delegate_Proxy;
     Editor : not null access Qt4.Widgets.Q_Widget'Class;
     Model : not null access Qt4.Abstract_Item_Models.Q_Abstract_Item_Model'Class;
     Index : Qt4.Model_Indices.Q_Model_Index)
   is
   begin
      setModelData_0_virtual
       (Q_Abstract_Item_Delegate_Proxy'Class (Self.all).QObject_View,
        Editor.QObject_View,
        Model.QObject_View,
        Qt4.Model_Indices.Internals.QModelIndex_View (Index));
   end Set_Model_Data;

   ---------------
   -- Size_Hint --
   ---------------

   function Size_Hint
    (Self : not null access constant Q_Abstract_Item_Delegate_Proxy;
     Option : Qt4.Style_Option_View_Items.Q_Style_Option_View_Item'Class;
     Index : Qt4.Model_Indices.Q_Model_Index)
       return Qt4.Sizes.Q_Size
   is
      Returns : Qt4.Sizes.Q_Size;

   begin
      sizeHint_0_virtual
       (Q_Abstract_Item_Delegate_Proxy'Class (Self.all).QObject_View,
        Qt4.Style_Options.Internals.QStyleOption_View (Option),
        Qt4.Model_Indices.Internals.QModelIndex_View (Index),
        Qt4.Sizes.Internals.QSize_View (Returns));

      return Returns;
   end Size_Hint;

   ----------------------------
   -- Update_Editor_Geometry --
   ----------------------------

   procedure Update_Editor_Geometry
    (Self : not null access constant Q_Abstract_Item_Delegate_Proxy;
     Editor : not null access Qt4.Widgets.Q_Widget'Class;
     Option : Qt4.Style_Option_View_Items.Q_Style_Option_View_Item'Class;
     Index : Qt4.Model_Indices.Q_Model_Index)
   is
   begin
      updateEditorGeometry_0_virtual
       (Q_Abstract_Item_Delegate_Proxy'Class (Self.all).QObject_View,
        Editor.QObject_View,
        Qt4.Style_Options.Internals.QStyleOption_View (Option),
        Qt4.Model_Indices.Internals.QModelIndex_View (Index));
   end Update_Editor_Geometry;

   type Q_Abstract_Item_Delegate_Proxy_Access is
     access all Q_Abstract_Item_Delegate_Proxy'Class;

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

   function Create
    (Object : not null Qt_Ada.Internals.Objects.QObject_Access)
       return not null Qt_Ada.Internals.Objects.Q_Object_Base_Access
   is
      Self : constant not null Q_Abstract_Item_Delegate_Proxy_Access
        := new Q_Abstract_Item_Delegate_Proxy;

   begin
      Qt_Ada.Internals.Objects.Initialize (Self, Object);

      return Qt_Ada.Internals.Objects.Q_Object_Base_Access (Self);
   end Create;

begin
   Qt_Ada.Internals.Object_Registry.Register_Proxy
    ("QAbstractItemDelegate", Create'Access);
end Qt_Ada.Internals.Objects.Abstract_Item_Delegate_Proxies;
