1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2013, AdaCore                   -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <description> 
  31. --  The Gtk_Cell_Editable interface must be implemented for widgets to be 
  32. --  usable when editing the contents of a Gtk_Tree_View cell 
  33. -- 
  34. --  </description> 
  35. --  <group>Trees and Lists</group> 
  36.  
  37. pragma Warnings (Off, "*is already use-visible*"); 
  38. with Gdk.Event;       use Gdk.Event; 
  39. with Glib;            use Glib; 
  40. with Glib.Properties; use Glib.Properties; 
  41. with Glib.Types;      use Glib.Types; 
  42.  
  43. package Gtk.Cell_Editable is 
  44.  
  45.    type Gtk_Cell_Editable is new Glib.Types.GType_Interface; 
  46.  
  47.    ------------------ 
  48.    -- Constructors -- 
  49.    ------------------ 
  50.  
  51.    function Get_Type return Glib.GType; 
  52.    pragma Import (C, Get_Type, "gtk_cell_editable_get_type"); 
  53.  
  54.    ------------- 
  55.    -- Methods -- 
  56.    ------------- 
  57.  
  58.    procedure Editing_Done (Cell_Editable : Gtk_Cell_Editable); 
  59.    pragma Import (C, Editing_Done, "gtk_cell_editable_editing_done"); 
  60.    --  Emits the Gtk.Cell_Editable.Gtk_Cell_Editable::editing-done signal. 
  61.  
  62.    procedure Remove_Widget (Cell_Editable : Gtk_Cell_Editable); 
  63.    pragma Import (C, Remove_Widget, "gtk_cell_editable_remove_widget"); 
  64.    --  Emits the Gtk.Cell_Editable.Gtk_Cell_Editable::remove-widget signal. 
  65.  
  66.    procedure Start_Editing 
  67.       (Cell_Editable : Gtk_Cell_Editable; 
  68.        Event         : Gdk.Event.Gdk_Event); 
  69.    pragma Import (C, Start_Editing, "gtk_cell_editable_start_editing"); 
  70.    --  Begins editing on a Cell_Editable. Event is the GdkEvent that began the 
  71.    --  editing process. It may be null, in the instance that editing was 
  72.    --  initiated through programatic means. 
  73.    --  "event": A GdkEvent, or null 
  74.  
  75.    ---------------- 
  76.    -- Properties -- 
  77.    ---------------- 
  78.    --  The following properties are defined for this widget. See 
  79.    --  Glib.Properties for more information on properties) 
  80.    -- 
  81.    --  Name: Editing_Canceled_Property 
  82.    --  Type: Boolean 
  83.    --  Flags: read-write 
  84.    --  Indicates whether editing on the cell has been canceled. 
  85.  
  86.    Editing_Canceled_Property : constant Glib.Properties.Property_Boolean; 
  87.  
  88.    ------------- 
  89.    -- Signals -- 
  90.    ------------- 
  91.    --  The following new signals are defined for this widget: 
  92.    -- 
  93.    --  "editing-done" 
  94.    --     procedure Handler (Self : access Gtk_Cell_Editable); 
  95.    --  This signal is a sign for the cell renderer to update its value from 
  96.    --  the Cell_Editable. Implementations of 
  97.    --  Gtk.Cell_Editable.Gtk_Cell_Editable are responsible for emitting this 
  98.    --  signal when they are done editing, e.g. Gtk.GEntry.Gtk_Entry is emitting 
  99.    --  it when the user presses Enter. Gtk.Cell_Editable.Editing_Done is a 
  100.    --  convenience method for emitting GtkCellEditable::editing-done. 
  101.    -- 
  102.    --  "remove-widget" 
  103.    --     procedure Handler (Self : access Gtk_Cell_Editable); 
  104.    --  This signal is meant to indicate that the cell is finished editing, and 
  105.    --  the widget may now be destroyed. Implementations of 
  106.    --  Gtk.Cell_Editable.Gtk_Cell_Editable are responsible for emitting this 
  107.    --  signal when they are done editing. It must be emitted after the 
  108.    --  Gtk.Cell_Editable.Gtk_Cell_Editable::editing-done signal, to give the 
  109.    --  cell renderer a chance to update the cell's value before the widget is 
  110.    --  removed. Gtk.Cell_Editable.Remove_Widget is a convenience method for 
  111.    --  emitting GtkCellEditable::remove-widget. 
  112.  
  113.    Signal_Editing_Done : constant Glib.Signal_Name := "editing-done"; 
  114.    Signal_Remove_Widget : constant Glib.Signal_Name := "remove-widget"; 
  115.  
  116. private 
  117.    Editing_Canceled_Property : constant Glib.Properties.Property_Boolean := 
  118.      Glib.Properties.Build ("editing-canceled"); 
  119. end Gtk.Cell_Editable;