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. --  Gtk.Recent_Info.Gtk_Recent_Info is an opaque data structure whose members 
  26. --  can only be accessed using the provided API. 
  27. -- 
  28. --  Gtk.Recent_Info.Gtk_Recent_Info constains all the meta-data associated 
  29. --  with an entry in the recently used files list. 
  30. -- 
  31. --  </description> 
  32. pragma Ada_2005; 
  33.  
  34. pragma Warnings (Off, "*is already use-visible*"); 
  35. with Gdk.Pixbuf;  use Gdk.Pixbuf; 
  36. with Glib;        use Glib; 
  37. with Glib.G_Icon; use Glib.G_Icon; 
  38.  
  39. package Gtk.Recent_Info is 
  40.  
  41.    type Gtk_Recent_Info is new Glib.C_Boxed with null record; 
  42.    Null_Gtk_Recent_Info : constant Gtk_Recent_Info; 
  43.  
  44.    function From_Object (Object : System.Address) return Gtk_Recent_Info; 
  45.    function From_Object_Free (B : access Gtk_Recent_Info'Class) return Gtk_Recent_Info; 
  46.    pragma Inline (From_Object_Free, From_Object); 
  47.  
  48.    subtype time_t is Long_Integer; 
  49.    --  Type to interface with C's time_t type.  To convert this to/from 
  50.    --  an Ada type, look at Ada.Calendar.Conversion_Operations and be 
  51.    --  sure to pay special attention to the ranges each type is capable 
  52.    --  of representing. 
  53.  
  54.    ------------------ 
  55.    -- Constructors -- 
  56.    ------------------ 
  57.  
  58.    function Get_Type return Glib.GType; 
  59.    pragma Import (C, Get_Type, "gtk_recent_info_get_type"); 
  60.  
  61.    ------------- 
  62.    -- Methods -- 
  63.    ------------- 
  64.  
  65.    function Create_App_Info 
  66.       (Self     : Gtk_Recent_Info; 
  67.        App_Name : UTF8_String := "") return Glib.GApp_Info; 
  68.    --  Creates a Glib.GApp_Info for the specified 
  69.    --  Gtk.Recent_Info.Gtk_Recent_Info 
  70.    --  "app_name": the name of the application that should be mapped to a 
  71.    --  Glib.GApp_Info; if null is used then the default application for the 
  72.    --  MIME type is used 
  73.  
  74.    function Exists (Self : Gtk_Recent_Info) return Boolean; 
  75.    --  Checks whether the resource pointed by Info still exists. At the moment 
  76.    --  this check is done only on resources pointing to local files. 
  77.    --  Since: gtk+ 2.10 
  78.  
  79.    function Get_Added (Self : Gtk_Recent_Info) return time_t; 
  80.    --  Gets the timestamp (seconds from system's Epoch) when the resource was 
  81.    --  added to the recently used resources list. 
  82.    --  Since: gtk+ 2.10 
  83.  
  84.    function Get_Age (Self : Gtk_Recent_Info) return Gint; 
  85.    --  Gets the number of days elapsed since the last update of the resource 
  86.    --  pointed by Info. 
  87.    --  Since: gtk+ 2.10 
  88.  
  89.    function Get_Description (Self : Gtk_Recent_Info) return UTF8_String; 
  90.    --  Gets the (short) description of the resource. 
  91.    --  Since: gtk+ 2.10 
  92.  
  93.    function Get_Display_Name (Self : Gtk_Recent_Info) return UTF8_String; 
  94.    --  Gets the name of the resource. If none has been defined, the basename 
  95.    --  of the resource is obtained. 
  96.    --  Since: gtk+ 2.10 
  97.  
  98.    function Get_Gicon (Self : Gtk_Recent_Info) return Glib.G_Icon.G_Icon; 
  99.    --  Retrieves the icon associated to the resource MIME type. 
  100.    --  Since: gtk+ 2.22 
  101.  
  102.    function Get_Icon 
  103.       (Self : Gtk_Recent_Info; 
  104.        Size : Gint) return Gdk.Pixbuf.Gdk_Pixbuf; 
  105.    --  Retrieves the icon of size Size associated to the resource MIME type. 
  106.    --  Since: gtk+ 2.10 
  107.    --  "size": the size of the icon in pixels 
  108.  
  109.    function Get_Mime_Type (Self : Gtk_Recent_Info) return UTF8_String; 
  110.    --  Gets the MIME type of the resource. 
  111.    --  Since: gtk+ 2.10 
  112.  
  113.    function Get_Modified (Self : Gtk_Recent_Info) return time_t; 
  114.    --  Gets the timestamp (seconds from system's Epoch) when the resource was 
  115.    --  last modified. 
  116.    --  Since: gtk+ 2.10 
  117.  
  118.    function Get_Private_Hint (Self : Gtk_Recent_Info) return Boolean; 
  119.    --  Gets the value of the "private" flag. Resources in the recently used 
  120.    --  list that have this flag set to True should only be displayed by the 
  121.    --  applications that have registered them. 
  122.    --  Since: gtk+ 2.10 
  123.  
  124.    function Get_Short_Name (Self : Gtk_Recent_Info) return UTF8_String; 
  125.    --  Computes a valid UTF-8 string that can be used as the name of the item 
  126.    --  in a menu or list. For example, calling this function on an item that 
  127.    --  refers to "file:///foo/bar.txt" will yield "bar.txt". 
  128.    --  Since: gtk+ 2.10 
  129.  
  130.    function Get_Uri (Self : Gtk_Recent_Info) return UTF8_String; 
  131.    --  Gets the URI of the resource. 
  132.    --  Since: gtk+ 2.10 
  133.  
  134.    function Get_Uri_Display (Self : Gtk_Recent_Info) return UTF8_String; 
  135.    --  Gets a displayable version of the resource's URI. If the resource is 
  136.    --  local, it returns a local path; if the resource is not local, it returns 
  137.    --  the UTF-8 encoded content of Gtk.Recent_Info.Get_Uri. 
  138.    --  Since: gtk+ 2.10 
  139.  
  140.    function Get_Visited (Self : Gtk_Recent_Info) return time_t; 
  141.    --  Gets the timestamp (seconds from system's Epoch) when the resource was 
  142.    --  last visited. 
  143.    --  Since: gtk+ 2.10 
  144.  
  145.    function Has_Application 
  146.       (Self     : Gtk_Recent_Info; 
  147.        App_Name : UTF8_String) return Boolean; 
  148.    --  Checks whether an application registered this resource using App_Name. 
  149.    --  Since: gtk+ 2.10 
  150.    --  "app_name": a string containing an application name 
  151.  
  152.    function Has_Group 
  153.       (Self       : Gtk_Recent_Info; 
  154.        Group_Name : UTF8_String) return Boolean; 
  155.    --  Checks whether Group_Name appears inside the groups registered for the 
  156.    --  recently used item Info. 
  157.    --  Since: gtk+ 2.10 
  158.    --  "group_name": name of a group 
  159.  
  160.    function Is_Local (Self : Gtk_Recent_Info) return Boolean; 
  161.    --  Checks whether the resource is local or not by looking at the scheme of 
  162.    --  its URI. 
  163.    --  Since: gtk+ 2.10 
  164.  
  165.    function Last_Application (Self : Gtk_Recent_Info) return UTF8_String; 
  166.    --  Gets the name of the last application that have registered the recently 
  167.    --  used resource represented by Info. 
  168.    --  Since: gtk+ 2.10 
  169.  
  170.    function Match 
  171.       (Self   : Gtk_Recent_Info; 
  172.        Info_B : Gtk_Recent_Info) return Boolean; 
  173.    --  Checks whether two Gtk.Recent_Info.Gtk_Recent_Info structures point to 
  174.    --  the same resource. 
  175.    --  Since: gtk+ 2.10 
  176.    --  "info_b": a Gtk.Recent_Info.Gtk_Recent_Info 
  177.  
  178.    procedure Ref (Self : Gtk_Recent_Info); 
  179.    --  Increases the reference count of Recent_Info by one. 
  180.    --  Since: gtk+ 2.10 
  181.  
  182.    procedure Unref (Self : Gtk_Recent_Info); 
  183.    --  Decreases the reference count of Info by one. If the reference count 
  184.    --  reaches zero, Info is deallocated, and the memory freed. 
  185.    --  Since: gtk+ 2.10 
  186.  
  187. private 
  188.  
  189.    Null_Gtk_Recent_Info : constant Gtk_Recent_Info := (Glib.C_Boxed with null record); 
  190.  
  191. end Gtk.Recent_Info;