------------------------------------------------------------------------------
--                                                                          --
--                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.List_Widget_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.List_Widget_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.List_Widgets is

   procedure addItem_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Label : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, addItem_0_wrapper,
                     "__Qt4Ada_QListWidget_addItem_0_wrapper");

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

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

   procedure insertItem_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Row : Qt4.Q_Integer;
     Label : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, insertItem_0_wrapper,
                     "__Qt4Ada_QListWidget_insertItem_0_wrapper");

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

   procedure setCurrentRow_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Row : Qt4.Q_Integer);
   pragma Import (C, setCurrentRow_0_wrapper,
                     "__Qt4Ada_QListWidget_setCurrentRow_0_wrapper");

   procedure setSortingEnabled_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Enable : Qt4.bool);
   pragma Import (C, setSortingEnabled_0_wrapper,
                     "__Qt4Ada_QListWidget_setSortingEnabled_0_wrapper");

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

   procedure addItems_wrapper
    (Self   : not null access Qt_Ada.Internals.Objects.QObject;
     Labels : not null access Qt4.String_Lists.Internals.QStringList);
   pragma Import
    (C, addItems_wrapper, "__Qt4Ada_QListWidget_addItems_wrapper");

   ---------------
   -- Add_Items --
   ---------------

   procedure Add_Items
    (Self   : not null access Q_List_Widget'Class;
     Labels : Qt4.String_Lists.Q_String_List'Class)
   is
   begin
      addItems_wrapper
       (Self.QObject_View,
        Qt4.String_Lists.Internals.QStringList_View (Labels));
   end Add_Items;

   pragma Style_Checks ("N");

   --------------
   -- Add_Item --
   --------------

   procedure Add_Item
    (Self : not null access Q_List_Widget'Class;
     Label : Qt4.Strings.Q_String)
   is
   begin
      addItem_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Label));
   end Add_Item;

   -----------
   -- Count --
   -----------

   function Count
    (Self : not null access constant Q_List_Widget'Class)
       return Qt4.Q_Integer
   is
   begin
      return
        count_0_wrapper
         (Self.QObject_View);
   end Count;

   -----------------
   -- Current_Row --
   -----------------

   function Current_Row
    (Self : not null access constant Q_List_Widget'Class)
       return Qt4.Q_Integer
   is
   begin
      return
        currentRow_0_wrapper
         (Self.QObject_View);
   end Current_Row;

   -----------------
   -- Insert_Item --
   -----------------

   procedure Insert_Item
    (Self : not null access Q_List_Widget'Class;
     Row : Qt4.Q_Integer;
     Label : Qt4.Strings.Q_String)
   is
   begin
      insertItem_0_wrapper
       (Self.QObject_View,
        Row,
        Qt4.Strings.Internals.QString_View (Label));
   end Insert_Item;

   ------------------------
   -- Is_Sorting_Enabled --
   ------------------------

   function Is_Sorting_Enabled
    (Self : not null access constant Q_List_Widget'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isSortingEnabled_0_wrapper
           (Self.QObject_View));
   end Is_Sorting_Enabled;

   ---------------------
   -- Set_Current_Row --
   ---------------------

   procedure Set_Current_Row
    (Self : not null access Q_List_Widget'Class;
     Row : Qt4.Q_Integer)
   is
   begin
      setCurrentRow_0_wrapper
       (Self.QObject_View,
        Row);
   end Set_Current_Row;

   -------------------------
   -- Set_Sorting_Enabled --
   -------------------------

   procedure Set_Sorting_Enabled
    (Self : not null access Q_List_Widget'Class;
     Enable : Standard.Boolean)
   is
   begin
      setSortingEnabled_0_wrapper
       (Self.QObject_View,
        Qt4.To_bool (Enable));
   end Set_Sorting_Enabled;

   -----------
   -- Clear --
   -----------

   procedure Clear
    (Self : not null access Q_List_Widget'Class)
   is
   begin
      clear_0_wrapper
       (Self.QObject_View);
   end Clear;

end Qt4.List_Widgets;
