1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-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. --  <description> 
  25. --  The Gtk.Cell_Editable.Gtk_Cell_Editable interface must be implemented for 
  26. --  widgets to be usable when editing the contents of a 
  27. --  Gtk.Tree_View.Gtk_Tree_View cell. 
  28. -- 
  29. --  </description> 
  30. --  <group>Trees and Lists</group> 
  31. pragma Ada_2005; 
  32.  
  33. pragma Warnings (Off, "*is already use-visible*"); 
  34. with Gdk.Event;       use Gdk.Event; 
  35. with Glib;            use Glib; 
  36. with Glib.Object;     use Glib.Object; 
  37. with Glib.Properties; use Glib.Properties; 
  38. with Glib.Types;      use Glib.Types; 
  39.  
  40. package Gtk.Cell_Editable is 
  41.  
  42.    type Gtk_Cell_Editable is new Glib.Types.GType_Interface; 
  43.    Null_Gtk_Cell_Editable : constant Gtk_Cell_Editable; 
  44.  
  45.    ------------------ 
  46.    -- Constructors -- 
  47.    ------------------ 
  48.  
  49.    function Get_Type return Glib.GType; 
  50.    pragma Import (C, Get_Type, "gtk_cell_editable_get_type"); 
  51.  
  52.    ------------- 
  53.    -- Methods -- 
  54.    ------------- 
  55.  
  56.    procedure Editing_Done (Cell_Editable : Gtk_Cell_Editable); 
  57.    pragma Import (C, Editing_Done, "gtk_cell_editable_editing_done"); 
  58.    --  Emits the Gtk.Cell_Editable.Gtk_Cell_Editable::editing-done signal. 
  59.  
  60.    procedure Remove_Widget (Cell_Editable : Gtk_Cell_Editable); 
  61.    pragma Import (C, Remove_Widget, "gtk_cell_editable_remove_widget"); 
  62.    --  Emits the Gtk.Cell_Editable.Gtk_Cell_Editable::remove-widget signal. 
  63.  
  64.    procedure Start_Editing 
  65.       (Cell_Editable : Gtk_Cell_Editable; 
  66.        Event         : Gdk.Event.Gdk_Event); 
  67.    pragma Import (C, Start_Editing, "gtk_cell_editable_start_editing"); 
  68.    --  Begins editing on a Cell_Editable. Event is the Gdk.Event.Gdk_Event 
  69.    --  that began the editing process. It may be null, in the instance that 
  70.    --  editing was initiated through programatic means. 
  71.    --  "event": A Gdk.Event.Gdk_Event, or null 
  72.  
  73.    ---------------- 
  74.    -- Properties -- 
  75.    ---------------- 
  76.    --  The following properties are defined for this widget. See 
  77.    --  Glib.Properties for more information on properties) 
  78.  
  79.    Editing_Canceled_Property : constant Glib.Properties.Property_Boolean; 
  80.    --  Indicates whether editing on the cell has been canceled. 
  81.  
  82.    ------------- 
  83.    -- Signals -- 
  84.    ------------- 
  85.  
  86.    type Cb_Gtk_Cell_Editable_Void is not null access procedure (Self : Gtk_Cell_Editable); 
  87.  
  88.    type Cb_GObject_Void is not null access procedure 
  89.      (Self : access Glib.Object.GObject_Record'Class); 
  90.  
  91.    Signal_Editing_Done : constant Glib.Signal_Name := "editing-done"; 
  92.    procedure On_Editing_Done 
  93.       (Self  : Gtk_Cell_Editable; 
  94.        Call  : Cb_Gtk_Cell_Editable_Void; 
  95.        After : Boolean := False); 
  96.    procedure On_Editing_Done 
  97.       (Self  : Gtk_Cell_Editable; 
  98.        Call  : Cb_GObject_Void; 
  99.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  100.        After : Boolean := False); 
  101.    --  This signal is a sign for the cell renderer to update its value from 
  102.    --  the Cell_Editable. 
  103.    -- 
  104.    --  Implementations of Gtk.Cell_Editable.Gtk_Cell_Editable are responsible 
  105.    --  for emitting this signal when they are done editing, e.g. 
  106.    --  Gtk.GEntry.Gtk_Entry is emitting it when the user presses Enter. 
  107.    -- 
  108.    --  Gtk.Cell_Editable.Editing_Done is a convenience method for emitting 
  109.    --  Gtk.Cell_Editable.Gtk_Cell_Editable::editing-done. 
  110.  
  111.    Signal_Remove_Widget : constant Glib.Signal_Name := "remove-widget"; 
  112.    procedure On_Remove_Widget 
  113.       (Self  : Gtk_Cell_Editable; 
  114.        Call  : Cb_Gtk_Cell_Editable_Void; 
  115.        After : Boolean := False); 
  116.    procedure On_Remove_Widget 
  117.       (Self  : Gtk_Cell_Editable; 
  118.        Call  : Cb_GObject_Void; 
  119.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  120.        After : Boolean := False); 
  121.    --  This signal is meant to indicate that the cell is finished editing, and 
  122.    --  the widget may now be destroyed. 
  123.    -- 
  124.    --  Implementations of Gtk.Cell_Editable.Gtk_Cell_Editable are responsible 
  125.    --  for emitting this signal when they are done editing. It must be emitted 
  126.    --  after the Gtk.Cell_Editable.Gtk_Cell_Editable::editing-done signal, to 
  127.    --  give the cell renderer a chance to update the cell's value before the 
  128.    --  widget is removed. 
  129.    -- 
  130.    --  Gtk.Cell_Editable.Remove_Widget is a convenience method for emitting 
  131.    --  Gtk.Cell_Editable.Gtk_Cell_Editable::remove-widget. 
  132.  
  133.    ---------------- 
  134.    -- Interfaces -- 
  135.    ---------------- 
  136.    --  This class implements several interfaces. See Glib.Types 
  137.    -- 
  138.    --  - "Gtk_Cell_Editable" 
  139.  
  140.    function "+" (W : Gtk_Cell_Editable) return Gtk_Cell_Editable; 
  141.    pragma Inline ("+"); 
  142.  
  143. private 
  144.    Editing_Canceled_Property : constant Glib.Properties.Property_Boolean := 
  145.      Glib.Properties.Build ("editing-canceled"); 
  146.  
  147. Null_Gtk_Cell_Editable : constant Gtk_Cell_Editable := 
  148.    Gtk_Cell_Editable (Glib.Types.Null_Interface); 
  149. end Gtk.Cell_Editable;