1. ------------------------------------------------------------------------------ 
  2. --               GtkAda - Ada95 binding for the Gimp Toolkit                -- 
  3. --                                                                          -- 
  4. --                     Copyright (C) 2008-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. with Glib.Types; 
  25. with Gtk.Tree_Model; 
  26. with Gtkada.Abstract_Tree_Model; 
  27.  
  28. package Gtkada.Abstract_List_Model is 
  29.  
  30.    type Gtk_Abstract_List_Model_Record is 
  31.       new Gtkada.Abstract_Tree_Model.Gtk_Abstract_Tree_Model_Record 
  32.       with null record; 
  33.    --  Conceptually, this is an abstract type, but this prevents the 
  34.    --  instantiation of Glib.Types.Implements 
  35.  
  36.    type Gtk_Abstract_List_Model is 
  37.       access all Gtk_Abstract_List_Model_Record'Class; 
  38.  
  39.    procedure Initialize (Self : access Gtk_Abstract_List_Model_Record'Class); 
  40.  
  41.    function Get_Flags 
  42.      (Self : access Gtk_Abstract_List_Model_Record) 
  43.       return Gtk.Tree_Model.Tree_Model_Flags; 
  44.    --  Return a set of flags supported by this interface. 
  45.  
  46.    function Has_Child 
  47.      (Self : access Gtk_Abstract_List_Model_Record; 
  48.       Iter : Gtk.Tree_Model.Gtk_Tree_Iter) return Boolean; 
  49.    --  Return True if Iter has children, False otherwise. 
  50.  
  51.    function Children 
  52.      (Self   : access Gtk_Abstract_List_Model_Record; 
  53.       Parent : Gtk.Tree_Model.Gtk_Tree_Iter) 
  54.       return Gtk.Tree_Model.Gtk_Tree_Iter; 
  55.    --  Returns the first child of Parent. 
  56.  
  57.    function Parent 
  58.      (Self  : access Gtk_Abstract_List_Model_Record; 
  59.       Child : Gtk.Tree_Model.Gtk_Tree_Iter) 
  60.       return Gtk.Tree_Model.Gtk_Tree_Iter; 
  61.    --  Returns the parent of Child. For the list it always returns Null_Iter. 
  62.  
  63.    ---------------- 
  64.    -- Interfaces -- 
  65.    ---------------- 
  66.  
  67.    package Implements_Gtk_Tree_Model is new Glib.Types.Implements 
  68.       (Gtk.Tree_Model.Gtk_Tree_Model, Gtk_Abstract_List_Model_Record, 
  69.        Gtk_Abstract_List_Model); 
  70.    function "+" 
  71.       (Widget : access Gtk_Abstract_List_Model_Record'Class) 
  72.       return Gtk.Tree_Model.Gtk_Tree_Model 
  73.       renames Implements_Gtk_Tree_Model.To_Interface; 
  74.    function "-" 
  75.       (Interf : Gtk.Tree_Model.Gtk_Tree_Model) 
  76.       return Gtk_Abstract_List_Model 
  77.       renames Implements_Gtk_Tree_Model.To_Object; 
  78.  
  79. end Gtkada.Abstract_List_Model;